For Claude Pro, Max and Claude Code

Where are my Claude tokens going?

Tokenhog shows how close you are to your plan limits, what each session, project and machine costs, and what to change to spend less. It runs on your own machines, needs no account and sends nothing to anyone.

/plugin install tokenhog --marketplace Igor-G/tokenhog

In Claude Code. Then ask Claude to “install Tokenhog”.

Tokenhog
5-hour limit 62%
Runs out at 15:40 Resets at 16:00
Weekly limit 38%
Fine at this pace Resets Thu 09:00

Live now

Refactor the billing module$4.1221 minapi-server · Opus · 3 subagents
Fix the flaky upload test$1.068 minweb-app · Sonnet
Nightly dependency check$0.31scheduleddevbox · Haiku · headless

Worth changing ≈ $23 a week

fixKeep only failures from test runsApply≈ $9 a week · undo any time
Example data.
Local-firstA SQLite file on your machines
Zero token costRules, never a model call
Open sourceMIT or Apache 2.0
macOS, Linux, WindowsMenu bar app on macOS

Everything your plan meter doesn’t tell you

Claude Code already writes down every request it makes. Tokenhog reads those records as they happen and turns them into answers.

Plan meter with pace

Your 5-hour and weekly limits in the menu bar, and a warning when you’re on track to hit one before it resets, not after.

Every session, every machine

Cost per session, project, model, subagent, skill and MCP server, including headless (claude -p) and SDK runs, from every machine you use.

Who used the limit

Which sessions ate the current window, and which ones ate the windows that already reset: you, your subagents, background tasks or a scheduled job.

Fixes you can apply and undo

Rules find what costs tokens without earning them: oversized outputs, big contexts, expired caches, expensive models doing simple work, unused skills and MCP servers. Each one is previewed, backed up and reversible.

Proof that a fix worked

Every applied fix is measured against your own baseline, with a range, a verdict and checks that quality didn’t drop.

Costs nothing to run

Recommendations are rule-based, so Tokenhog never spends your tokens to save them. The agent idles at about 0% CPU and a few MB of memory.

See who used the limit

Hit the limit at 2 pm and not sure how? Tokenhog splits every window by where the usage came from, then by session, so the surprise has a name.

  • Subagents and background tasks are counted against the session that started them.
  • Scheduled and headless runs show up on their own, not hidden inside “other”.
  • Windows that already reset stay browsable.
This 5-hour window62% used
  • You41%
  • Subagents27%
  • Other sessions14%
  • Background tasks8%
  • Scheduled6%
  • Headless (-p / SDK)4%
Example data.
fixKeep only failures from test runs

Passing tests fill the context and are re-read on every turn. Keep the failures and the summary.

PreviewApply≈ $9 a week
✓Paid offapplied 9 days ago

Cost per session −31% (likely between −22% and −38%) against your own baseline. Tests still pass as often as before.

Undo
Example data.

Spend less, and know it worked

Each recommendation comes with an estimated weekly saving and shows exactly what it would change before you say yes.

  • Every change is backed up and journaled. tokenhog undo puts it back.
  • Afterwards it’s measured against your own usage, not a benchmark.
  • If a fix didn’t pay off, Tokenhog says so.

All your machines in one place

Laptop, desktop, a dev box, containers, a cloud sandbox: they all count against the same plan. Pick one main machine and the others send their usage to it.

Work laptopsame network · paired with a code
Dev containertranscripts shared with the host
Cloud sandboxanywhere · through the relay
Your main machine every session, every machine, one plan meter
1
Turn on the relay

On the main machine, flip Connect my machines anywhere in Settings › Machines.

2
Upload the invite once

Add the invite it makes to your claude.ai account as a skill. Claude Code brings it to every machine you sign in on.

3
That’s it

Tokenhog on those machines joins by itself, tells you it did, and tokenhog leave undoes it.

On the same network, a short code like K7QM-4TZP pairs two machines without the relay. The relay only passes sealed batches it can’t read, and machines can only send, never read.

Your usage stays yours

Tokenhog is a local tool. There is no Tokenhog account, server or dashboard in the cloud.

  • Everything stays in a local SQLite database on your machines.
  • It reads Claude Code’s own files and status line. It never reads your credentials and never calls undocumented endpoints.
  • No code is stored. The only text kept is your last prompt per session, to name sessions in the app, and you can turn that off.
  • No telemetry. Machines you pair talk end-to-end encrypted.

Install

Free and open source. The installer asks before it changes anything.

Easiest, on any system. In Claude Code, type:

/plugin install tokenhog --marketplace Igor-G/tokenhog

Then ask Claude to “install Tokenhog”. It says what will change, asks, and runs the installer.

On every machine you sign in on: at claude.ai, go to Customize › Plugins › Add marketplace, enter Igor-G/tokenhog and turn the plugin on. A new machine without Tokenhog then suggests it once a day.

Prefer the terminal?

# what was collected, by session, project and model
tokenhog report
# recommendations, with an estimated weekly saving each
tokenhog advise
# show exactly what a fix would change, then apply it
tokenhog apply 1 --dry-run
tokenhog apply 1
# what's applied, and whether it paid off
tokenhog applied

Questions

Does Tokenhog use my tokens?

No. It reads the records Claude Code already writes and works out costs and recommendations with rules. It never calls a model.

Does it need my Claude login?

No. It never reads your credentials. From Claude Code’s config it reads only your account’s ID, to tell whether an invite is yours.

How accurate are the costs?

They’re estimated from list prices and your plan meter readings, so they’re close, but they aren’t an invoice.

Does it count sessions in containers and sandboxes?

Claude Code’s own sandbox and ClaudeBox are counted as they are. A dev container or Docker container can share its transcripts folder with the host, and machines elsewhere, like cloud sandboxes or Codespaces, can send through the relay.

What does the relay see?

Sealed batches it can’t read, their sizes and times. It can’t pose as your main machine, and it can’t add a machine without your invite. You can run your own: it’s a small open-source Cloudflare Worker.

How do I remove it?

tokenhog agent uninstall stops the agent, tokenhog unsetup restores your previous status line, and fixes you applied can be undone first with tokenhog undo.