context-budget
Skill0 starsChanged 3 months agoApache-2.0View on GitHub
Plans and enforces the context window as a budget: what an agent loads, what it keeps, what it writes down, and when it hands over. Use for long agent sessions, large repositories, repeated codebase re-reading, token cost complaints, multi-session work, project memory files, and handover before context overflow.
54 other projects use a version of this.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- cveralyon/axel-setuptheir own version, first seen Nov 8, 2026
- ahmadvahidi/skill-atlastheir own version, first seen Nov 8, 2026
- zedarvates/frugal-skillstheir own version, first seen Nov 8, 2026
- pankaj-mahaur/Agent-Daemontheir own version, first seen Nov 6, 2026
- coco-research/cocotheir own version, first seen Nov 1, 2026
Used with
Projects with it also use agent-payment-x402, openclaw-persona-forge and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
TironFoxSkillagent-payment-x402
Add x402 payment execution to AI agents — per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents need to pay for APIs, services, or other agents.
Also in 6 projects that use this
TironFoxSkillopenclaw-persona-forge
为 OpenClaw AI Agent 锻造完整的龙虾灵魂方案。根据用户偏好或随机抽卡, 输出身份定位、灵魂描述(SOUL.md)、角色化底线规则、名字和头像生图提示词。 如当前环境提供已审核的生图 skill,可自动生成统一风格头像图片。 当用户需要创建、设计或定制 OpenClaw 龙虾灵魂时使用。 不适用于:微调已有 SOUL.md、非 OpenClaw 平台的角色设计、纯工具型无性格 Agent。 触发词:龙虾灵魂、虾魂、OpenClaw 灵魂、养虾灵魂、龙虾角色、龙虾定位、 龙虾剧本杀角色、龙虾游戏角色、龙虾 NPC、龙虾性格、龙虾背景故事、 lobster soul、lobster character、抽卡、随机龙虾、龙虾 SOUL、gacha。
Also in 5 projects that use this
loulanyueSkillnuxt4-patterns
Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.
Also in 9 projects that use this
renepfSkillorch-pipeline
Shared orchestration engine for the orch-* skill family. Defines the gated Research-Plan-TDD-Review-Commit pipeline, the size classifier, the agent map, and the two human gates that the orch-* operation skills delegate to. Not usually invoked directly.
Also in 4 projects that use this
Exploration-labsSkilltoken-budget-advisor
Proactive token budget assessment and task chunking strategy. Use this skill when queries involve multiple large file uploads, requests for comprehensive multi-document analysis, complex multi-step workflows with heavy research (10+ tool calls), phrases like "complete analysis", "full audit", "thorough review", "deep dive", or tasks combining extensive research with large output artifacts. This skill helps assess token consumption risk early and recommend chunking strategies before beginning work.
Also in 11 projects that use this
loulanyueSkillsanta-method
Multi-agent adversarial verification with convergence loop. Two independent review agents must both pass before output ships.
Also in 8 projects that use this
Other versions54 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 54
- misskey-dev/misskey★ 11ksame name
- poshan0126/dotclaude★ 871same name
- coco-research/coco★ 797same name
- OneWave-AI/claude-skills★ 378same name
- loulanyue/awesome-claude-notes★ 272same name
- Fmarzochi/EGC★ 61same name
- felvieira/claude-skills-fv★ 27same name
- Fadi88/one-man-startup★ 16same name
- tellmefrankie/ai-investment-skills★ 14same name
- woxiangyangzhimao/skills★ 14same name
44 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- academixSkill
- agent-browserSkill
- ai-engineering-platformSkill
- apocalypseSkill
- aria-apg-reviewSkill
- crawler-readiness-auditSkill
- data-protection-gateSkill
- decision-criticality-gateSkill
- fact-checkerSkill
- find-skillsSkill
- focus-friendly-outputSkill
- frontend-designSkill
- grill-meSkill
- grill-with-docsSkill
- humanizerSkill
- improve-codebase-architectureSkill
- microsoft-foundrySkill
- output-templatesSkill
- pre-launch-security-gateSkill
- prompt-preflightSkill
- quick-recapSkill
- rag-retrieval-qualitySkill
- rest-api-best-practicesSkill
- rigorous-responseSkill
- security-checklistSkill
- shepherdSkill
- skill-optimizerSkill
- sql-query-correctnessSkill
- system-design-scaleSkill
- tddSkill
- ui-ux-color-contrastSkill
- ui-ux-component-qualitySkill
- ui-ux-design-systemsSkill
- ui-ux-dropdownsSkill
- ui-ux-form-validationSkill
- ui-ux-generationSkill
- ui-ux-loading-statesSkill
- ui-ux-mobile-cssSkill
- ui-ux-typographySkill
- ux-logic-loopSkill
- ux-pattern-reviewSkill
- vercel-react-best-practicesSkill
- visual-flow-storyboardSkill
- visual-pr-reviewSkill
- web-design-guidelinesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 16 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 50 edited versions we read keep these.
16
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 54
Treat the context window as a finite budget with an explicit allocation, not as a place where files accumulate until quality collapses.
- Distinctive: line 61
Re-reading: Every new session rediscovers the same repository facts.
- Distinctive: line 94
Before loading anything, record:
- Distinctive: line 109
Never let the working set grow past the files actually being changed.
- Distinctive: line 125
Search before reading. Read ranges before reading files.
- Distinctive: line 126
Never re-read a file already in context unless it changed.
- Distinctive: line 128
Prefer structured extraction (one pass producing a table) over many small reads.
- Distinctive: line 132
Write repository facts once into a durable file that every session loads.
- Distinctive: line 137
Not derivable from a single cheap command
- Distinctive: line 158
When the repository exceeds what any session can hold:
- Distinctive: line 165
Verify the index instead of trusting it: a stale index is worse than none, because it produces confident wrong file paths.
- Distinctive: line 195
Never hand over a summary that drops a decision.
- Distinctive: line 213
Before claiming a context plan works, verify:
- Distinctive: line 216
Every claim in project memory is checked against the current repository
- Distinctive: line 218
No dropped evidence contained an unrecorded decision
- Distinctive: line 220
Never claim a file was loaded, indexed, or verified when it was not.
“Common” is measured: kept by at least 6 in 10 of the 50 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Context Budget
Purpose
Treat the context window as a finite budget with an explicit allocation, not as a place where files accumulate until quality collapses.
For checkpoint/rollback safety around irreversible actions during a session, also see shepherd.
Three failure modes this skill prevents:
- Re-reading. Every new session rediscovers the same repository facts.
- Silent overflow. The session degrades or truncates mid-task and loses decisions.
- Undocumented state. Work cannot continue because the reasoning lived only in chat.
Core Principle
Load the smallest set of facts that makes the next action correct.
Write down anything a successor would otherwise have to rediscover.
Hand over before the window forces the decision.Compression is not the goal. Retrievability is.
Activation Triggers
Apply this skill when:
- A session spans more than a few tasks or is expected to resume later
- The repository is too large to read exhaustively
- The same files are read repeatedly across sessions
- Token cost, latency, or answer quality is degrading
- Work must be handed to another agent, another session, or a human
- A project memory,
AGENTS.md, or equivalent context file is being written
Workflow
Phase 1: Inventory the Budget
Before loading anything, record:
| Slot | Content | Rough size | Refreshable? |
| Instructions | System prompt, skills, rules | fixed | no |
| Project memory | Durable repo facts | small | yes |
| Task state | Current goal, decisions, open questions | small | yes |
| Working set | Files being edited | medium | yes |
| Evidence | Command output, search results | volatile | yes |
Rules:
- Instructions and project memory must stay small enough to survive every turn.
- Evidence is the first thing discarded, so it must be summarized into task state before it is dropped.
- Never let the working set grow past the files actually being changed.
Phase 2: Define the Load Policy
For each information need, choose the cheapest sufficient source:
| Need | Preferred source | Avoid |
| Where does X live | Symbol or path search | Reading directories |
| What does X do | Signature plus call sites | Whole-file read |
| How is X used | Grep for usages, bounded output | Recursive reads |
| Why is X this way | Decision record, commit message | Guessing from code |
| Full detail | Read only the relevant range | Read entire file |
Required behavior:
- Search before reading. Read ranges before reading files. Read files before reading trees.
- Never re-read a file already in context unless it changed.
- Cap command output; quote the shortest decisive lines.
- Prefer structured extraction (one pass producing a table) over many small reads.
Phase 3: Build Durable Project Memory
Write repository facts once into a durable file that every session loads.
A project memory entry earns its place only if it is:
- Stable across sessions
- Not derivable from a single cheap command
- Load-bearing for future decisions
Include:
- Entry points, build, test, and lint commands
- Directory map with one line per meaningful area
- Non-obvious conventions and their reason
- Architectural decisions and rejected alternatives
- Known traps: flaky tests, generated files, forbidden edits
Exclude:
- Anything the code, README, or git history already states plainly
- Facts that expire quickly (branch names, in-flight work)
- Long code excerpts
Convert relative dates to absolute dates before writing.
Phase 4: Retrieval Routing
When the repository exceeds what any session can hold:
- Maintain an index keyed by symbol, path, and concept.
- Route each question to the smallest index slice that answers it.
- Return locations plus evidence lines, not whole files.
- Refresh index entries when the underlying file changes, not on a timer.
Verify the index instead of trusting it: a stale index is worse than none, because it produces confident wrong file paths. Confirm any location before editing it.
Phase 5: Handover Before Overflow
Trigger a handover when any of the following is true:
- The window is roughly two thirds consumed
- Evidence is being dropped faster than it is summarized
- The task will clearly not finish in the current session
A handover package contains, in this order:
## Goal
One sentence: what done looks like.
## State
What now works, verified how.
## Decisions
Each decision, its reason, and the rejected alternative.
## Open questions
Each question and who or what can answer it.
## Next action
One concrete step, with the exact file or command.Never hand over a summary that drops a decision. A decision without its reason will be re-litigated and reversed.
Anti-Patterns
- Loading the whole repository "for context" before knowing the task
- Summarizing chat history instead of recording decisions
- Memory files that restate the README
- Index built once and never invalidated
- Treating a truncated session as a finished one
- Optimizing token count while increasing the number of round trips
Verification
Before claiming a context plan works, verify:
- A fresh session can reach the first correct action using only the durable files
- Every claim in project memory is checked against the current repository
- The handover note names one next action, not a list of intentions
- No dropped evidence contained an unrecorded decision
Never claim a file was loaded, indexed, or verified when it was not.
Required Final Output
## Context Budget Result
Status: PLANNED | APPLIED | HANDOVER
### Budget allocation
- ...
### Load policy changes
- ...
### Durable memory written
- ...
### Dropped or deferred
- ...
### Next action
- ...Shared output profile
Compose the plan profile from output-templates.
Lead with the allocation and the load policy, then durable memory, dropped context, and the next action.
Preserve stricter domain rules above, omit empty components, and never fill a component with invented evidence.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

