By destilabs
Price local Claude Code sessions at the Anthropic API rate card. Adds /api-cost - shows top expensive sessions and per-repo totals with diagnostic columns (turns, cache hit %, model).
Price your local Claude Code sessions at the Anthropic API rate card.
Adds an /api-cost slash command that walks ~/.claude/projects/*.jsonl,
computes a shadow cost for each assistant turn from its usage metadata,
and prints two tables:
Costs are shadow prices against the public Anthropic API rate card. They represent the dollar value a Max subscription extracts, not dollars actually paid.
claude plugin install destilabs/claude-cost
Or clone this repo and point Claude Code at it as a local plugin.
/api-cost # last 30 days, top 10 sessions
/api-cost --days 7 # last 7 days
/api-cost --since 2026-04-01 # since a specific date
/api-cost --top 25 # wider session table
The bare /cost slash is reserved by Claude Code (aliased to /usage
for subscription info), which is why this plugin uses /api-cost.
Window: 2026-04-17 to 2026-04-24
Parsed 14,423 assistant turns across 60 sessions in 12 repos.
Top 5 most expensive sessions
# Date Repo Model Turns Input Output Cache $ Cost Session
- ----------- ----------- ------ ----- ----- ------ ----- ------- --------
1 04-22 17:41 stitch-mono opus-4 1,835 3.3K 1.5M 98% $824.90 794f6f7a
2 04-20 08:10 stitch-mono opus-4 1,855 11.4K 1.0M 98% $729.40 a3e67dda
...
Cost by repo
Repo Sessions Turns $ Total $ / session
------------------- -------- ------ --------- -----------
meta 32 5,307 $2,111.88 $66.00
stitch-mono 5 4,351 $1,782.80 $356.56
...
TOTAL 60 14,423 $5,505.22 $91.75
Each assistant turn in a Claude Code session JSONL carries a usage block:
{
"input_tokens": 42,
"output_tokens": 1240,
"cache_creation_input_tokens": 18500,
"cache_read_input_tokens": 95000
}
The script multiplies each token count by the per-model rate in the public
Anthropic pricing page
and sums. cache_creation_input_tokens is billed between 1.25x and 2x the
input rate depending on TTL; the script uses the 5-minute rate, which
slightly undercounts 1-hour cache writes.
Opus 4.5, 4.6, and 4.7 are billed at the lower tier ($5 input, $25 output, $0.50 cache read per million tokens). Opus 4 and 4.1 remain at the higher tier ($15 / $75 / $1.50). The script encodes both. Unknown models fall back to the current Opus tier (conservative over-count for new models).
v1 is deliberately minimal. Not included:
These may come later if there is demand. Open an issue.
MIT
Runs pre-commands
Contains inline bash commands via ! syntax
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub destilabs/claude-cost --plugin claude-costComprehensive skill pack with 66 specialized skills for full-stack developers: 12 language experts (Python, TypeScript, Go, Rust, C++, Swift, Kotlin, C#, PHP, Java, SQL, JavaScript), 10 backend frameworks, 6 frontend/mobile, plus infrastructure, DevOps, security, and testing. Features progressive disclosure architecture for 50% faster loading.
Comprehensive PR review agents specializing in comments, tests, error handling, type design, code quality, and code simplification
Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.
Automated code review for pull requests using multiple specialized agents with confidence-based scoring
Comprehensive feature development workflow with specialized agents for codebase exploration, architecture design, and quality review
Comprehensive startup business analysis with market sizing (TAM/SAM/SOM), financial modeling, team planning, and strategic research