Audit token consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations. Use when the context window is filling up too fast or before adding new components.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
@agents/PROMPT-DEFENSE.md
# Context Budget Audit
Analyze token overhead across every loaded component in a session and surface actionable optimizations to reclaim context space.
## When to Use
- Session performance feels sluggish or output quality is degrading
- You've recently added many skills, agents, or MCP servers
- Planning to add more components and need to know if there's room
- Running `/context-budget` command (this skill backs it)
## Audit Procedure
### Phase 1: Inventory
Scan all component directories and estimate token consumption:
**Agents** (`agents/*.md`)
- Count lines and tokens per file (words × 1.3)
- Extract `description` frontmatter length
- Flag: files >200 lines (heavy), description >30 words (bloated frontmatter)
**Skills** (`skills/*/SKILL.md`)
- Count tokens per SKILL.md
- Flag: files >400 lines
- Check for duplicate copies — skip identical copies to avoid double-counting
**Rules** (`rules/**/*.md`, `rules/**/*.mdc`)
- Count tokens per file
- Flag: files >100 lines
- Detect content overlap between rule files
**MCP Servers** (active MCP config)
- Count configured servers and total tool count
- Estimate schema overhead at ~500 tokens per tool
…
The line at the top of this page pins the label v0.1.0, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
A 17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
pass: Frontmatter block present
pass: Frontmatter declares a name
pass: Frontmatter declares a description
pass: Size between 200 bytes and 200 KB (3187 bytes)
pass: No zero-width or bidi control characters
pass: No instruction hidden inside an HTML comment
pass: No link to an exfiltration or paste host
pass: No credential-shaped string
pass: No instruction to send local credentials anywhere
pass: No text hidden with inline styles
pass: No prompt-injection phrasing
pass: No curl or wget piped into a shell
pass: No recursive delete of root, home or parent
pass: No instruction to read or print local credentials
pass: No base64 blob over 200 characters
pass: No link to a raw IP address
pass: No script tag
Source
GitHub
coco-research/coco · 797 stars · license a license file GitHub does not identify · pushed 2026-11-05 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_z4qazs2b76e7ackf
GET https://markdownregistry.com/api/v1/resolve?ref=coco-research/coco/context-budget
GET https://markdownregistry.com/api/v1/blob/1ace8a5bcc1ecc67627c28550247e8e6def13aeea0203f6913a93224c658c33a
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
coco-research/coco · adapters/cursor/skills/create-rule/SKILL.md · Create Cursor rules for persistent AI guidance. Use when the user wants to create a rule, add coding standards, set up…
coco-research/coco · adapters/cursor/skills/create-skill/SKILL.md · Guides users through creating effective Agent Skills for Cursor. Use when the user wants to create, write, or author a…
coco-research/coco · adapters/cursor/skills/create-subagent/SKILL.md · Create custom subagents for specialized AI tasks. Use when the user wants to create a new type of subagent, set up…
coco-research/coco · adapters/cursor/skills/update-cursor-settings/SKILL.md · Modify Cursor/VSCode user settings in settings.json. Use when the user wants to change editor settings, preferences…
coco-research/coco · skills/agent-lightning/SKILL.md · Train and optimize AI agents using Microsoft's Agent Lightning framework with reinforcement learning. Use when setting…
coco-research/coco · skills/agent-self-eval/SKILL.md · Post-run self-evaluation system that scores agent output on correctness, clarity, actionability, and conciseness. Use…
coco-research/coco · skills/ai-product/SKILL.md · Use when building AI features into a product: LLM integration, RAG pipelines, guardrails, streaming, AI UX, prompt…
coco-research/coco · skills/api-design-principles/SKILL.md · Use when designing a new REST or GraphQL API, reviewing an API spec before implementation, setting team API standards…
ericrisco/rsc-harness · skills/context-budget/SKILL.md · Use when a long-horizon task is filling the context window and you must decide what to keep, offload, drop, or hand off…
onewave-ai/claude-skills · context-budget/SKILL.md · Use when a coding session is burning context fast, output is drowning in noise, the model keeps forgetting earlier…
frankxai/claude-skills-library · absorbed/harness/context-budget/SKILL.md · Count what a session loads before adding another skill or MCP server. Use when the default prompt is heavy, a new…
drayline/rootnode-skills · plugins/rootnode-projects/skills/context-budget/SKILL.md · Analyzes Claude Project context budget under the automatic-RAG-by-window model: knowledge files vs. threshold-exempt…
univers42/claude-deal-with-the-devil · skills/context-budget/SKILL.md · Measure and cut what a config costs in context every session: always-on rules, invocable descriptions, skills that…