context-tax-audit — Claude Code skill: context optimization
The context-tax-audit skill for Claude Code inventories injected data in agent requests to reduce token usage. It identifies redundant prompt blocks and configurations that hinder prompt cache performance.
MIT ★ 741 updated 2026-11-11
/plugin marketplace add MiniMax-AI/mcode-stack
/plugin install ronny@mcode-stackWhat context-tax-audit does
This utility evaluates every piece of information an agent injects into a request beyond the user message, such as system prompts, environment details, tool definitions, and historical context. It helps determine which elements can be removed or relocated to improve prefix cache hit rates and lower per-turn costs.
The process follows a structured checklist to assess the necessity of every injected component. You document an actual request, verify the impact of removing specific parts, and reorganize content by stability: stable items go at the front, while volatile items are moved to the end. Utilizing this tool requires access to debug logs or request-building code and a tokenizer to measure token counts.
It enforces precision control, as unnecessary granularity—such as including timestamps down to the second in the system prompt—can invalidate the cache on every turn. By following the audit steps, you can balance model performance with efficiency.
What it helps with
- evaluate token consumption of system instructions
- identify blocks causing poor prompt cache performance
- reduce redundant context in agent requests
- validate necessity of each tool definition
Example prompts for the agent
- /plugin marketplace add MiniMax-AI/mcode-stack /plugin install ronny@mcode-stack
- Run a context audit on the current request using the context-tax-audit checklist
- Inventory all injected data for the current prompt
How to install context-tax-audit
1Plugin marketplace
/plugin marketplace add MiniMax-AI/mcode-stack/plugin install ronny@mcode-stackThis installs the whole ronny plugin with all its skills
2Skills CLI (Vercel)
npx skills add MiniMax-AI/mcode-stack --skill context-tax-audit -a claude-code3Manually: put the files in place
~/.claude/skills/context-tax-audit/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/context-tax-audit/
1Skills CLI (Vercel)
npx skills add MiniMax-AI/mcode-stack --skill context-tax-audit -a codex2Manually: put the files in place
.agents/skills/context-tax-audit/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add MiniMax-AI/mcode-stack --skill context-tax-audit -a cursor2Manually: put the files in place
.cursor/skills/context-tax-audit/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install MiniMax-AI/mcode-stack stacks/ronny/skills/context-tax-audit2Manually: put the files in place
.github/skills/context-tax-audit/SKILL.md1Skills CLI (Vercel)
npx skills add MiniMax-AI/mcode-stack --skill context-tax-audit -a gemini-cli2Platform CLI
gemini skills install https://github.com/MiniMax-AI/mcode-stack --path stacks/ronny/skills/context-tax-auditManually: put the files in place
.devin/skills/context-tax-audit/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about context-tax-audit
How to install context-tax-audit in Claude Code?
Run the commands /plugin marketplace add MiniMax-AI/mcode-stack followed by /plugin install ronny@mcode-stack in your terminal.
What does context-tax-audit do?
It audits all data automatically injected by an agent into its requests, helping you identify parts that waste tokens or break the prefix cache.
What is required to use context-tax-audit?
You need access to debug logs or raw request data to see what the agent is sending, and a tokenizer to calculate the relative cost of different context parts.
Source text
SKILL.md · MIT
--- name: context-tax-audit description: Inventory everything an agent injects into each request besides the user's message, such as system prompt, environment info, skill list, tool definitions, per-turn context blocks and reminders, and check necessity, frequency, precision, position and prompt-cache impact. Use when reviewing an agent's prompt assembly, chasing low cache hit rates, or trimming per-turn overhead. --- # Context Tax Audit Every request carries more than the user's sentence: system prompt, environment info, the skill list, tool definitions, per-turn context blocks, reminders. Most of it is worth paying for. The audit finds what is not, and what is placed so that it breaks the prompt cache. Companion to MCode Engineering Notes 05 (how the agent learns the current time — and why stuffing `date` into the system prompt breaks the prefix cache). Plain-text checklist: `checklists/context-tax.md`. ## 1. Inventory one real request Capture an actual request the agent sends (debug log, proxy, or the code that assembles it). List every part except the user's message: | Part | Where it sits | How often it changes | Tokens | | --- | --- | --- | --- | Count tokens with a tokenizer and name it; treat the counts as relative. Do a fresh-session first request and a later turn, since they often differ. ## 2. Necessity - what breaks if you delete it? For each part, write one sentence: "without this, the model would ...". Typical answers: without environment info it guesses the OS and shell; without the current time it assumes its training year; without a time budget it does not wrap up before a deadline. If you cannot write the sentence, the part is a candidate for removal. ## 3. Prompt-cache placement Caches match on prefix. One changed byte invalidates everything after it. 1. Content that is **at the front and changes every request** is the most expensive. Move it later. 2. Content **written into history and never edited** costs once and then stays cacheable. 3. Content **attached only to the current request** is never cached and is paid at full price every time. Control its frequency. Rules of thumb: - Stable first, volatile last. Keep `# Environment` free of current time; put time in per-turn `<agent-context>` (or the equivalent user-message block). - Never rewrite reminders already in history; change only future turns. - Use only the precision you need. A timestamp to the second guarantees every copy differs once placement is already right. - Request-only reminders never enter the cache — control how often they fire, but do not confuse that thrift with protecting the prefix. ## 4. Run the checklist | Item | Question | | --- | --- | | Prefix awareness | Can you point to the stable prefix vs what changes every turn? | | Necessity | For each part, where does the model go wrong without it? | | Position | Is anything volatile inside the system prompt or tool definitions? (e.g. time in `# Environment`) | | Frequency | Does a changing field need every turn / request, or only at the start, key points, or on change? | | Precision | Does it need seconds, exact counts? Higher precision means more turn-to-turn variation. | | History | Are reminders already in history ever rewritten later? | | Recovery paths | If you remove something, does it vanish entirely on compaction, session resume or subagents? Who restores it? | | Measurement | Before and after a change, do you look at cache hit rate, cost per turn and task quality, not just token count? | ## Output The inventory table, a list of parts to cut, move, reduce in frequency or reduce in precision (each with the reason), and what to measure to confirm the change helped.
© Ronny (MiniMax Code team) · MIT · MiniMax-AI/mcode-stack