context-tax-audit — скилл для Claude Code: оптимизация контекста
Скилл context-tax-audit для Claude Code проводит аудит данных, которые агент добавляет в каждый запрос, для сокращения затрат на токены. Он выявляет лишние блоки в системном промпте и настройки, мешающие кэшированию запросов.
MIT ★ 741 обновлён 2026-11-11
/plugin marketplace add MiniMax-AI/mcode-stack
/plugin install ronny@mcode-stackЧто делает context-tax-audit
Этот инструмент анализирует состав каждого обращения агента к модели: от системных инструкций и списка доступных инструментов до метаданных среды и истории переписки. Аудит помогает понять, какие части промпта можно сократить или переместить, чтобы повысить частоту попаданий в кэш префикса и снизить издержки на каждый оборот диалога.
Работа строится на пошаговом чек-листе, который проверяет необходимость каждого injected-элемента. Вы фиксируете реальный запрос, оцениваете, что изменится при удалении блока, и перераспределяете компоненты по принципу стабильности: статические данные — в начало промпта, волатильные — в конец. Для использования потребуется токенизатор для подсчета веса блоков и отладка логов взаимодействия.
Процедура требует точности в измерении частоты обновлений полей: избыточная детализация, например передача времени с точностью до секунды в системный блок, приводит к постоянному сбросу кэша. Использование скилла позволяет добиться баланса между качеством ответов и стоимостью выполнения задач.
Какие задачи решает
- оценить расход токенов на системные инструкции
- найти блоки, снижающие эффективность кэширования промптов
- сократить избыточный контекст в каждом сообщении
- проверить необходимость каждого инструмента в промпте
Примеры запросов агенту
- /plugin marketplace add MiniMax-AI/mcode-stack /plugin install ronny@mcode-stack
- Проведи контекстный аудит текущего запроса по чек-листу context-tax-audit
- Составь инвентаризацию всех injected-данных для текущего промпта
Как установить context-tax-audit
1Через маркетплейс плагинов
/plugin marketplace add MiniMax-AI/mcode-stack/plugin install ronny@mcode-stackКоманда ставит плагин ronny целиком, со всеми его скиллами
2Через Skills CLI (Vercel)
npx skills add MiniMax-AI/mcode-stack --skill context-tax-audit -a claude-code3Вручную: положить файлы
~/.claude/skills/context-tax-audit/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/context-tax-audit/
1Через Skills CLI (Vercel)
npx skills add MiniMax-AI/mcode-stack --skill context-tax-audit -a codex2Вручную: положить файлы
.agents/skills/context-tax-audit/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add MiniMax-AI/mcode-stack --skill context-tax-audit -a cursor2Вручную: положить файлы
.cursor/skills/context-tax-audit/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install MiniMax-AI/mcode-stack stacks/ronny/skills/context-tax-audit2Вручную: положить файлы
.github/skills/context-tax-audit/SKILL.md1Через Skills CLI (Vercel)
npx skills add MiniMax-AI/mcode-stack --skill context-tax-audit -a gemini-cli2Командой платформы
gemini skills install https://github.com/MiniMax-AI/mcode-stack --path stacks/ronny/skills/context-tax-auditВручную: положить файлы
.devin/skills/context-tax-audit/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о context-tax-audit
Как установить context-tax-audit в Claude Code?
Выполните последовательно команды /plugin marketplace add MiniMax-AI/mcode-stack и /plugin install ronny@mcode-stack.
Что делает context-tax-audit?
Скилл помогает провести инвентаризацию всех данных, которые автоматически добавляются к запросам агента, и выявить те, что необоснованно увеличивают стоимость или блокируют работу кэша префикса.
Что нужно для работы context-tax-audit?
Для проведения аудита потребуется доступ к логам отладки или прокси, чтобы увидеть структуру запроса, а также любой токенизатор для оценки веса частей контекста.
Исходный текст
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