toolkit/packages/skills/token-usage/SKILL.md
Show Claude Code token usage across sessions — daily, weekly, per-project, and per-session breakdowns. Parses {{HOME_TOOL_DIR}}/projects/**/*.jsonl for consumption data. Use when the user asks about token usage, costs, how many tokens were used, session statistics, or wants a usage report.
npx skillsauth add stevengonsalvez/agents-in-a-box token-usageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze Claude Code token consumption across all sessions.
IMPORTANT: Always use --format markdown and display the full output directly to the user as markdown tables. Do NOT summarize or truncate.
Run the script and display the FULL output as-is:
python3 {{HOME_TOOL_DIR}}/skills/token-usage/scripts/token_usage.py --format markdown [ARGS]
Pass through any user-provided arguments (--days, --since, --project, --top-sessions).
# All time usage
python3 {{HOME_TOOL_DIR}}/skills/token-usage/scripts/token_usage.py --format markdown
# Last 7 days
python3 {{HOME_TOOL_DIR}}/skills/token-usage/scripts/token_usage.py --days 7 --format markdown
# Since a specific date
python3 {{HOME_TOOL_DIR}}/skills/token-usage/scripts/token_usage.py --since 2026-04-01 --format markdown
# Filter to a specific project
python3 {{HOME_TOOL_DIR}}/skills/token-usage/scripts/token_usage.py --project shotclubhouse --format markdown
# Top 20 costliest sessions
python3 {{HOME_TOOL_DIR}}/skills/token-usage/scripts/token_usage.py --days 30 --top-sessions 20 --format markdown
# JSON output (for piping to jq)
python3 {{HOME_TOOL_DIR}}/skills/token-usage/scripts/token_usage.py --format json | jq '.grand_total'
After running the script:
| Flag | Description | Default |
|------|-------------|---------|
| --days N | Only include last N days | All time |
| --since YYYY-MM-DD | Only include since this date | All time |
| --project NAME | Filter to project (substring match) | All projects |
| --top-sessions N | Number of top sessions to show | 10 |
| --format text\|markdown\|json | Output format | text |
| --projects-dir PATH | Override projects directory | {{HOME_TOOL_DIR}}/projects |
Parses {{HOME_TOOL_DIR}}/projects/**/*.jsonl — Claude Code's session transcript files. Each assistant message contains a usage block with input_tokens, cache_creation_input_tokens, cache_read_input_tokens, and output_tokens.
The ainb-tui has a built-in Usage Analytics screen (press i from home screen or select "Stats" in the sidebar) that provides the same data with a visual bar chart and provider selector. This skill is the CLI-only alternative.
documentation
Report reflect drain spend over a time window — tokens split by cached (cache_read), uncached writes (cache_creation), and io (input+output), with a $ estimate, grouped by day / outcome / model / transcript. Reads the drainer's cost log and surfaces outlier runs and cache-reuse health (the 41.5M-token failure mode = low cache reuse + high cache writes). Use to answer "what is reflection costing me" for the last day / week.
development
Show fleet status — every claude session running on the host, merged across ainb + claude-peers broker + background jobs. Use when you need to enumerate sessions before composing an action, see which sessions have a peer registered (broker-routable) vs tmux-only, check the `summary` of each session, or pipe the list into jq for filtering. Default output: text table. Pass --format json for LLM consumption.
testing
Ordered multi-step prompts to fleet targets, ack-gated between steps via JSONL assistant-turn-end detection. Use for cycles like disconnect→reconnect→verify, or any flow where step N+1 requires step N to have completed first. The skill BLOCKS until each target's transcript shows the next assistant turn finishing OR per-step timeout fires (default 300s).
development
Center control panel — enumerate every claude session that is blocked waiting on something: a user answer (AskUserQuestion fired), an API error retry, an idle assistant turn-end with no follow-up, or an explicit WAITING: marker. Returns rich JSON with signal kind + context per session. Use this when you've stepped away from the fleet and want one place to see everything that wants your attention and answer it.