claude-crusts: Command for Claude Code

.claude/commands/crusts.md

crusts is a command for Claude Code from Abinesh-L/claude-crusts. It costs 0 tokens per session (442 once invoked), scanned A, original, MIT.

A command that analyzes how much of the agent's context window is being used. The context window is the amount of conversation and file content the agent can keep available at once.

In plain words
What is it for?
Use it to inspect context usage, find duplicate information, estimate how soon automatic summarization may occur, and get prioritized cleanup advice.
Why use it?
It identifies repeated file reads and other sources of wasted context, then reports whether action is needed before the conversation becomes too large.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is Abinesh-L/claude-crusts's own configuration. It tells Claude Code how to work on claude-crusts itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-crusts configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Abinesh-L/claude-crusts. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Abinesh-L/claude-crusts/main/.claude/commands/crusts.md
Clone the repo
git clone --depth 1 https://github.com/Abinesh-L/claude-crusts

Made for: Claude Code.

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 crusts

README.md
[![agentmods](https://agentmods.dev/badge/commands/abinesh-l/claude-crusts/crusts/github.svg)](https://agentmods.dev/commands/abinesh-l/claude-crusts/crusts)
Your own site
<a href="https://agentmods.dev/commands/abinesh-l/claude-crusts/crusts"><img src="https://agentmods.dev/badge/commands/abinesh-l/claude-crusts/crusts/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 crusts

Your own site · 80×15
<a href="https://agentmods.dev/commands/abinesh-l/claude-crusts/crusts"><img src="https://agentmods.dev/badge/commands/abinesh-l/claude-crusts/crusts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 442 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.00000 $0.00442
Opus 5 $0.00000 $0.00221
Sonnet 5 $0.00000 $0.00088
Haiku 4.5 $0.00000 $0.00044

Measured 5d ago against content hash e6b3a4b4e581, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

crusts 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 5d 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.

.claude/commands/crusts.md · 36 lines

What it actually says

Run the CRUSTS context window analyzer and give me actionable advice.

Steps:

  1. Run this command in the terminal and capture the full JSON output:

    npx claude-crusts analyze --json
    
  2. Parse the JSON result. Focus on:

    • breakdown.usage_percentage and breakdown.context_limit
    • breakdown.buckets (the 6 CRUSTS categories with token counts; each bucket's tokens is reconciled so the buckets sum to the API window total, while contentTokens keeps the raw classifier estimate)
    • waste array (each item has description, estimated_tokens, severity, recommendation)
    • recommendations.context_health (healthy/warming/hot/critical)
    • recommendations.estimated_messages_until_compaction
    • recommendations.recommendations (prioritized action items)
  3. If context health is "healthy" (usage <50%), say so briefly: "Context is healthy at X%. No action needed." Then stop.

  4. If context is warming, hot, or critical, give specific advice:

    Files to stop re-reading: Look at waste items with type "duplicate_read". List the exact filenames and say: "These files are already in your context. Reference them by name instead of reading them again."

    Compact or wait:

    • If estimated_messages_until_compaction is >30, say "No urgency — you have ~N messages before auto-compaction."
    • If it's 10-30, say "Consider running /compact soon."
    • If it's <10, say "Compact now" and provide the exact command.

    Specific /compact focus: If the recommendations include a compact focus suggestion, give the exact /compact focus on ... command to paste.

    Fresh session: If there have been 3+ compaction events OR usage is critical, suggest /clear and starting fresh instead.

  5. Keep the response short and direct. No tables, no category breakdowns — just tell me what to do right now.

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. 5d ago Changed e6b3a4b4e581
  2. 11d ago First seen · 36 lines · 0 tokens per session scan A e8ebb7b8dedd

Subscribe to this mod's changes

crusts is a command published in the GitHub repository Abinesh-L/claude-crusts (83 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 442 tokens. 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-30.