Cat:Token Report
by cowwoc
Generate detailed token usage report with threshold analysis and recommendations
Skill Details
Repository Files
1 file in this skill directory
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:
- Pre-computed results found in context
- Table copied exactly (no modifications)
- All box characters preserved
- Emoji indicators inside Context column
- No additional computation performed
Anti-Patterns
Never attempt manual table construction
# BAD - Manual jq extraction and formatting
jq -s '...' "$SESSION_FILE"
# Then manually building table rows
# GOOD - Use pre-computed results only
# Output exactly what the hook provided
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 checkscat:decompose-task- Triggered when context reaches critical levelscat:learn-from-mistakes- Uses token data for context-related analysis
Related Skills
Attack Tree Construction
Build comprehensive attack trees to visualize threat paths. Use when mapping attack scenarios, identifying defense gaps, or communicating security risks to stakeholders.
Grafana Dashboards
Create and manage production Grafana dashboards for real-time visualization of system and application metrics. Use when building monitoring dashboards, visualizing metrics, or creating operational observability interfaces.
Matplotlib
Foundational plotting library. Create line plots, scatter, bar, histograms, heatmaps, 3D, subplots, export PNG/PDF/SVG, for scientific visualization and publication figures.
Scientific Visualization
Create publication figures with matplotlib/seaborn/plotly. Multi-panel layouts, error bars, significance markers, colorblind-safe, export PDF/EPS/TIFF, for journal-ready scientific plots.
Seaborn
Statistical visualization. Scatter, box, violin, heatmaps, pair plots, regression, correlation matrices, KDE, faceted plots, for exploratory analysis and publication figures.
Shap
Model interpretability and explainability using SHAP (SHapley Additive exPlanations). Use this skill when explaining machine learning model predictions, computing feature importance, generating SHAP plots (waterfall, beeswarm, bar, scatter, force, heatmap), debugging models, analyzing model bias or fairness, comparing models, or implementing explainable AI. Works with tree-based models (XGBoost, LightGBM, Random Forest), deep learning (TensorFlow, PyTorch), linear models, and any black-box model
Pydeseq2
Differential gene expression analysis (Python DESeq2). Identify DE genes from bulk RNA-seq counts, Wald tests, FDR correction, volcano/MA plots, for RNA-seq analysis.
Query Writing
For writing and executing SQL queries - from simple single-table queries to complex multi-table JOINs and aggregations
Pydeseq2
Differential gene expression analysis (Python DESeq2). Identify DE genes from bulk RNA-seq counts, Wald tests, FDR correction, volcano/MA plots, for RNA-seq analysis.
Scientific Visualization
Meta-skill for publication-ready figures. Use when creating journal submission figures requiring multi-panel layouts, significance annotations, error bars, colorblind-safe palettes, and specific journal formatting (Nature, Science, Cell). Orchestrates matplotlib/seaborn/plotly with publication styles. For quick exploration use seaborn or plotly directly.
