Skip to content

About

Non-intrusive Windows 11 desktop HUD monitoring LLM usage and agent activity across AI coding tools.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

130 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TokenHound logo

TokenHound 🐢

A non-intrusive Windows 11 desktop HUD monitoring LLM usage, rate limits, and agent activity across AI coding tools.

CI .NET 10 Windows 11 WPF License: MIT

TokenHound is a lightweight, peripheral desktop notch / HUD crafted specifically for Windows 11. It provides continuous, glanceable insight into token consumption, rate limit reset windows, and live agent activity across local AI coding assistantsβ€”without stealing window focus or cluttering your workspace.


Key Features

  • Dock the HUD at the top left, top center, top right, left edge, or right edge of your chosen monitor. Side placements use a vertical capsule. Drag a docked HUD to slide it along its edge; on the top edge it becomes Top left or Top right at the corners. Choose Free in the Position menu to place it anywhere. Placement is saved across launches.
  • Zero Focus Disruption (WS_EX_NOACTIVATE): Built using native Win32 interop so the notch never steals keyboard or window focus from your IDE, terminal, or browser.
  • Adjust HUD size in Settings. Changes apply immediately and are saved across launches.
  • Translucent (Acrylic) HUD background on Windows 11, on by default and switchable in Settings > General, with a transparency slider from 0 to 50 % (default 7 %; higher values reduce contrast over bright backgrounds). Settings explains why when Windows keeps it off. The HUD uses the solid background while Windows transparency effects are off, or while energy saver or high contrast is on.
  • Enable or disable startup at Windows logon in Settings, with support for the installer's startup option.
  • "Borrow, Don't Own" Principle: Never initiates competing logins or asks for raw passwords. TokenHound safely reads existing local sessions (Windows Credential Manager, DPAPI, SQLite WAL databases) in read-only mode (FileShare.ReadWrite | FileShare.Delete).
  • Zero Fake Data: Strictly reports honest telemetry. If an API provider only exposes remaining quota without a total limit, TokenHound will never invent percentages or artificial denominators.
  • HTTP 429 Resilience & Persistence: Backoff deadlines and rate-limit states are persisted to %LOCALAPPDATA%\TokenHound\, guaranteeing that restart cycles will never hammer provider endpoints under active penalty windows.
  • Self-Updating from GitHub Releases: Checks the latest stable release periodically (every 24 h by default) and from the tray or HUD menu ("Check for Updates…"), asks before installing, verifies the download (size and SHA-256 when published), and restarts on the new version. See Updates.
  • Ultra-Lean Resource Usage: Operates continuously at approximately ~30–45 MB RAM in idle desktop state.

The capsule uses inverse rounded joins where it meets a screen edge, and clicks outside its visible contour pass through to the application behind it. Additional ring animations remain separate follow-up work. See the roadmap for delivered features and planned scope.


Supported Providers

Provider Integration Mechanism Monitored Telemetry
Claude Code %USERPROFILE%\.claude\.credentials.json OAuth token, 5-hour rolling session quotas, 7-day limits
Cursor Local SQLite (state.vscdb, WAL mode) Session requests, plan thresholds, active agent status
OpenAI Codex stdio JSON-RPC bridge & rollout logs Execution tokens, rate-limit resets, active command states
Google Antigravity / Gemini Language server IPC & Windows Credential Manager (gemini:antigravity) 5-hour and weekly model-group quotas, session transcripts
GitHub Copilot Borrowed gh / Copilot CLI OAuth token & internal quota API Monthly premium interactions, reset windows, billing AI credits, active CLI sessions
OpenCode Go Borrowed auth.json API key & official usage API 5-hour rolling, weekly, and monthly quotas, process and session activity
Cline Borrowed providers.json session & account API (api.cline.bot) Credit balance, plan scope, local session token usage, free-model limit, hub/CLI activity
Z.ai GLM (soon) Local config discovery & direct metering API Coding plan usage, daily quota allocation
Perplexity (soon) Isolated WebView2 session borrowing Real-time search queries and rate limit quotas

Images

HUD

Provider Status

Provider status window

Settings

Settings: Providers

Settings: Cadence & Rate Limits

Architecture & Solution Structure

TokenHound is architected following Clean Architecture principles on .NET 10:

TokenHound/
β”œβ”€β”€ TokenHound.slnx                         # Solution file (native .NET 10 SLNX format)
β”œβ”€β”€ ARCHITECTURE.md                         # Detailed architecture and technology rationale
β”œβ”€β”€ AGENTS.md                               # Repository coding standards and invariants
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ TokenHound.Core/                    # Pure domain models, contracts, and policies (net10.0)
β”‚   β”‚   β”œβ”€β”€ Models/                         # Immutable snapshots, limit windows, agent sessions
β”‚   β”‚   β”œβ”€β”€ Contracts/                      # IUsageProvider, IActivityMonitor, ICredentialStore
β”‚   β”‚   └── Policies/                       # BackoffCalculator, RateLimitPolicy, RefreshSchedulePolicy
β”‚   β”‚
β”‚   β”œβ”€β”€ TokenHound.Infrastructure/          # Windows 11 OS interop, storage, and providers (net10.0)
β”‚   β”‚   β”œβ”€β”€ Engine/                         # UsageStore, historical state persistence
β”‚   β”‚   β”œβ”€β”€ Security/                       # Windows Credential Manager P/Invoke, DPAPI
β”‚   β”‚   β”œβ”€β”€ Storage/                        # SQLite WAL reader, safe shared file access
β”‚   β”‚   β”œβ”€β”€ System/                         # Process discovery, TCP table helper, power events
β”‚   β”‚   └── Providers/                      # Provider adapters (Claude, Cursor, Codex, Gemini, Copilot, etc.)
β”‚   β”‚
β”‚   └── TokenHound.App/                     # Windows Presentation Foundation desktop host (net10.0-windows)
β”‚       β”œβ”€β”€ UI/                             # Windows, HUD controls, BΓ©zier geometry, animations
β”‚       β”œβ”€β”€ Interop/                        # Win32 window styles, DWM blur, mouse hook
β”‚       └── ViewModels/                     # MVVM state and provider collection bindings
β”‚
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ TokenHound.Core.Tests/              # Unit tests for domain logic and backoff calculators
β”‚   └── TokenHound.Infrastructure.Tests/    # Integration tests for storage, parsing, and DPAPI
β”‚
└── docs/
    β”œβ”€β”€ specs/                              # 12 deep technical specifications
    └── design/                             # Visual design assets, layout coordinates, and mockups

