9 ms·
Show HN: Claude Code Usage Monitor – real-time tracker to dodge usage cut-offs
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 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!
- bevan 1y agoSomething 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.
- Hrun0 1y ago> 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
- randall 1y agoyou are a saint.
- Maciej-roboblog 1y ago<3
- pbowyer 1y agoWith 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.
- Maciej-roboblog 1y agoGood point, yes i can do it. If you can please add issue in github and i will implement it :D
- Maciej-roboblog 1y agoit is on my todo list
- JimDabell 1y ago> I don't want to duplicate Python/Node for every tool `uv tool install` doesn’t duplicate Python for every tool.
- deleted 1y ago[deleted]
- Maciej-roboblog 1y agoToday, I will commit a new Auto Mode (with DuckDB) that uses machine learning to understand your actual token limits, not hardcoded solution.
- robbomacrae 1y agoI'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 :)
- robbomacrae 1y agoactually 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?
- alFReD-NSH 1y agoHow it does it monitor usage?
- Maciej-roboblog 1y agoCheck 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?
- M4v3R 1y agoWow, I had no idea Claude Code had this kind of verbose logging turned on by default. Looking around I also found a cool tool for converting these logs to HTML format for easy viewing: https://github.com/daaain/claude-code-log https://github.com/daaain/claude-code-log
- Maciej-roboblog 1y agoHaha, in that case it sounds like an article I could actually handle. By the way, is it better to go with an article or short-form video?
- pbowyer 1y agoFilm video, transcribe, edit to become article? I'm of an age where I rarely watch short-form videos so would read the article but you'll miss an audience if that's all you produce.
- Maciej-roboblog 1y agoOkay, sounds good — if I manage to do it, I’ll send you a message
- Hortinstein 1y agoIs there anyway to ensure these logs are output in a current project folder? Would like to store a copy in git for reference
- ed_mercer 1y agoThank 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.
- Maciej-roboblog 1y agoI will update it in next release :D And you will be able to install the package directly.
- teekert 1y agoClaude 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.
- redrove 1y ago>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.
- teekert 1y agoYeah, it's the reason I eventually tuned out of Slack too (obviously I don't use it day to day). I used it for some things, some community stuff, every now and then. So when I open it up on a new machine or after months, you have to go through that magic link bs multiple times! For all your accounts/channels! I did that 2 or 3 times and then I just stopped using it. I don't even remember what I signed up for over the years, I know some of it was nice (like an LoRa IOT channel, an "AWS professionals" channel, I set something up for the LoRaWan network in the previous city I lived in... All just tuned out because of the login bs.
- 1y ago
- mellosouls 1y agoFor cursor users, a similar extension to monitor usage: https://github.com/Dwtexe/cursor-stats https://github.com/Dwtexe/cursor-stats
- Maciej-roboblog 1y agoProbably for API cost. It is for fixed price plans usage
- extropian 1y agoKeep 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.
- hombre_fatal 1y agoAnyone 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.
- sokoloff 1y agoOn 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.
- shmoogy 1y agoYou can use your max plan ( https://github.com/grll/claude-code-action 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#issuecomment-2920787612 https://github.com/anthropics/claude-code-action/issues/4#is...
- hombre_fatal 1y agoOh, thanks! You didn't go digging that up just for me, did you? I'll try it out right now.
- shmoogy 1y agoI had it in my Karakeep bookmarks of things to try in the coming weeks.
- deleted 1y ago[deleted]
- csomar 1y ago
- waynenilsen 1y agothey really should integrate this kind of thing, it is very annoying
- Maciej-roboblog 1y agothx
- bilekas 1y agoThis 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 ?
- TypingOutBugs 1y agoSoon we will have low carbon developers
- btbuildem 1y agoWe all were low carbon developers once
- cdurth 1y agoMaybe the few that were WFH prior to AI. I just calculated my carbon output for commuting and going to lunch daily versus WFH and using AI and it's wayyy less. Let's all save earth, stay home and use AI.
- ozim 1y agoLet's start with npm and node_modules first - I think it is responsible for at least half of the global warming.
- Maciej-roboblog 1y agoGreta would be proud, but I’m not sure how the number of tokens relates to energy consumption.
- actsasbuffoon 1y agoSoon the AI companies will have different tiers of plan based on carbon output. For $200 per month they’ll only use carbon-free power sources for your prompts. At $100 they’ll use nuclear, then $20 per month for coal, and then there will be a free tier where your prompts are powered by throwing baby seals into a furnace.
- jbentley1 1y agoThis is great. I built a UI tool to run simultaneous Claude Code sessions (https://github.com/stravu/crystal 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.
- Maciej-roboblog 1y agoPlease write for me on github or create issue https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor/issues/new https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor... and we can try integrate your tool with usage monitor
- rgoodwintx 1y agoKudos! 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.
- furyofantares 1y agoThis 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.
- pmarreck 1y agoThis is great but Crystal is already the name of a language I've messed with...
- diego_moita 1y agoIs there something similar to this but for Gemini?
- Maciej-roboblog 1y agoI can implement tool like this for Gemini, please create issue https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor/issues/new https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor... with this idea
- curtisszmania 1y ago[dead]
- loufe 1y agoI 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
- oc1 1y agoI 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.
- Maciej-roboblog 1y agoThis 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.
- lukan 1y agoAlways depends on the cost of failure I suppose.
- mattmanser 1y agoThe readme is the typical AI verbal diarrhoea of so many words saying so little it hurts. You should ask it to be a bit more concise. As a separate comment, would it not be better to ask for your plan on first run and setup a config file to remember it? With a note how to change it. Rather than rely on cmd line variables? Also, shouldn't it be able to pick up the timezone from the local computer? Why would it "default" to a fixed timezone of poland?
- 1y ago
- jjice 1y agoVery 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.
- rgbrenner 1y agopro 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.
- ffsm8 1y agoHas 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
- cmrdporcupine 1y agoI found I can hit the limit very quickly if I have it scan large quantities of code for analysis. If I try to be more surgical, and give it terse but accurate documentation and instructions, the budget lasts longer.
- vitro 1y agoSame here. Sometimes I direct it just to specific files related to the feature requested.
- 1y ago
- martin_ 1y agonice 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/ https://ma.rtin.so/posts/monitoring-claude-code-with-datadog...
- bazhand 1y agoI 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?
- martin_ 1y agoYou can get the un-redacted prompts via the OTel event logger[0], but unfortunately it won't give you responses. You could open up a GitHub issue to request that addition! Disclaimer - I work at Anthropic but not on Claude Code, the team is responsive via GH issues though! [0] https://docs.anthropic.com/en/docs/claude-code/monitoring-usage#common-configuration-variables https://docs.anthropic.com/en/docs/claude-code/monitoring-us...
- bazhand 1y agoYou may be interested in https://github.com/ryoppippi/ccusage https://github.com/ryoppippi/ccusage
- kewldev87 1y ago[dead]
- anotheryou 1y agointeresting, 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)
- joshmlewis 1y agoFor 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.
- WXLCKNO 1y agoI'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
- joshmlewis 1y agoI'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.
- banana_giraffe 1y agoInteresting, do you recall which podcast this was on?
- joshmlewis 1y agoyes the latent space podcast I believe
- brianjking 1y agoLatent Space. "Claude Code is also the most direct way to consume Sonnet for coding, rather than going through all the hidden prompting and optimization than the other products do. You will feel that right away, as the average spend per user is $6/day on Claude Code compared to $20/mo for Cursor, for example. Apparently, there are some engineers inside of Anthropic that have spent >$1,000 in one day!" Link: [https://www.latent.space/p/claude-code https://www.latent.space/p/claude-code](https://www.latent.space/p/claude-code https://www.latent.space/p/claude-code)
- atum47 1y agoI read doge instead of dodge. I need to get off Reddit immediately
- _august 1y agoIncredible, thank you for making this! Can this be installed with uv? https://github.com/astral-sh/uv https://github.com/astral-sh/uv Edit: # Install uv curl -LsSf https://astral.sh/uv/install.sh | sh # Install the required CLI tool (Node.js) npm install -g ccusage # Clone and setup git clone https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor.git cd Claude-Code-Usage-Monitor # Install Python deps with uv uv add pytz chmod +x ccusage_monitor.py # Run it uv run python ccusage_monitor.py --plan max20 --timezone America/New_York
- throwaway314155 1y agoThis is appreciated but FWIW basically anything that can be installed with pip is also trivial (easier, even) to install with uv.
- whyho 1y agoIf 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/ https://pipx.pypa.io/latest/): > pipx install git+https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor 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.
- _august 1y agoI'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.
- tiku 1y agoHad 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.
- throwaway314155 1y agoClaude 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.
- radicality 1y agoUhm, does this do anything else useful besides shelling out to https://github.com/ryoppippi/ccusage 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.
- tianqi 1y agoI 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.
- ryoppippi 1y agoHi! I'm the author of ccusage! I'm happy to see how people use our OSS! Happy vibe coding!
- ryoppippi 1y agoInterestingly, not a single comment on ccusage's Show HN:, but this thread here is getting crazy! https://news.ycombinator.com/item?id=44129432 https://news.ycombinator.com/item?id=44129432