Anthropic's /context shows you "60% used."
It won't tell you that 50,000 of those tokens went to MCP tools you never called.
tokenlens itemizes the bill.
You're paying $200 a month for Claude Max. Your weekly limit feels tighter than the number on the bill should allow. The built-in /context command shows a friendly percentage and nothing else.
Anthropic shipped Claude Code with a context inspector that undercounts. MCP server definitions, re-injected memory files, skill listings, dead tool schemas — all loaded into the cache, none of them surfaced as line items. The percentage is honest only about the part the vendor wants to be honest about.
A developer named Ryan filed Issue #29971 in March, documenting the undercount with reproductions. Anthropic closed it as not planned. tokenlens exists because their closure was your invitation.
statusOne-shot breakdown of the active session. Anthropic's exact per-turn usage from message.usage, attributed by skill, and a share-by-weight split of what each injected source contributed to cache writes. Honest about what we can't attribute.
$ tokenlens status Output by attributionSkill <unattributed> ████████████████ 208.7k (213 turns) idea-scout ██████░░░░░░░░░░ 92.6k (65 turns) Injected context by source cache_invalidation_or_growth ████ ! 520.3k across 16 turns deferred_tools_added █░░░ ~25.0k skill_listing ░░░░ 1.5k hook_additional_context ░░░░ 791
$ tokenlens watch Usage turns 263 input (uncached) 38.9k cache writes 2.06M ← bloat cache reads 41.21M ← cheap cache hit rate 95.2% updated 02:14:38 · 1.4 MB on disk ctrl-c to stop
watchSame view as status, refreshed as the session jsonl grows. Pin it in a side pane while you work and watch the cache_creation column climb in real time. The number you wish /context showed you, exposed.
doctorDetects the two pathologies the upstream issue documented but the vendor declined to fix — stale plugin versions still being injected, and duplicate skill symlinks paying double rent. Dry-run by default. --fix to apply. Refuses to touch anything outside ~/.claude/.
$ tokenlens doctor tokenlens doctor ~/.claude → /Users/you/.claude mode: dry-run (pass --fix to apply) Stale plugin versions ✓ none found Duplicate skill symlinks ✓ none found Nothing to do.
$ tokenlens budget decision ● DENY (at or above block threshold) consumed 4.00M (input + cache_creation + output) budget 2.50M tier=max5 used ████████████████████████ 159.9% warn at 50% ask at 80% block at 95% hardCap=false
budgetWhat the v2 plugin enforces in-session: a 50/80/95 ladder against your configured weekly cap. Surfaceable from the CLI before you spend the next turn. Tier presets for Pro, Max 5×, Max 20×, and direct API.
tokenlens-ccA Claude Code plugin that wires into the PreToolUse hook. Every tool call is checked against your weekly budget. Below 50% it's silent. Above 80% it asks. Above 95% it denies. Fail-allow on every error path — a broken hook never breaks your workflow.
Pending community marketplace review.
$ claude --plugin-dir ./tokenlens-cc [tokenlens] loaded · weekly budget 2.5M (max5) › read the auth module tokenlens: this turn will push you to ~91% of your weekly cap (2.27M / 2.50M tokens). Continue? [ y/n ]
not planned.
— Issue #29971 · closed by Anthropic · March 2026
We did it anyway.