By gunesbizim
Track and report Claude token usage from local logs and the Anthropic Admin API
All-time Claude token totals grouped by month. Usage: /tokenstein-alltime [--currency=usd|eur]
Per-model cost breakdown for a given month. Usage: /tokenstein-cost <YYYY-MM> [--currency=usd|eur]
Last 24 hours of Claude token usage, broken down by hour.
Generate a self-contained HTML report for all time periods (today, week, month, quarter, YTD, LTD). Usage: /tokenstein-html [--currency=usd|eur] [--open] [--output=<path>]
Force a token usage ingest from Claude Code transcripts and Admin API.
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.
Track and report Claude token usage — directly inside Claude Code.
Ingests session transcripts from ~/.claude/projects/ and the Anthropic Admin API, stores them in a local DuckDB database, and exposes slash commands and an MCP server so you can query your usage without leaving the chat.
# From GitHub
claude plugin install gunesbizim/claude-tokenstein
# From a local clone
claude plugin install ./
npm install -g claude-tokenstein
~/.claude-tokenstein/config.json with your Admin API key (see Configuration)./tokenstein-today to see today's usage.Create ~/.claude-tokenstein/config.json (the directory is created automatically on first run):
{
"admin_api_key": "sk-ant-admin-...",
"default_currency": "usd",
"fx_override_usd_eur": null,
"ingest": {
"claude_code": true,
"admin_api": true,
"max_admin_api_lookback_days": 30
},
"store_prompts": true
}
Secure the file on macOS/Linux (tokenstein enforces this at startup):
chmod 600 ~/.claude-tokenstein/config.json
| Field | Default | Description |
|---|---|---|
admin_api_key | (none) | Anthropic Admin API key (sk-ant-admin-…). Optional — transcript ingest works without it. |
default_currency | "usd" | "usd" or "eur" |
fx_override_usd_eur | null | Fixed USD→EUR rate. null = fetch live from frankfurter.app |
ingest.claude_code | true | Ingest local JSONL transcripts |
ingest.admin_api | true | Ingest from Anthropic Admin API |
ingest.max_admin_api_lookback_days | 30 | How many days back to fetch from Admin API |
store_prompts | true | Store prompt text in the DB for session-level queries |
All commands accept --currency=eur to render costs in EUR.
Commands that produce tabular output also accept --json for machine-readable output.
| Command | Description |
|---|---|
/tokenstein-today | Today's totals with per-model split |
/tokenstein-ytd | Year-to-date totals with daily sparkline |
/tokenstein-alltime | All-time totals grouped by month |
/tokenstein-report <N> | Last N days with daily sparkline |
/tokenstein-session [id] | Current or specified session breakdown |
/tokenstein-hourly | Last 24 hours broken down by hour |
/tokenstein-top [--by=session|project|model] [--n=10] | Top-N token consumers |
/tokenstein-cost <YYYY-MM> | Per-model cost breakdown for a month |
/tokenstein-ingest | Force a manual ingest pass |
/tokenstein-today
/tokenstein-today --currency=eur
/tokenstein-report 7
/tokenstein-cost 2026-04 --currency=eur
/tokenstein-top --by=project --n=5
/tokenstein-session
/tokenstein-alltime --currency=eur
When installed globally via npm, the same commands are available on the terminal:
claude-tokenstein today
claude-tokenstein ytd --currency=eur
claude-tokenstein all-time
claude-tokenstein report 30
claude-tokenstein cost 2026-04
claude-tokenstein top --by=project --n=5
claude-tokenstein session
claude-tokenstein hourly
claude-tokenstein ingest
claude-tokenstein ingest --dry-run
claude-tokenstein ingest --source=claude_code
Global flags (place before the subcommand):
| Flag | Description |
|---|---|
--currency <c> | usd (default) or eur |
--json | Output JSON instead of a table |
--color | Enable ANSI color output |
When Anthropic changes pricing, add a file at ~/.claude-tokenstein/prices.json. Entries are merged over the bundled defaults — you only need to include changed models:
{
"claude-opus-4-7": {
"input": 15.0,
"output": 75.0,
"cache_write": 18.75,
"cache_read": 1.50
}
}
All values are in USD per million tokens.
npx claudepluginhub gunesbizim/claude-tokenstein --plugin claude-tokensteinAutonomous development pipeline — auto-configures MCP servers, scaffolds project-aware Claude Code skills, and drives ticket-to-PR workflows
Open-source, local-first Claude Code plugin for token reduction, context compression, and cost optimization using hybrid RAG retrieval (BM25 + vector search), reranking, AST-aware chunking, and compact context packets.
Complete AI coding workflow system. Self-correcting memory + persistent FTS5-indexed research wikis + auto-research loop + multi-LLM council on a single SQLite store. 33 skills, 8 agents, 22 commands, 37 hook scripts across 24 events. Cross-agent via SkillKit.
Give your AI a memory — mine projects and conversations into a searchable palace. 33 MCP tools, auto-save hooks, and guided setup.
MCP server that saves 98% of your context window with session continuity. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and automatic state restore across compactions.
Comprehensive 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.
Persistent file-based planning for AI coding agents. Crash-proof markdown plans (task_plan.md, findings.md, progress.md) that survive context loss and /clear, with an opt-in completion gate and multi-agent shared state. Manus-style. Works with Claude Code, Codex CLI, Cursor, Kiro, OpenCode and 60+ agents via the SKILL.md standard. Includes Arabic, German, Spanish, and Chinese (Simplified and Traditional).