contextune:usage

A command that checks Claude Code usage and estimates how much of your session or weekly allowance remains.

In plain words
What is it for?
Use it to review usage, get warnings about limits, and receive recommendations about model choice and concurrent tasks.
Why use it?
It helps avoid reaching usage limits unexpectedly and gives guidance on choosing models or limiting parallel work.

Command

Install

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.

agentmods
npx agentmods add commands/shakestzd/contextune/contextune-usage
Clone the repo
git clone --depth 1 https://github.com/shakestzd/contextune
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,588 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.00014 $0.01588
Opus 5 $0.00007 $0.00794
Sonnet 5 $0.00003 $0.00318
Haiku 4.5 $0.00001 $0.00159

Measured yesterday against content hash 981c8659e7a7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

contextune: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 yesterday.

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.

commands/contextune-usage.md · 240 lines

How it starts

The opening of the file, as written. The whole thing — 240 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Usage Tracking & Optimization

Contextune integrates with Claude Code's /usage command to provide intelligent context optimization, cost savings, and proactive warnings.

Quick Start

Option 1: Manual Paste (Most Accurate - Recommended)

  1. Run Claude Code's usage command:

    /usage
    
  2. Copy the entire output

  3. Run this command and paste when prompted:

    /contextune:usage
    

Option 2: Automatic Estimation

Contextune automatically estimates usage based on tracked operations (~85% accurate for Contextune tasks only).

View current estimates:

/contextune:stats

What You Get

Intelligent Recommendations

Based on your current usage, Contextune provides:

  • Model Selection: Auto-switch to Haiku when approaching limits (87% cost savings)
  • Parallel Task Limits: Recommended max concurrent tasks based on remaining quota
  • Proactive Warnings: Alerts when approaching session or weekly limits
  • Opus Opportunities: Suggestions to use Opus when quota is available for complex tasks

Example Output

📊 Current Usage Analysis
═══════════════════════════════════════

📈 Usage Metrics:
  Session:  19% (resets 1:00am America/New_York)
  Weekly:   90% (resets Oct 29, 10:00pm America/New_York)  ⚠️  CRITICAL
  Opus:     0%

🎯 Status: CRITICAL

⚠️  Warnings:
  • CRITICAL: 90% weekly usage (resets Oct 29, 10:00pm)
  • You have ~10% capacity until Oct 29, 10:00pm

💡 Recommendations:
  • Switch research tasks to Haiku (87% cost savings)
  • Recommended max parallel tasks: 2
  • Consider deferring non-critical tasks until weekly reset
  • ✨ Opus available (0% used) - great for complex architecture tasks

📊 Historical Trends:
  • Average daily usage: 12.9% (7-day trend)
  • Projected usage to limit: [calculation]
  • Cost savings from Haiku: $0.42 this week

Usage Thresholds

Weekly Usage Status Automatic Actions
0-70% ✅ Healthy Normal operation, all models available
71-85% ⚠️ Warning Suggest Haiku for research tasks
86-95% 🚨 Critical Auto-switch to Haiku, limit parallel tasks
96-100% 🛑 Limit Defer all tasks until reset

Read the full file on GitHub · 240 lines

Changes

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.

  1. yesterday First seen · 240 lines · 14 tokens per session scan A 981c8659e7a7

Subscribe to this mod's changes

contextune:usage is a command published in the GitHub repository shakestzd/contextune (5 stars, last pushed 8mo ago), licensed MIT. It adds 14 tokens to every session and 1,588 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.