Show HN: Claude Code Usage Monitor – real-time tracker to dodge usage cut-offs (github.com)

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!

loufe 10 days ago

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

oc1 10 days ago

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.

Maciej-roboblog 10 days ago

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.

NaN years ago

undefined

NaN years ago

undefined

partdavid 10 days ago

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.

adastra22 10 days ago

It was cool until 2022. Then LLMs started injecting these emoji everywhere and it became the chief marker for code/doc smell.

ljm 9 days ago

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.

wredcoll 10 days ago

> 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...

cchance 10 days ago

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

lukan 10 days ago

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.

NaN years ago

undefined

youcefb 10 days ago

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

radicality 10 days ago

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

NaN years ago

undefined

danielbln 10 days ago

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

joshmlewis 10 days ago

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.

WXLCKNO 10 days ago

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

joshmlewis 10 days ago

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.

NaN years ago

undefined

cchance 10 days ago

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.

NaN years ago

undefined

sagarpatil 9 days ago

1. Don’t you hit rate limits on Opus? Don’t you find it slow compared to sonnet?

joshmlewis 7 days ago

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.

jbentley1 10 days ago

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.

furyofantares 10 days ago

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.

Maciej-roboblog 10 days ago

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

pmarreck 9 days ago

This is great but Crystal is already the name of a language I've messed with...

rgoodwintx 10 days ago

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.

jjice 10 days ago

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.

rgbrenner 10 days ago

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.

ffsm8 10 days ago

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

NaN years ago

undefined

NaN years ago

undefined

PeterStuer 9 days ago

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.

_august 10 days ago

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.

radicality 10 days ago

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.

_august 10 days ago

Incredible, thank you for making this!

Can this be installed with 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
whyho 9 days ago

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.

throwaway314155 9 days ago

This is appreciated but FWIW basically anything that can be installed with pip is also trivial (easier, even) to install with uv.

tianqi 9 days ago

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.

Maciej-roboblog 10 days ago

Today, I will commit a new Auto Mode (with DuckDB) that uses machine learning to understand your actual token limits, not hardcoded solution.

robbomacrae 10 days ago

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 :)

robbomacrae 10 days ago

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?

ryoppippi 9 days ago

Hi! I'm the author of ccusage! I'm happy to see how people use our OSS! Happy vibe coding!

ryoppippi 9 days ago

Interestingly, not a single comment on ccusage's Show HN:, but this thread here is getting crazy! https://news.ycombinator.com/item?id=44129432

martin_ 10 days ago

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...

bazhand 10 days ago

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?

NaN years ago

undefined

tiku 10 days ago

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.

throwaway314155 9 days ago

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.

alFReD-NSH 10 days ago

How it does it monitor usage?

Maciej-roboblog 10 days ago

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?

NaN years ago

undefined

NaN years ago

undefined

NaN years ago

undefined

soco 10 days ago

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.

NaN years ago

undefined

ed_mercer 10 days ago

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.

Maciej-roboblog 10 days ago

I will update it in next release :D And you will be able to install the package directly.

mellosouls 10 days ago

For cursor users, a similar extension to monitor usage:

https://github.com/Dwtexe/cursor-stats

extropian 9 days ago

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.

Maciej-roboblog 10 days ago

Probably for API cost. It is for fixed price plans usage

bilekas 10 days ago

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 ?

TypingOutBugs 10 days ago

Soon we will have low carbon developers

NaN years ago

undefined

NaN years ago

undefined

tln 10 days ago

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

NaN years ago

undefined

NaN years ago

undefined

NaN years ago

undefined

NaN years ago

undefined

Maciej-roboblog 10 days ago

Greta would be proud, but I’m not sure how the number of tokens relates to energy consumption.

NaN years ago

undefined

bevan 10 days 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.

Hrun0 10 days 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

anotheryou 10 days ago

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)

diego_moita 10 days ago

Is there something similar to this but for Gemini?

Maciej-roboblog 10 days ago

I can implement tool like this for Gemini, please create issue https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor... with this idea

waynenilsen 10 days ago

they really should integrate this kind of thing, it is very annoying

Maciej-roboblog 10 days ago

thx

randall 10 days ago

you are a saint.

Maciej-roboblog 9 days ago

<3

teekert 10 days ago

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.

redrove 10 days 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.

NaN years ago

undefined

NaN years ago

undefined

NaN years ago

undefined

NaN years ago

undefined

Maciej-roboblog 10 days ago

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.

hombre_fatal 10 days ago

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.

sokoloff 10 days ago

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.

shmoogy 10 days ago

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...

NaN years ago

undefined

csomar 10 days ago

> 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?

NaN years ago

undefined

mwigdahl 10 days ago

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.

NaN years ago

undefined

pbowyer 10 days ago

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.

Maciej-roboblog 10 days ago

Good point, yes i can do it. If you can please add issue in github and i will implement it :D

NaN years ago

undefined

JimDabell 10 days ago

> I don't want to duplicate Python/Node for every tool

`uv tool install` doesn’t duplicate Python for every tool.

curtisszmania 10 days ago

[dead]

kewldev87 10 days ago

[dead]

atum47 10 days ago

I read doge instead of dodge. I need to get off Reddit immediately