Skip to main content
skill CX Codex

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

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add MiniMax-AI/mcode-stack
/plugin install ronny@mcode-stack
Open on GitHub

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

This 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-code

3Manually: put the files in place

~/.claude/skills/context-tax-audit/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/context-tax-audit/

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

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set27

The whole set →
agent-brief The agent-brief skill for Claude Code structures task delegation to AI agents. It forces clarity on stakes, hypotheses, and verification criteria before an agent starts working. CX Codex +1 ★ 741repo stars evidence-first-review evidence-first-review is a Claude Code skill that audits an agent’s finished work from command logs and test evidence. It runs before a PR merge or an analysis is accepted. CX Codex +1 ★ 741repo stars pr-description pr-description is a Claude Code skill that drafts and verifies pull request descriptions for GitHub and GitLab. It runs when opening a PR or when MCode Review reports missing sections. CX Codex +1 ★ 741repo stars subagent-split-check subagent-split-check is a Claude Code skill that decides whether work belongs in a subagent or the main loop. It checks context boundaries before a split. CX Codex +1 ★ 741repo stars long-session-check long-session-check is a Claude Code skill that audits long-session context and memory handling. It starts when constraints get lost or compaction has happened several times. CX Codex +1 ★ 741repo stars long-command-check long-command-check is a Claude Code skill that audits shell command execution in agent harnesses. It checks dev server hangs, timeouts, backgrounding, and prompt cache expiration. CX Codex +1 ★ 741repo stars tool-budget-audit tool-budget-audit is a Claude Code skill that measures context used by tool schemas and call results. It flags catalog bloat and mistaken tool choices. CX Codex +1 ★ 741repo stars pr-quiz pr-quiz is a Claude Code skill that drafts multiple-choice questions for PR authors. It triggers when the MCode Review pipeline requests an author quiz. CX Codex +1 ★ 741repo stars

Project sponsors

Companies that keep this analytics open