token-doctorlisted
Install: claude install-skill techwolf-ai/ai-first-toolkit
# Token Doctor
Two-stage diagnostic. Stage 1 is fast and lands directly in the terminal so the user always walks away with their numbers. Stage 2 is opt-in, fans out subagents over hotspots, and writes a tight Markdown report.
**Read this whole file before running.**
## When to run
Trigger phrases: "diagnose my Claude habits", "why am I spending so much", "where are my tokens going", "audit my spend", "token doctor", "what's driving my Claude bill".
Do NOT trigger for:
- "what tasks do I do with Claude" → that's `task-profile`.
- "where did I work on X" → that's `session-search`.
The line is: token-doctor is about cost **shape**, not task inventory or recall.
## Prerequisites
- Claude Code CLI transcripts: `~/.claude/projects/*/*.jsonl`
- Claude Cowork transcripts (optional): `~/Library/Application Support/Claude/local-agent-mode-sessions/*/*/local_*/audit.jsonl`
- Python 3, stdlib only. No external services.
If neither path exists, stop and say so.
---
## STAGE 1 — Fast diagnosis (always runs, you write the report)
The goal is: the user invokes the skill, sees a clean doctor's report within 10 seconds, knows which projects are healthy and which are bleeding, and can decide whether to go deeper. **You write the report directly in your message** based on the JSON the scripts produce. The scripts compute, you communicate.
### Step 1.1 — Inventory (deterministic)
```bash
~/.claude/skills/token-doctor/scripts/inventory.py --since YYYY-MM-DD --out out/sessions.jsonl