context-budgeting
Deliberately manages the context window to cut token cost and prevent quality decay on long runs.
Skill by Adrian Paredez
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/adrianparedez-context-budgeting
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: research, productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/context-budgeting
What's inside
- Skill name
context-budgeting- Description
- Deliberately manages the context window to cut token cost and prevent quality decay on long runs. Use when a task is long-running, involves large files or many tool outputs, the context feels full, or cost matters. For finding external info efficiently use progressive-research; for surviving multi-session work use sustained-execution.
- License
- Apache-2.0
- Compatibility
- Any agent runtime with filesystem read and shell access. Enhanced by, but does not require, compaction, sub-agents, or hooks.
- Metadata
- tier: 1 · layer: meta/control · author: Adrian Paredez · version: 1.0
- Instructions
- 80 lines in SKILL.md · view on GitHub
Files (7)
- SKILL.md
- README.md · benchmarks/
- pre-compaction.md · checklists/
- examples.md
- references.md
- budget-state.md · templates/
- digest.md · templates/
SKILL.md (first lines)
# Context budgeting Treat the context window as a finite, *degrading* resource you spend on purpose. Resting cost is small and permanent; active cost is large and compounds. Optimize the active window. ## Use this when - The session is long, or context "feels" more than half full. - You're about to read large files, fetch many pages, or accumulate tool output. - Cost/latency matters, or the model is starting to drift/forget earlier facts. - **Do NOT** micro-optimize short tasks, the discipline costs tokens too. ## The budget (keep this in your working state) ``` window_limit : <model context size> soft_ceiling : ~50-60% -> start offloading payloads to files, keep pointers hard_ceiling : ~75-80% -> compact: write a digest, reinitialize, reload essentials keep_always : goal, success criteria, current plan step, open decisions, pointers offload_first: raw tool output, finished steps, reference dumps, long logs ``` ## Core rules 1. **Pointers, not payloads.** Load IDs, paths, URLs, and line ranges. Fetch the payload only at the moment you act on it. Re-deriving a pointer is cheap; re-holding a payload is expensive. 2. **Peek before you read.** Use `grep`/search and `head`/line-ranges to pull the few lines you need instead of reading whole files into context. 3. **Extract then discard.** When you do read something large, immediately distill the needed facts into a short note and let the source fall out of working memory. 4. **Clear consumed tool output.** Once a command's result is acted on, don't keep re-quoting it. Summarize the outcome in one line. 5. **Offload at the soft ceiling.** Move completed work, raw logs, and reference material to files (a notes/ledger file). Keep only `keep_always` in context. 6. **Compact at the hard ceiling.** Write a high-fidelity digest (see template), then continue from goal + plan-step + digest + pointers. Never compact away `keep_always`. 7. **Protect the reasoning surface.** Optimize the substrate (dumps, logs, finished steps), never the goal, active plan step, open questions, or the verification of the result you're about to ship. ## Workflow ``` - [ ] State the budget ceilings for this model/run. - [ ] Before each large read/fetch: can I peek (grep/head) instead? (rule 2) - [ ] After each large output: extract facts, drop the raw text. (rules 3,4) - [ ] At soft ceiling: offload payloads to a file; keep pointers. (rule 5) - [ ] At hard ceiling: write digest -> reinitialize -> reload core. (rule 6) - [ ] Before compaction of a critical result: run verifying-reasoning. (rule 7) ``` ## Quick decision | Situation | Do | |---|---| | Need info from a 2k-line file | grep for the symbol, read ±20 lines, not the file | | Tool dumped 500 lines of JSON | extract the 3 fields you need, drop the rest | | 10 search results | keep titles+URLs (pointers), open 1-2, discard the rest | | Context ~75% full mid-task | checkpoint digest, reinitialize, reload goal+plan+pointers | | About to summarize a result you'll ship | verify it first, then compact around it | ## Runtime adaptation - **Minimum:** filesystem read + shell. Offload/notes use a plain file. - **If compaction is automatic** (some runtimes): still write your own digest file first so *you* control what survives, not just the summarizer. - **If sub-agents exist:** push wide/noisy exploration into them and keep only conclusions (see `composing-skills`). If not, do the exploration, then aggressively extract+discard. - Never depend on a specific tool name; these rules are about *what* to do, not *which* tool does it. ## Files - `references.md`, the cost model, the 7 techniques, deeper rationale. - `examples.md`, worked before/after token traces. - `templates/digest.md`, the compaction digest format. - `templates/budget-state.md`, the working budget block to copy. - `checklists/pre-compaction.md`, what to preserve before compacting. - `benchmarks/`, how to measure tokens-to-completion and peak context.
From AdrianParedez/capability-fabric, Apache-2.0.
More from AdrianParedez/capability-fabric
- 0.497score
verifying-reasoning
Adrian Paredez
A fast, on-demand check that catches wrong answers before they ship, surface assumptions, seek disconfirming evidence, and validate the result against the…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
authoring-skills
Adrian Paredez
Generates a new, spec-compliant, portable Agent Skill from a capability description, frontmatter, focused body, and the supporting file set, following…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
composing-skills
Adrian Paredez
Routes a task to the smallest set of skills that covers it and sequences them without context bloat, instead of one monolithic instruction.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
auditing-skills
Adrian Paredez
Scores and improves an existing Agent Skill against a spec + quality rubric, then proposes or applies concrete refactors (split monoliths, sharpen…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
guarding-code-quality
Adrian Paredez
Keeps agent-generated code correct, safe, and consistent with the codebase, match existing conventions, verify behavior with a real run/test, and self-review…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
operating-autonomously
Adrian Paredez
Runs a goal unattended with a disciplined progress / stuck / done loop, bounded retry-with-variation, and clear stop and escalation criteria.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
progressive-research
Adrian Paredez
Finds external information without flooding context, a tiered search, triage, extract, corroborate, synthesize loop.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
sustained-execution
Adrian Paredez
Keeps long, multi-session, or compaction-spanning tasks on track using an external task ledger, checkpoints, and resumable state.
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
decomposing-tasks
Adrian Paredez
Turns a goal into a verifiable, risk-ordered plan with explicit success criteria before any work starts.
SkillCFreshness: C★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jun 5, 2026 (4 months ago)
- Last release
- Jun 5, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0
- License
- Apache-2.0
- Website
- paredez.dev
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Adrian Paredez
- 0.497score
verifying-reasoning
Adrian Paredez
A fast, on-demand check that catches wrong answers before they ship, surface assumptions, seek disconfirming evidence, and validate the result against the…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
authoring-skills
Adrian Paredez
Generates a new, spec-compliant, portable Agent Skill from a capability description, frontmatter, focused body, and the supporting file set, following…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
composing-skills
Adrian Paredez
Routes a task to the smallest set of skills that covers it and sequences them without context bloat, instead of one monolithic instruction.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
auditing-skills
Adrian Paredez
Scores and improves an existing Agent Skill against a spec + quality rubric, then proposes or applies concrete refactors (split monoliths, sharpen…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
guarding-code-quality
Adrian Paredez
Keeps agent-generated code correct, safe, and consistent with the codebase, match existing conventions, verify behavior with a real run/test, and self-review…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
operating-autonomously
Adrian Paredez
Runs a goal unattended with a disciplined progress / stuck / done loop, bounded retry-with-variation, and clear stop and escalation criteria.
SkillCFreshness: C★ 1Claude Code +9
Cite this page
context-budgeting skill. Agent Mart. https://agentmart.dev/skills/adrianparedez-context-budgeting (last updated 2026-10-24)