How to track Claude Code usage + analytics

Are you trying to track + measure your Claude Code token consumption? Here’s how you can view it in real time, and see your historical usage trends.

/images/blog/cover-images/claude-code-usage.png
Track claude code usage with ccusage and Claude Code Usage Monitor

by on

Now that you’ve gotten into the habit of working with Claude Code, you’re probably curious to see how efficiently you’re using it. For example, do you know how many tokens it’s taking you to complete a ticket on average? Since Claude tokens can run out and will reset after 5 hours, you might want to see how much you’re pushing it to the limit.

We’ve tried three different ways to track our Claude Code usage. Here’s what we found.

Option 1 (the classic way): Check the Anthropic Console

If you’re using the Anthropic API for Claude Code access (instead of through a Pro or Max plan), you can track your usage through the Anthropic Console. This is useful for devs and orgs who are doing the “pay as you go” approach, because your number of tokens consumed is directly correlated to how much you’re spending.

You can also run the /cost command from your Claude Code session to get usage for that current session.

If you’re a manager, you can see usage trends for your whole team, and get the data you need to find how Claude Code is impacting developer productivity. You’ll be able to see how often you/others accept Claude’s suggested changes. Anthropic suggests using this as a way to measure your org’s Claude Code adoption, as well.

Option 2 (view historical usage): ccusage

ccusage is a CLI-based tool that lets you view usage by date, session, or project. We really liked using this tool for seeing how our usage was divided across repos (e.g. which ones did we rely on Claude more for?).

ccusage CLI tool showing Claude Code usage analytics

It works by reading + analyzing Claude’s local JSONL files. This is super helpful if you have a Pro or Max plan, since you’re paying a flat rate per month and can’t track this via the Anthropic Console or Claude’s /cost command.

One cool thing about ccusage is that it’s so small you don’t need to fully install it, you can just run the npx command with whichever args you want to filter by:

npx ccusage@latest report daily

You can also install it:

npm install -g ccusage
ccusage report daily --since 20250801

Since it’s a CLI tool, you can ask Claude Code to run ccusage and retrieve info for specific search params:

Hey Claude, use ccusage to find my analytics for the RecipeBook project between July 3rd and July 7th.

The only limitation is that ccusage can’t show your current, real-time Claude Code analytics. If this is something you want, check out the next tool in our list.

Option 3 (view real-time usage): Claude-Code-Usage-Monitor

Claude-Code-Usage-Monitor is another CLI-based tool for tracking how you use Claude Code. Unlike ccusage, this one gives you a real-time chart of your token consumption, cost estimate, and predictions about how long it’ll take for you to hit your limits.

Claude Code Usage Monitor showing real-time token consumption

You can install it with pip or uv and run it with the cmonitor command:

pip install claude-monitor
cmonitor

Run it while you’re using Claude in a different window, and see it update live as Claude generates. Like ccusage, this pulls from Claude’s local data.

You can see your historical usage in table view by including a timeframe:

cmonitor --view monthly

Understanding Claude’s session model

If you want to best plan out your Claude sessions, you’ll want to understand your constraints. Claude’s tokens are granted by plan based on overall server load, so on busier days you’ll get fewer.

If you’re not using the API for pay-as-you-go Claude access, you’ll want to choose the Claude tier that works best for you.

  • Pro: for a medium-high coding workload. Expect to use continuously for smaller code changes, and as a supplement to your own coding. $20/month
  • Max5: for an intense coding workload. 5x the token allowance of Pro. Opus access. $100/month
  • Max20: for near-autonomous, nonstop, heavy development workloads. Significantly larger context window. 20x the token allowance of Pro. Opus access. $200/month

Sessions kick off as soon as you send your first message, and last five hours. If you’re using Opus, you’ll burn through tokens much faster. On average, the Pro tier gets 7,000 tokens per session.

It’s most efficient (and guarantees better outputs) if you start different sessions for different tasks. Each session has its own token “pool”, so you can run several agents concurrently and it won’t impact your total allowance.

The Bottom Line

We found both ccusage and Claude-Code-Usage-Monitor were easy to use, and helped us make sense of our Claude metrics. This was helpful for tracking our own developer productivity, as well as seeing how Claude impacted our work styles.

If you’re using the Pro or Max tiers, you won’t be able to see this info in the Anthropic Console. We suggest using both to supplement each other: ccusage to view your usage trends, and Claude-Code-Usage-Monitor to see your live token consumption and predictions.

Using Claude Code? Give your agents ephemeral environments. They can deploy the code they write, pull logs, find + fix bugs, all with little-to-no human intervention. Try it free for 30 days.

Try Shipyard today

Get isolated, full-stack ephemeral environments on every PR.

What is Shipyard?

Shipyard is the Ephemeral Environment Self-Service Platform.

Automated review environments on every pull request for Developers, Product, and QA teams.

Stay connected

Latest Articles

Shipyard Newsletter
Stay in the (inner) loop

Hear about the latest and greatest in cloud native, container orchestration, DevOps, and more when you sign up for our monthly newsletter.