Cccost — Development skill for Claude Code
Instrument Claude Code to track actual token usage and cost.
How to install Cccost
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open badlogic/cccost and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Cccost does
Track token usage and costs for your Claude Code sessions in real-time.
Alternatives in Development
- Benjamin Plus Skill — Benjamin-Plus: a measured token-efficiency skill for coding agents (−17.9% cost median, quality unchanged) 272 ★
- Claude Dashboard — Comprehensive status line plugin for Claude Code with context usage, API rate limits, and cost tracking 258 ★
- Cc Bar — Native macOS menu bar app: track quota, usage and cost for Codex (multi-account) and Claude Code, from your me 119 ★
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)](https://x.com/badlogicgames/status/1957221028603535617). And if you wrote a fancy [statusline](https://docs.anthropic.com/en/docs/claude-code/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 --dangerously-skip-permissions
cccost spawns Claude Code and injects [this code](./src/interceptor.ts). 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.:
{
"requests": 7,
"totalCost": 0.10331005,
"models": {
"claude-3-5-haiku-20241022": {
"requests": 6,
"input_tokens": 731,
"output_tokens": 99,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"cost": 0.0009808,
"last": {
"utcTimestamp": 1755475841151,
"input_tokens": 335,
"output_tokens": 9,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
...
Related Skills
Fire Cost
Track context usage, estimate session costs, and trigger strategic compaction
Greenbelt
Greenbelt is Claude Code hooks that track token usage across Claude Code sessions and plants trees to reduce y
Claude Token Counter
Carefully track token usage while using Claude
AgentsUsage
A lightweight Windows system tray application that parses local Claude CLI and Codex usage logs, hosting an em
Burnlens Fix
Find fixes that cut your Claude Code token usage, apply the ones you pick, and track what they save
Token Bar
macOS menu-bar app: token usage, cost & rate limits for Claude Code, Codex CLI, Gemini CLI
Related Agents
Performance Monitor
Monitor agent execution, track token usage, measure response quality, and optimize workflows
Cost Governor
Track aggregate token spend and API costs across all agent operations. Enforce budget constraints, detect cost
API Cost Scanner
Scans codebase for AI/API cost optimization opportunities including model usage, token estimates, caching stra