context-pruning
Skill10 starsChanged todayMITView on GitHub
Layered review folding and active context pruning in AutoHarness
In this repository44 other files it gives its agents.
- llms-full.txtllms.txt
- llms.txtllms.txt
- ai-prompt-engineering-safety-reviewSkill
- ast-codemapSkill
- ast-grepSkill
- autoharnessSkill
- autonomous-backlog-driverSkill
- claude-kimi-mcp-normalizationSkill
- cli-self-updaterSkill
- code-frugalitySkill
- codemode-gatewaySkill
- codemode-typesSkill
- consequence-simulationSkill
- github-update-checkerSkill
- google-agents-cli-evalSkill
- google-agents-cli-scaffoldSkill
- history-searchSkill
- hook-gatingSkill
- hybrid-semantic-searchSkill
- kimi-code-agent-integrationSkill
- kimi-mcp-configurationSkill
- leann-vectorSkill
- log-summarizerSkill
- markdown-vagueSkill
- memory-reconciliationSkill
- mode-classificationSkill
- multiagent-orchestrationSkill
- output-compressionSkill
- prompt-injectionSkill
- python-anti-patternsSkill
- regression-sentinelSkill
- restart-trackingSkill
- rollback-guardSkill
- rust-call-graphSkill
- secrets-managementSkill
- security-best-practicesSkill
- session-compactorSkill
- sqlite-memorySkill
- swarm-barrierSkill
- swarm-dagSkill
- autoharnessSkill
- code-reliability-checksSkill
- skill-threat-rulesSkill
- autoharnessSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use when managing context window usage in multi-round agent sessions:
- Very specific: line 20
When a critic finding is resolved in a subsequent round, collapse previous round points into a one-line summary: Round N settled: <issue> …
- Very specific: line 22
Keep log file references (runs/*.log, answers/*.txt) on disk so any detail remains reversible.
- Distinctive: line 24
Keep tool definitions, static instructions, and system configuration at the start of the prompt.
- Distinctive: line 25
Place dynamic data (latest diff, latest review) in the suffix so the prefix remains cacheable by model providers.
- Distinctive: line 28
Verify that folded reviews maintain accurate references to log files on disk.
- Distinctive: line 29
Verify that token consumption remains bounded across multiple rounds.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
context-pruning
When to use
Use when managing context window usage in multi-round agent sessions:
- Folding resolved review rounds into compact summaries instead of keeping entire prompt histories in context.
- Organizing session history into tiered LSM layers: Capture (full log on disk), Distill (key verified facts), and Condense (final decisions).
- Keeping prefix prompt caching intact while pruning intermediate noisy steps.
Steps
- Tiered context organization:
- Save full stdout/stderr of runs in
.autoharness/tasks/<id>/runs/and reviews inanswers/(Capture tier). - In active conversation memory, maintain only the latest diff and the current round's checklist (Distill tier).
- Citing methodology: Active Context Pruning (https://github.com/ranxianglei/billion-context).
- Save full stdout/stderr of runs in
- Review round folding:
- When a critic finding is resolved in a subsequent round, collapse previous round points into a one-line summary:
Round N settled: <issue> resolved, verified by run #M. - Keep log file references (
runs/*.log,answers/*.txt) on disk so any detail remains reversible.
- When a critic finding is resolved in a subsequent round, collapse previous round points into a one-line summary:
- Prefix caching preservation:
- Keep tool definitions, static instructions, and system configuration at the start of the prompt.
- Place dynamic data (latest diff, latest review) in the suffix so the prefix remains cacheable by model providers.
How to verify
- Verify that folded reviews maintain accurate references to log files on disk.
- Verify that token consumption remains bounded across multiple rounds.
Facts found here
- AutoHarness stores task state in
.autoharness/tasks/<id>/. - Reviews are signed with one-time ANSWER-IDs in
answers/.
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.

