ask-matt
MAmattpocock/skills336k近 7 天新增 4,217 个 star
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.
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.
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.
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.
Caches match on prefix. One changed byte invalidates everything after it.
Rules of thumb:
# Environment free of current time; put
time in per-turn <agent-context> (or the equivalent user-message block).| 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? |
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.
MAmattpocock/skills336k近 7 天新增 4,217 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star
OBobra/superpowers331k近 7 天新增 5,030 个 star
AFaffaan-m/ECC314k近 7 天新增 3,503 个 star
AFaffaan-m/ECC314k近 7 天新增 3,503 个 star