Claude Code usage
Cccost
Instrument Claude Code to track actual token usage and cost
Install
npm install -g @mariozechner/cccostFound in the project README. Check it for setup steps after installing.
git clone https://github.com/badlogic/cccost.gitFrom the README
cccost - Claude Code Cost Tracker Track token usage and costs for your Claude Code sessions in real-time. Problem Claude Code does not show cost for users of the Pro and Max plan when using the /cost command. API users enjoy that privilege. Except that /cost has a bug (CC 1.0.83). And if you wrote a fancy statusline script and think you can just parse the session transcript to get token usage and cost, think again. The transcript does not contain all requests Claude Code issues to the Anthropic servers. What Claude Code Cost Tracker does Claude Code cost track is a minimally invasive tool. Instead of running Claude Code directly, run your session via cccost. All arguments you pass will be forwarded to Claude Code verbatim: cccost spawns Claude Code and injects this code. It hooks the NodeJS fetch() function and intercepts all API requests to Anthropic's servers. It then writes a file ~/.claude/projects/mangled-current-working-dir/sessionid.usage.json and keeps updating it with every new request. As opoosed to Claude Code's /cost slash command, this also accurately tracks cost and token usage when resuming sessions. The file contains total input/output/cache read/cache write statistics per model, the usage stats for the last request made with each model, and the total cost. E.g.: You can use that to write accurate statusline scripts that display e.g. context usage or cost for the current session. Simply read the .usage.json file for the current session to get the statistics. The GitHub repository includes an example statusline.js. Installation Usage Simply start Claude Code via cccost instead of claude: Options - --ccc-verbose: cccost will output debug logging during the session Development License MIT Author Mario Zechner
Details
- Repository
- badlogic/cccost
- Language
- TypeScript
- Last updated
- 18 August 2025
- Listed in
- jqueryscript/awesome-claude-code
FAQ
What is Cccost?
Instrument Claude Code to track actual token usage and cost It is a usage for Claude Code, from badlogic/cccost on GitHub.
How do I install Cccost?
Run npm install -g @mariozechner/cccost, then follow the setup in the README.
Is Cccost popular?
badlogic/cccost has 26 GitHub stars and 0 forks, and is included in 1 curated Claude Code list. It was last updated on 18 August 2025.
More usage & cost trackers
Lupen
33momoraul/Lupen
Itemized cost receipts for Claude Code and Codex — by turn, verified, local.
So Agentbar
22sotthang/so-agentbar
macOS menu bar app that monitors your active Claude Code agent sessions in real-time
Claudestat
34DeibyGS/claudestat
Real-time execution trace and cost intelligence for Claude Code
Agent Usage Monitor
32wuyuxiangX/agent-usage-monitor
Raycast extension for real-time Claude Code session monitoring with hooks-based state tracking
Claude Code Manager
32vishalguptax/claude-code-manager
Claude Code Manager: a VS Code sidebar for Claude Code sessions, usage and limits, accounts, MCP, skills, hooks, agents and plugins. 100% local.
Clawdmeter
32weltern/Clawdmeter
Cross-platform desktop dashboard for Claude Code usage — Windows, macOS & Linux. Live session & weekly limits with reset countdowns, token counts, and one reactive Clawd mascot per active session. Plus a Stats page valuing your local transcripts against API rates, 16 themes and a custom theme editor. Lives in your tray.
Browse the most popular Claude Code mods, all usage & cost trackers, or the skills and MCP server directories.