Updates

TokenHound updates itself from GitHub Releases:

  • When: a check runs shortly after startup and then whenever the interval has elapsed; a balloon notification (no focus stealing) announces a new stable release. Choose Check for Updates… in the tray menu or the HUD right-click menu to check right away. Prereleases are ignored.
  • Your choice: the update dialog offers Update now, Later (asks again at the next due check), and Skip this version.
  • Portable copies (the -fxdependent.zip): the update is downloaded, verified, swapped in place with rollback on failure, and the app restarts. A read-only folder is detected up front and the release page is offered instead.
  • Installed copies (the setup): the installer runs silently for the current user (no elevation prompt) and the app restarts. Installed copies are recognized by the TokenHound.installed marker next to the executable.
  • Settings: Settings > Updates turns automatic checks on or off and sets the interval in hours (0 turns periodic checks off), stored in the Update section of settings.json.
  • Rate limits: GitHub's unauthenticated limit (60 requests per hour) is respected; a 429 deadline is persisted in %LOCALAPPDATA%\TokenHound\update-state.json and honored across restarts.

Getting Started

Prerequisites

  • Windows 11 (Build 22000 or higher recommended)
  • .NET 10 SDK (10.0.400 or newer)

Building the Project

Clone the repository and build using the .NET CLI:

# Clone the repository
git clone https://github.com/dougcunha/TokenHound.git
cd TokenHound

# Restore and build the solution
dotnet restore TokenHound.slnx
dotnet build TokenHound.slnx --no-restore

Running Tests

After building the solution, run each test project through its Microsoft.Testing.Platform executable:

dotnet run --project tests/TokenHound.Core.Tests/TokenHound.Core.Tests.csproj --no-build --no-restore -- --minimum-expected-tests 1
dotnet run --project tests/TokenHound.Infrastructure.Tests/TokenHound.Infrastructure.Tests.csproj --no-build --no-restore -- --minimum-expected-tests 1

MCP Server

While TokenHound is running, it exposes the provider metrics behind the HUD to MCP clients through a local server. Two read-only tools are available: list_provider_metrics (every enabled provider) and get_provider_metrics (one provider by ID). Calls read TokenHound's current state; they never trigger a provider refresh or touch rate-limit deadlines.

Transport URL
SSE http://127.0.0.1:37653/mcp/sse
Streamable HTTP http://127.0.0.1:37653/mcp

The server listens on loopback only and stops when TokenHound exits. If port 37653 is taken, the HUD keeps working and the log explains why MCP did not start.

Installing in your harness

Claude Code

claude mcp add --transport sse tokenhound http://127.0.0.1:37653/mcp/sse

Codex CLI β€” ~/.codex/config.toml:

[mcp_servers.tokenhound]
url = "http://127.0.0.1:37653/mcp"

Cursor β€” ~/.cursor/mcp.json (or .cursor/mcp.json in a project):

{
  "mcpServers": {
    "tokenhound": { "url": "http://127.0.0.1:37653/mcp/sse" }
  }
}

VS Code (GitHub Copilot) β€” .vscode/mcp.json, or MCP: Add Server in the Command Palette:

{
  "servers": {
    "tokenhound": { "type": "sse", "url": "http://127.0.0.1:37653/mcp/sse" }
  }
}

Gemini CLI β€” ~/.gemini/settings.json:

{
  "mcpServers": {
    "tokenhound": { "url": "http://127.0.0.1:37653/mcp/sse" }
  }
}

OpenCode β€” opencode.json:

{
  "mcp": {
    "tokenhound": { "type": "remote", "url": "http://127.0.0.1:37653/mcp", "enabled": true }
  }
}

Cline β€” open MCP Servers β†’ Remote Servers, name it tokenhound, and enter http://127.0.0.1:37653/mcp/sse.

For response fields, lookup states, null semantics, and the privacy boundary, see docs/MCP.md.

HUD Feed

While TokenHound is running, it also writes the HUD content to %LOCALAPPDATA%\TokenHound\hud.json: the rings in HUD order, their hover card rows, and the busy state of each agent. Other local apps, such as a Herdr mod, read this file to show the same data. TokenHound replaces the file after each HUD change, every 30 seconds, and one last time at exit. See docs/HUD-FEED.md for the contract.


Technical Documentation

For in-depth specifications and implementation guides, explore the docs/ folder:


Acknowledgements

TokenHound was inspired by codenotch, a macOS notch-based monitor for AI coding tools. TokenHound is an independent implementation built from scratch for Windows 11.

The monochrome provider marks in src/TokenHound.App/Assets/Logos/ProviderGlyphs.xaml (Claude, Codex, Cursor, Antigravity, GLM and Perplexity) are ported from codenotch's GlyphOutline, used under its MIT license; Copilot, Grok, OpenCode, and Cline marks are flattened from official vendor SVGs or brand kits.


License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Non-intrusive Windows 11 desktop HUD monitoring LLM usage and agent activity across AI coding tools.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages