ctx:usage

ctx:usage is a command for Claude Code from shakestzd/contextune. It costs 12 tokens per session (511 once invoked), scanned A, original, MIT.

A usage-reporting command for Claude Code, the coding-agent tool. It records context use and gives estimates about limits, model use, parallel tasks, and possible savings.

In plain words
What is it for?
Use it to review current and historical usage, receive warnings, and decide when to change models, reduce parallel work, or wait for a reset.
Why use it?
It helps you notice when a session or weekly allowance is running low before a task is interrupted.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument; mentions Claude Code.

Part of the contextune plugin — 8 skills, 14 commands, 5 agents, 6 hooks, 1 MCP server shipped together

Good fit Use it to review current and historical usage, receive warnings, and decide when to change models, reduce parallel work, or wait for a reset.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/shakestzd/contextune/ctx-usage
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.

Clone the repo
git clone --depth 1 https://github.com/shakestzd/contextune

Made for: Claude Code.

Or install contextune, the plugin that ships this one along with the rest of its 8 skills, 14 commands, 5 agents, 6 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ctx:usage

README.md
[![agentmods](https://agentmods.dev/badge/commands/shakestzd/contextune/ctx-usage/github.svg)](https://agentmods.dev/commands/shakestzd/contextune/ctx-usage)
Your own site
<a href="https://agentmods.dev/commands/shakestzd/contextune/ctx-usage"><img src="https://agentmods.dev/badge/commands/shakestzd/contextune/ctx-usage/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ctx:usage

Your own site · 80×15
<a href="https://agentmods.dev/commands/shakestzd/contextune/ctx-usage"><img src="https://agentmods.dev/badge/commands/shakestzd/contextune/ctx-usage.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 511 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00012 $0.00511
Opus 5.5 $0.00005 $0.00204
Sonnet 5.5 $0.00002 $0.00102
Haiku 4.5 $0.00001 $0.00051

Measured 1mo ago against content hash eac7e88fa186, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 1mo 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.

commands/ctx-usage.md · 98 lines

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
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. 1mo ago First seen · 98 lines · 12 tokens per session scan A eac7e88fa186

Subscribe to this mod's changes

ctx:usage is a command published in the GitHub repository shakestzd/contextune (5 stars, last pushed 10mo ago), licensed MIT. It adds 12 tokens to every session and 511 once invoked, about $0.0000 per session on Opus 5.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.