Token Lens

Token consumption analytics for Hermes: records exact per-call usage from pre/post_api_request hooks, decomposes every request into categories (system prompt, built-in and per-MCP-server tool schemas, skills, memory, history, tool results, output, reasoning) calibrated to billed totals, and adds a Token Lens dashboard tab plus a Sessions-page card with deterministic and AI-evaluated token-reduction suggestions; `hermes token-lens refresh` runs a suggestion refresh from the CLI.

Good to know before installing

Records per-API-call token counts (no message text) from pre/post_api_request hooks into token_lens.db at the Hermes home root (per-call rows kept 90 days, rollups kept), and reads Hermes's state.db read-only for session token totals and, during the optional dashboard history import, message text for estimation only; after 10 recorded sessions it automatically calls your configured main model through Hermes's plugin LLM facade every 5 sessions (up to two calls per refresh, capped at 50,000 tokens by meta_budget_tokens), sending aggregated token statistics plus the names of your enabled MCP servers and plugins, and auto-applies the model's proposed category regex rules and rubric changes (logged to token_lens.EVOLUTION.md; evolve_rules: false turns this off); the dashboard's refresh button spawns a detached `hermes token-lens refresh` process that logs to logs/token-lens-refresh.log; its data paths follow the HERMES_HOME environment variable rather than the active profile, so in a multi-profile gateway every profile records into the launch profile's database; no third-party network calls, no telemetry.

From the plugin's catalog listing.

How to install

  1. Install it. Hermes asks for any API keys it needs, then asks whether to turn it on.
    hermes plugins install token-lens
  2. Said no? Turn it on later:
    hermes plugins enable token-lens
  3. Restart Hermes so it loads the plugin.

Some plugins also need a sign-in or settings: see Full setup & settings. Memory plugins ask whether to become your memory provider instead. Steps follow the official plugins guide (opens in a new tab).

Category
Cost, speed & monitoring
Maintained by
patrickluvsoj (Community)
Needs
No API keys declared
Needs Hermes
0.16.0 or newer
Version
0.1.0
In the catalog
2026-10-23, updated 2026-10-24
GitHub stars
3

Full setup & settings ↗Source code ↗

More in cost, speed & monitoring

All cost, speed & monitoring plugins

New Hermes Agent updates every day on X. Follow @HermesWatcher

← All plugins