Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/shakestzd/contextune/ctx-usagegit clone --depth 1 https://github.com/shakestzd/contextuneWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00012 | $0.00511 |
| Opus 5 | $0.00006 | $0.00255 |
| Sonnet 5 | $0.00002 | $0.00102 |
| Haiku 4.5 | $0.00001 | $0.00051 |
Grade A, and why
ctx:usage scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
/ctx:usage - Context Usage Optimization
Track your Claude Code usage and get intelligent recommendations for cost optimization.
Usage
Quick Check (Manual Input)
# 1. Run Claude Code's built-in command:
/usage
# 2. Then run this command to log it:
/ctx:usage
Claude will ask you to paste the /usage output, then provide:
- ✅ Current usage status
- ⚠️ Warnings if approaching limits
- 💡 Recommendations (model selection, parallel tasks, timing)
- 📊 Historical trends
Automatic Tracking
Contextune automatically estimates your token usage based on:
- Prompt lengths
- Response sizes
- Haiku vs Sonnet usage
- Parallel task spawning
Example Output
📊 Context Usage Analysis
Current Status:
Session: 7% (resets 12:59am)
Weekly: 89% (resets Oct 29, 9:59pm)
Opus: 0% available
⚠️ Warnings:
• 89% weekly usage - approaching limit
• Reset in: [time remaining]
💡 Recommendations:
• Switch research tasks to Haiku (87% cost savings)
• Max parallel tasks: 2 (based on remaining context)
• ✨ Opus available (0% used) - great for complex architecture
• Defer non-critical tasks until weekly reset
📈 Estimated Savings:
• Using Haiku for next 5 tasks: ~$0.45 saved
• Waiting until reset: +11% weekly capacity
Integration with Other Commands
/ctx:research
Automatically uses Haiku when weekly usage > 80%
/ctx:plan
Limits parallel tasks based on available context
/ctx:execute
Defers execution if approaching session limits
Manual Update
If you want to manually log usage data:
/ctx:usage --update
Then paste your /usage output when prompted.
Dashboard
View historical trends:
marimo edit notebooks/contextune_metrics_dashboard.py
The dashboard shows:
- Usage trends over time
- Cost savings from optimization
- Model selection patterns
- Parallel task efficiency
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 98 lines · 12 tokens per session scan A eac7e88fa186
ctx:usage is a command published in the GitHub repository shakestzd/contextune (5 stars, last pushed 8mo ago), licensed MIT. It adds 12 tokens to every session and 511 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
OpenSpec: Archive
Archive a deployed OpenSpec change and update specs.
OpenSpec: Proposal
Scaffold a new OpenSpec change and validate strictly.
OpenSpec: Apply
Implement an approved OpenSpec change and keep tasks in sync.
opsx-bulk-apply
Apply multiple OpenSpec changes concurrently in isolated worktrees.
spec-audit
Review — attack the SPEC before any code is written.
spec
Think — write the lean SPEC that the build will be measured against.