Context budget
17 model-agnostic thinking & context-engineering skills for Claude — clarify, attack your own plan, manage the context window, verify before trusting. grill-me-style process skills.
npx -y skills add opelpleple/meta-skills --skill context-budgetAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Audits what is currently consuming the context window — system prompt, tool definitions, conversation history, attached files, retrieved docs — locates the bloat, and cuts or compresses the lowest-value tokens, treating context as a finite budget to be spent deliberately. Use this skill when the user says "context is full", "what's eating my context", "prune this prompt", or "make this cheaper/faster"; when runs feel slow or costly; when too many tools or huge files are loaded; or whenever you need to reclaim room before continuing.
SKILL.md
4.1 KB, as published. Nobody here has run it
Context Budget
Treat the context window as a finite budget: see where the tokens go, then cut or compress the lowest-value ones first.
When to use
- The window is near full and you need headroom to keep working.
- Runs feel slow, expensive, or the model seems to be "losing track" (context rot).
- A prompt, tool set, or set of attachments has grown bloated over time.
- The user asks what's consuming context or to optimize token usage.
When NOT to use
- The context is small and well within budget — don't optimize prematurely.
- Cutting would remove genuinely load-bearing information (then
compactorscratchpadinstead — relocate, don't delete). - The real problem is a missing summary, not bloat — reach for
compact.
The method (numbered, concrete — the heart)
- Inventory the consumers. Account for each category and roughly how much it costs: system prompt, tool/function definitions, conversation history, attached/read files, retrieved docs, and prior tool outputs.
- Rank by value density. For each chunk ask: how likely is this to be needed for the remaining work, per token it costs? Low-likelihood, high-token chunks are the first targets.
- Cut dead weight. Remove tool definitions you won't use, files read once and finished with, stale retrieved docs, and tool outputs already acted upon.
- Compress the rest. Replace full files with the relevant excerpt; replace verbose history with a
compactsummary; replace big results with their conclusion plus a pointer. - Right-size the toolset. Fewer, well-chosen tools beat a giant menu — every definition costs tokens and dilutes attention. Load tools on demand rather than all upfront.
- Push bulk out of the window. Move reference material to files and pull it back on demand (see
scratchpad) instead of keeping it resident. - Tighten the system prompt. Aim for the "right altitude" — specific enough to guide, not a bloated rulebook. Delete redundant, contradictory, or never-triggered instructions.
- Re-measure. Confirm headroom was reclaimed and nothing load-bearing was lost, then continue.
What good looks like
- You can name the top 3 token consumers and justify each one's keep/cut/compress call.
- The biggest savings came from the highest-token, lowest-value chunks — not from nibbling.
- Nothing essential was deleted; it was relocated to a file or a summary instead.
- The toolset is minimal-sufficient; the system prompt is lean and non-redundant.
Anti-patterns
- Trimming the cheap stuff — shaving a short prompt while a 5,000-line file sits ignored in context.
- Deleting instead of relocating — losing information that's needed later instead of offloading it.
- Tool sprawl — loading dozens of tool definitions "just in case", taxing every single turn.
- Pasting whole files — when one function or section was all that mattered.
- Optimizing once and forgetting — budget is a running concern; re-check as the session grows.
Example (short, vivid)
"Context is full and it's crawling." Quick audit:
| Consumer | Tokens | Verdict |
|---|---|---|
| 3 large files read earlier | ~18k | Cut — task moved on; keep paths only |
| 22 tool definitions | ~6k | Trim — only 4 used this session |
| Raw stack-trace dumps ×5 | ~4k | Compress — keep the one root cause |
| Conversation history | ~12k | Compact — summarize to ~2k |
| System prompt | ~1k | Keep |
Result: ~40k reclaimed by attacking the few fat, low-value chunks — the small system prompt was left alone.