How to Track Claude Code Token Usage Per Project
Anthropic doesn't offer per-project usage tracking for Claude Code. Here's how to see exactly what each project costs you in tokens, time, and dollars.
The Missing Feature in Claude Code
If you use Claude Code across multiple projects — client work, side projects, your day job — you've probably wondered: which project is burning through my tokens the fastest? Anthropic doesn't tell you. Their usage page shows total plan consumption as a single percentage. There's no way to see per-project breakdowns.
This is a problem for anyone who needs to:
- Bill AI costs to clients — Freelancers and agencies need to know what each project costs
- Budget across projects — Teams need to allocate AI resources intelligently
- Optimize where AI adds value — Some projects benefit more from Claude than others
- Justify AI tooling costs — Showing per-project ROI to stakeholders
How Per-Project Tracking Works
MyTokenTracker solves this by automatically detecting which project you're working on from your working directory. Every Claude Code session captures:
- Project name — derived from the directory where Claude Code is running
- Token counts — input tokens, output tokens, cache reads, and cache writes
- Model used — Opus 4.6, Sonnet 4.6, or Haiku 4.5
- Session duration — how long the session lasted
- Estimated cost — what that session would cost at API rates and what it costs against your plan
Step 1: Install MyTokenTracker (10 seconds)
Sign up at mytokentracker.io, then paste the one-line install command into Claude Code. It adds a hook to your Claude Code settings that fires when sessions end. Zero configuration, zero performance impact.
Step 2: Work Normally
Use Claude Code on any project, in any directory. The hook automatically detects the project context and logs usage when each session ends. A background daemon also captures real-time data every 60 seconds.
Step 3: View Your Project Breakdown
Your dashboard shows a donut chart breaking down token usage and cost across all your projects. Click into any project to see session-by-session history, model distribution, and cost trends.
What Per-Project Data Reveals
After a week of tracking, most developers discover surprising patterns:
The 80/20 Rule Applies
Typically, 1-2 projects consume 80% of your total tokens. This is often the project with the most complex codebase or the one where you're doing the most greenfield development. Knowing this helps you decide which projects should use Opus (for complex reasoning) vs Sonnet (for routine tasks).
Context Size Drives Cost
Projects with large codebases consume more input tokens because Claude Code reads more files to understand the context. A project with 50 files in context can burn 100K+ input tokens before Claude writes a single line. If you see one project's input token count dwarfing others, consider using more targeted prompts or breaking the work into smaller, focused sessions.
Refactoring Sessions Are Token Monsters
Refactoring across multiple files generates enormous token counts. A single "refactor the auth middleware" session can easily consume 200K+ tokens as Claude reads the existing code, plans changes, and generates new code across multiple files. Tracking this per-project helps you plan: do the heavy refactoring early in the week when your plan allocation is fresh.
For Freelancers: Billing AI Costs to Clients
If you're a freelancer using Claude Code for client work, per-project tracking is essential for fair billing. With MyTokenTracker's CSV export, you can:
- Filter sessions by project/client
- Export the data with timestamps, tokens, model, and estimated cost
- Include AI costs in your client invoices — transparently, backed by data
- Show clients exactly what their project consumed vs others
The Pro plan's 90-day retention means you always have billing data for the current quarter.
For Teams: Allocating AI Resources
Teams on the Team plan can aggregate usage across developers and see per-project analytics at the org level. This helps engineering managers:
- Identify which projects benefit most from AI assistance
- Spot developers who might need a plan upgrade
- Budget AI tooling costs by project or team
- Demonstrate AI ROI to leadership with per-project data
Get Started in 10 Seconds
Per-project tracking is available on all plans, including Free. Sign up, install, and within 24 hours you'll have a clear picture of where your Claude Code tokens actually go.