| name | cat:token-report |
| description | Generate detailed token usage report with threshold analysis and recommendations |
Token Report
Purpose
Display a compact token usage report showing per-subagent breakdown with context utilization, health status, and duration. Essential for understanding session resource consumption at a glance.
When to Use
- Quick health check during any session
- Periodic monitoring during long-running orchestration
- After subagent completion to check overall consumption
- Before deciding whether to decompose remaining work
- Post-task retrospectives on efficiency
Step 1: Check for Pre-Computed Results (MANDATORY)
CRITICAL: This skill requires hook-based pre-computation. Check context for:
PRE-COMPUTED TOKEN REPORT:
If PRE-COMPUTED TOKEN REPORT is found:
Output the table EXACTLY as provided. Do NOT modify alignment or recalculate values.
Example pre-computed output:
โญโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโฎ
โ Type โ Description โ Tokens โ Context โ Duration โ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโค
โ Explore โ Explore codebase โ 68.4k โ 34% โ 1m 7s โ
โ general-purpose โ Implement fix โ 90.0k โ 45% โ ๏ธ โ 43s โ
โ general-purpose โ Refactor module โ 170.0k โ 85% ๐จ โ 3m 12s โ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโค
โ โ TOTAL โ 328.4k โ - โ 5m 2s โ
โฐโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโฏ
If PRE-COMPUTED TOKEN REPORT is NOT found:
FAIL immediately with this message:
ERROR: Pre-computed token report not found.
The hook precompute-token-report.sh should have provided the table data.
Do NOT attempt manual computation - the alignment requires deterministic
Python-based calculation.
Possible causes:
1. Session file not found
2. No subagent data in session
3. Hook execution failed
Try running /cat:token-report again or check session status.
Do NOT proceed to manual extraction or table building.
Table Format Reference
The pre-computed table uses these specifications:
Column widths (fixed):
| Column | Width | Content |
|---|
| Type | 17 | Subagent type (truncated with ...) |
| Description | 30 | Task description (truncated with ...) |
| Tokens | 8 | Formatted count (68.4k, 1.5M) |
| Context | 16 | Percentage with emoji indicator |
| Duration | 10 | Formatted time (1m 7s) |
Context indicators (INSIDE column):
| Context % | Display | Meaning |
|---|
| < 40% | "34%" | Healthy - plenty of headroom |
| >= 40% and < 80% | "45% โ ๏ธ" | Warning - above soft target |
| >= 80% | "85% ๐จ" | Critical - approaching limit |
Box characters:
- Top:
โญโโฌโโฎ
- Divider:
โโโผโโค
- Bottom:
โฐโโดโโฏ
- Sides:
โ
Verification Checklist
Before outputting the table, verify:
Anti-Patterns
Never attempt manual table construction
jq -s '...' "$SESSION_FILE"
Never modify pre-computed alignment
# BAD - "Fixing" spacing or alignment
โ Type โ # Wrong - modified padding
# GOOD - Copy exactly as provided
โ Type โ # Correct - preserved padding
Related Skills
cat:monitor-subagents - Uses token data for health checks
cat:decompose-task - Triggered when context reaches critical levels
cat:learn-from-mistakes - Uses token data for context-related analysis