I kept slamming into Claude Code limits mid-session and couldn’t find a quick way to see how close I was getting, so I hacked together a tiny local tracker.
Streams your prompt + completion usage in real time
Predicts whether you’ll hit the cap before the session ends
Runs 100 % locally (no auth, no server)
Presets for Pro, Max × 5, Max × 20 — tweak a JSON if your plan’s different
GitHub: https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor
It’s already spared me a few “why did my run just stop?” moments, but it’s still rough around the edges. Feedback, bug reports, and PRs welcome!
I really like this idea as I find Claude's transparency frustrating. Claude code's killer features revolve around better tools to manage context and limits vs the desktop app (compact and the % remaining until auto compact), but it's not enough.
If I can offer any advice, it's that the high use of emojis in a project readme (at least for me) looks so unprofessional and makes me worry that a project was vibe -coded in the sense that the AI was possibly not babysat to the extent I think they should. That's just me, though
I got into software in a time where you would get sent to a mental institution when spotted using emojis in a code base. Times have changed.. I use emojis regularly because they help me organize context more visually. Code has now many emojis to keep me happy.
This code was written in pure vibe-coding style — mostly for fun. I've got about 10 years of experience in IT, and even I fully agree: a 1000-line main file like this one probably deserves to be locked away in a secure facility.
But hey — if it's stupid and it works, it ain't stupid.
undefined
undefined
It strikes me as very much a current aesthetic in younger companies or smaller startups, maybe highly influenced by Notion. No one makes a list or page or calendar invite in my current company without choosing an emoji for it.
It was cool until 2022. Then LLMs started injecting these emoji everywhere and it became the chief marker for code/doc smell.
It never caught on but I always liked setting the jumbo header images on Notion docs to creepy, unsettling pictures from Unsplash.
Need to write a document about converting a Rust project to Typescript? A picture of an abandoned warehouse full of expressionless baby doll heads fits perfectly.
> looks so unprofessional and makes me worry that a project was vibe -coded in the sense that the AI was possibly not babysat to the extent I think they should. That's just me, though
The irony of comments like this on software designed entirely for ai coding...
Looks so unprofessional, lol, says the guy wanting to use a free app, this isn't a microsoft made app lol it's a guy making a github app for free the audacity people have these days to shit on peoples project for 0 reason
AI coding where the human stays in control and reads and confirms code is totally different from vibe coding where you don't read code and just prompt until it sort of works.
undefined
if you actually look at the code, it's a single 400 line python file that just wraps https://github.com/ryoppippi/ccusage, so it's possible
Yeah I noticed that too, it’s a bit crazy to me that stuff like this is getting upvotes and traction. It feels like it was vibe-coded in one-shot style without perhaps even reading any bit of the code. A bunch of hardcoded values, a `sleep(3)`, bunch of other antipatterns.
Up until recently I tended to “trust” github repos a bit more, now I feel like I need to have my guard up so I don’t fall into a trap of using something like this. Funnily enough a good first metric for me now is # of emojis in the readme - the more emojis the more likely you should stay away from it
undefined
My goto for AI generated PR descriptions and README is this addition to the prompt: tight, no purple prose, no emojis.
That turns thrse meandering emoji fests into suitable documentation. YMMV
For a reference point, it says my max session limit in the past was ~337,492 tokens and I have the Max20 plan and 99% use Opus.
My total tokens used since I started using Claude Code on May 27th was 1,374,439,311 worth around $3397.34.
I'm around ~2100 dollars equivalent on Max20 plan.
Do they have huge margins on API or are they just losing money? I use it everyday but I don't feel like I'm abusing it or anything
I've been wondering this too. They said on a podcast that the average usage is around $6 a day in credits but I really question that. If that's the case though and they do have a lot of Pro and higher tier subscribers that might be making up the difference.
undefined
Huge margins on API lol, there's a reason the guys from deepseek told everyone that its bullshit that the big boys aren't making money, research is expensive but the inference isn't especially with the comments that even Sam Altman mentioned regarding pricing per response for the chat clients.
undefined
1. Don’t you hit rate limits on Opus? Don’t you find it slow compared to sonnet?
I have not ever actually hit the rate limit as far as I'm aware. I have gotten the "approaching Opus usage limit" a couple times but have not hit it.
This is great. I built a UI tool to run simultaneous Claude Code sessions (https://github.com/stravu/crystal) but by working on multiple features at once I hit the limits of my max account. Usually close to the reset, but it would be nice to know when it is time to take a break.
This is excellent. I am an EXTENSIVE Claude Code user but I've been a bit scared to write my own tooling around worktrees + multiple sessions because I don't understand git well enough.
To be honest, I'm a little scared to use this also. I feel like ideally each worktree would also run in a container, but that seems quite a bit harder to make work as smoothly as this does.
Please write for me on github or create issue https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor... and we can try integrate your tool with usage monitor
This is great but Crystal is already the name of a language I've messed with...
Kudos! I was just thinking about having. Laude write something like this for me. Not just within a project but the 5 different ones I have open at the same time. Too much of a good thing etc.
Very neat! Is the limit on Pro really only 7k tokens? So less than 7k words? I feel like I get more out of that. It feels like that would blow up pretty quickly with an ongoing chat, but I never hit that.
Or is this a Claude Code specific limit? I haven't used Claude Code extensively yet.
pro is the $20/mo plan that they recently started allowing access to claude code.. but i’ve heard users hit the rate limit with a few queries.. so imo that sounds about right. the chat interface has its own limits separate from claude code.
Has to be wrong. I'm on that subscription as I wanted to reinforce my opinion that it's still shit for devs that actually have experience, like it was a few months ago.
While my plan didn't pan out, cuz it was way too effective, I can confidently say that I'm going through 3-6k tokens per prompt on average, and usually get around 3 hours of usage before I'm hitting the rate limit.
The limit is probably closer to 300k then <10k
Also the chat interface doesn't have a separate limit, once you hit it via Claude code, you cannot use the website either anymore.
Maybe it's a 7k limit per prompt? Dunno if I exceeded that before
undefined
undefined
I tried it with Roo Code (with 3.7 Sonnet, not Code). For agentic use you will probably hit the limit from your first prompt/assignment if it does some browser tool use.
I'm noticing that Token usage doesn't reset after the time window unless you hit 100%.
This seems like a problem if for example, you hit 90% usage, pass the window, then burn through the remaining 10% quickly and have to wait a long time.
Uhm, does this do anything else useful besides shelling out to https://github.com/ryoppippi/ccusage ? Idk, this kind of stuff feels a bit disappointing, also feels like it’s perhaps one-shotted with some AI tool, and in this show hn you don’t even mention that all the actual work is done by some other tool.
Incredible, thank you for making this!
Can this be installed with uv? https://github.com/astral-sh/uv
Edit:
If the repo was structured as a package e.g. with project.toml and such there would be an even faster one-liner with pipx (https://pipx.pypa.io/latest/):
> pipx install git+https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor
> ccusage_monitor
I think there is a similar command for uv; uvx? Although, I am not sure if uvx has the same functionality / purpose as pipx.
This is appreciated but FWIW basically anything that can be installed with pip is also trivial (easier, even) to install with uv.
I can just sense how far it's from reaching my limit, and my sense is quite accurate. I can also sense when a conversation is about to reach its own maximum length, so I use the last resource to generate a summary so that I can start a new conversation and resume progress. Ironically, these AI tools have become part of my biological clock. Besides Claude, every Wednesday is like a new kind of Sunday for me, because my ChatGPT's weekly limit is reset on Wednesdays.
Today, I will commit a new Auto Mode (with DuckDB) that uses machine learning to understand your actual token limits, not hardcoded solution.
I'm working on a wrapper for these terminal agent coders that reads directly from them... you might want to consider that approach? I hope to have it here on ShowHN as soon as its better tested but email me if you want in on the private beta :)
actually reading more about how you ingest ~/.claude/projects//.jsonl the wrapper method is probably over kill..
how about making it a tool that claude can use directly?
Hi! I'm the author of ccusage! I'm happy to see how people use our OSS! Happy vibe coding!
Interestingly, not a single comment on ccusage's Show HN:, but this thread here is getting crazy! https://news.ycombinator.com/item?id=44129432
nice ship! I wrote a blog post on how to observe trends over time for a team via OTel, but I prefer your method for individual development!
https://ma.rtin.so/posts/monitoring-claude-code-with-datadog...
I like this solution, I had tinkered with the Otel hoping to get un-redacted prompt and responses but had no luck. Did you perhaps get deeper into what data was useful?
undefined
Had a very weird experience with Claude Code yesterday. Tried to convert a simple phtml table page with very old php into a new div layout. It didn't work and burned through 4 dollars. Perhaps a WSL issue but I hope that doesn't happen more.
Claude Code has something of a steep learning curve. Sessions should involve a fairly lengthy back and forth discussing requirements and encouraging the model to ask clarifying questions.
Even then, this can happen from time to time. It's important to remember that you're using an extremely expensive tool which, despite what YouTubers and bloggers say, isn't magic.
How it does it monitor usage?
Check directory ~/.claude/projects/*/*.jsonl ;) hah very interesting topic. I have a plan to write blog post about it (all conversations history with metadata inside json lines files) What do you think about this idea? Interesting?
undefined
undefined
undefined
I keep the credits page open and refresh it from time to time, because I honestly only care about money, not about tokens whatever these are.
undefined
Thank you! For me, I wish it was just a simple command that outputs how much I have used out of my plan already. Also I feel it’s a bummer that I need python when CC is a node.js tool.
I will update it in next release :D And you will be able to install the package directly.
For cursor users, a similar extension to monitor usage:
https://github.com/Dwtexe/cursor-stats
Keep an eye on your memory usage after installing this extension.
I did a bisect and found this one to be consuming ~1.5gb memory alone and that's when I removed it. YMMV.
Probably for API cost. It is for fixed price plans usage
This is pretty cool.. I like the idea, could I make a semi-snarky feature request and could we add the estimated power consumed to produce results for each session ?
Soon we will have low carbon developers
undefined
undefined
Or just straight to CO2. Google said 1000 tokens emits 8.3g CO2.
How many tokens used in a heavy vibe coding day?
Average US daily per capita is like 40kg CO2
undefined
undefined
undefined
undefined
Greta would be proud, but I’m not sure how the number of tokens relates to energy consumption.
undefined
Something like this would be great for Cursor, I never know how many credits I’m up to for the month or how much my Max calls are costing.
> Something like this would be great for Cursor, I never know how many credits I’m up to for the month or how much my Max calls are costing.
I think that's by design
interesting, so I should say hello to claude after waking up for an early reset 5h later....
Tool also says I used 198% of my max5 plan %).
I guess it expect opus usage and I was usin sonnet (after the first 20%, the auto thing)
Is there something similar to this but for Gemini?
I can implement tool like this for Gemini, please create issue https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor... with this idea
they really should integrate this kind of thing, it is very annoying
thx
you are a saint.
<3
Claude is cool, they focus on cool and useful things.
But man do I just want a way to quickly glance at my API credits and to just occasionally chat with a model from those credits without librechat of openwebui. Or set some limits, or see some usage metrics.
And please please use "forever auth" with passkeys or something, what is up with that auth email that just takes ages for a quick glance?! It always takes me 3 attempts to find what address I used at sign-up...
Oh and make it clearer why you have that API/credits system and a subscription, why is it so difficult to understand when you start using Claude that it's 2 different unrelated worlds?? First time I started my subscription I just couldn't figure out where the API section was, until I realized it just wasn't there.
I feel like I'm "holding it wrong", but please make it easier to hold it right then.
>And please please use "forever auth" with passkeys or something, what is up with that auth email that just takes ages for a quick glance?! It always takes me 3 attempts to find what address I used at sign-up...
As a person with the simple but brilliant technology of a freaking password manager, I LOATHE email to login/no-password websites. They are dreadful, we've somehow managed to come up with something worse in UX rather than move forward.
If you're working on a product that does this, or wants to do this, please please PLEASE reconsider, it's such a PITA for technical users and normies alike.
undefined
undefined
undefined
undefined
I can write a blog post about this, plus in the next release, DuckDB will be implemented along with a slightly more advanced max tokens algorithm.
Anyone else have a bunch of fun with Claude Code's Github integration... until you realized it spends from your API wallet balance?
Oops, when I saw the /install-github-app command, I assumed that since I'm on a max plan and Claude Code in my terminal is free, then the Github integration would be free.
So I hooked it up to my repo and tagged @claude in everything. It was a lot of fun tagging it in backburner issues and seeing it solve issues I couldn't be bothered to do for years. Or just seeing what it would come up with on really low effort poorly explained issues.
But not worth spending 50+ cents every time.
On one hand, it violated the principle of least surprise.
On another hand, you solved several years-old issues for under $50…which seems like a big win.
You can use your max plan ( https://github.com/grll/claude-code-action )
Currently in gray area but allowed as per anthropic comment on it - https://github.com/anthropics/claude-code-action/issues/4#is...
undefined
> Anyone else have a bunch of fun with Claude Code's Github integration... until you realized it spends from your API wallet balance?
Isn't Claude and Anthropic API two separate platforms? How does it spend from your other account?
undefined
Addressing those issues wasn't worth $0.50 apiece? That almost certainly translates into less than a _minute_ of fully loaded engineering cost from a human.
undefined
With uv, is there a way to install Python and Node tools like this in a self-contained way so they appear to the system as a single executable?
I guess I don't want to duplicate Python/Node for every tool, but I also don't want it to be fragile. And this wants a Node CLI tool installed globally, which I've found breaks easily with changing versions.
Good point, yes i can do it. If you can please add issue in github and i will implement it :D
undefined
> I don't want to duplicate Python/Node for every tool
`uv tool install` doesn’t duplicate Python for every tool.
[dead]
[dead]
I read doge instead of dodge. I need to get off Reddit immediately