Claudetop – htop for Claude Code sessions (see your AI spend in real-time) (github.com)

by liorwn 28 comments 52 points
Read article View on HN

28 comments

[−] sgarland 63d ago

    curl -fsSL https://raw.githubusercontent.com/liorwn/claudetop/main/install.sh | bash
    Installing claudetop...
    cp: /Users/sgarland/claudetop.sh: No such file or directory
You need to have it handle being piped; right now it expects to find itself at $PWD. It also makes several other assumptions, like the location of Claude, and that the user wants stats being /usr/local/bin.
[−] brikym 63d ago
Nice idea. A sounds plugin would be great. Imagine if you could gauge the spend just by a geiger counter, or the tempo of a song. Any chance of opencode support?
[−] alexsmirnov 62d ago
The calculation misses subagents tokens, that can be a significant differences. Better to parse session jsonl files ~/.claude/projects//.jsonl and ~/.claude/projects///subagents/.jsonl
[−] amelius 63d ago
Anthropic should work on their billing. It's crazy. I did my best to not get billed more than I consciously pay into my account, auto reload is off and never was on, but still now the meter shows an unpaid balance. This is nuts. One customer is angry and disappointed. This is totally unnecessary.

And why do I need to create a new API key whenever I run out of balance?

[−] beepbooptheory 63d ago
Something kinda disturbing seeing a USD cost like that in a cute top-like TUI. It's like numbers I expect to see as rather variable and sometimes ballooning, except it's attached to my credit card. Like just reflexively terrifying I guess.
[−] brcmthrowaway 63d ago
Have you tried a local model?
[−] rvz 63d ago
The Qwen series are very good local models.
[−] hirehalai 63d ago
[flagged]
[−] liorwn 63d ago
I built this after noticing a $65 charge for what felt like a $10 session. Turns out, context compaction was hiding 80% of my token usage. Real cost, no visibility.

claudetop is a status line for Claude Code that shows your burn rate, cache efficiency, model cost comparison, and smart alerts (like "TRY /fast" when Opus is overkill for the task). Plugin system for extensibility — Spotify, CI status, calendar, etc.

Single bash script, zero dependencies beyond jq. One-command install.

[−] cortesoft 63d ago
I am always a hit confused when people talk about these charges... are you not using the subscriptions with the flat rates? I am on the $100 a month plan, and am constantly using clause code and never coming close to my limits. Maybe I am just not using it at the levels of some people...
[−] jakeinspace 63d ago
Please type things yourself. Or at least prompt your LLM of choice to sound less canned.
[−] Self-Perfection 63d ago

> like "TRY /fast" when Opus is overkill for the task

In fact using /fast in this case would only increase spending. /fast mode uses the same opus but consumes $$$$ faster to produce tokens faster )

https://code.claude.com/docs/en/fast-mode

[−] js2 63d ago
I asked Claude Opus yesterday if it could put my token cost (and tokens remaining) into the status bar and it insisted there was no way to get this information.

ETA: ah, this isn't getting real time cost from an Anthropic API or anything. It's estimating it based on token usage and a JSON config file that specifies token cost.

[−] sneak 63d ago
I believe there is a new HN guideline asking people not to post AI slop as comments.