From token-tracker
Track Claude Code token usage in a local SQLite database and visualize it with an interactive D3.js dashboard. The dashboard auto-starts via a bundled MCP server — no manual launch needed. Use this skill whenever the user mentions token tracking, token usage, token budget, usage dashboard, cost tracking, monitoring Claude usage, or wants visibility into how much context or tokens their Claude sessions consume. Also trigger when users say "how many tokens am I using", "track my usage", "token budget", "usage analytics", "show me my Claude costs", "I want to see my token history", or "launch the token dashboard". Even if they just ask about recent Claude spending or want a usage breakdown, this skill is the right one.
How this skill is triggered — by the user, by Claude, or both
Slash command
/token-tracker:token-trackerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Track every token Claude Code consumes — per-session, per-turn, and per-tool-use — in a local
Track every token Claude Code consumes — per-session, per-turn, and per-tool-use — in a local SQLite database, with an interactive D3.js dashboard that's always available.
Everything is automatic once the plugin is installed:
Plugin loads
└─> .mcp.json starts mcp-server.py (STDIO MCP server)
├─> Spawns worker.py daemon if not already running
├─> Registers MCP tools (get_dashboard_url, get_usage_summary, ...)
└─> Proxies tool calls to worker via HTTP
worker.py (persistent daemon, survives session restarts)
├─> Owns SQLite database
├─> Serves HTTP dashboard on fixed port (default 47700)
└─> Exposes /api/ingest, /api/summary, /api/sessions, etc.
Each assistant turn
└─> hooks.json fires token_tracker.py (Stop hook)
├─> Parses session transcript JSONL
├─> Extracts token usage events
└─> POSTs events to worker's /api/ingest endpoint
The worker daemon is the single owner of all data persistence. The MCP server is a thin STDIO proxy. The hook is a thin transcript parser that forwards events over HTTP.
Call the get_dashboard_url MCP tool — it returns a localhost URL the user can open in
their browser. The dashboard is already running; no manual start is needed. The default
view is "Day" for the most relevant recent usage.
Call the get_usage_summary MCP tool with a period (all, quarter, month, week, day) to
get aggregate stats. Or call get_recent_sessions to see per-session breakdowns.
If the user wants raw data, query ~/.claude/token-tracker/token_tracker.db directly:
-- Total tokens this week
SELECT SUM(total_tokens) FROM token_events WHERE timestamp >= datetime('now', '-7 days');
-- Top tools by token usage
SELECT tool_name, COUNT(*) as uses, SUM(total_tokens) as total
FROM token_events WHERE tool_name IS NOT NULL
GROUP BY tool_name ORDER BY total DESC;
| Tool | Description |
|---|---|
get_dashboard_url | Returns the localhost URL where the dashboard is running |
get_usage_summary | Aggregate stats for a period (tokens, cost, sessions, turns) |
get_recent_sessions | List of recent sessions with per-session token totals |
All persistent data lives under ~/.claude/token-tracker/:
| File | Purpose |
|---|---|
token_tracker.db | SQLite database with all usage records |
dashboard_port | The port the worker daemon is listening on |
worker.pid | PID file for the persistent worker daemon |
worker.log | Worker daemon log |
mcp-server.log | STDIO MCP proxy log |
hook.log | Stop hook log |
.cursors/ | Tracks which transcript lines have been processed per session |
If the dashboard shows no data:
~/.claude/token-tracker/hook.log — is the hook firing?~/.claude/token-tracker/worker.log — is the worker running?~/.claude/token-tracker/worker.pid — does it contain a valid PID?curl http://localhost:47700/api/healthpython3 -c "import sqlite3; print(sqlite3.connect('$HOME/.claude/token-tracker/token_tracker.db').execute('SELECT COUNT(*) FROM token_events').fetchone())"~/.claude/token-tracker/venv/npx claudepluginhub arcalea-llc/public-claude-plugins --plugin token-trackerSearches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Implements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.