agentleFS
D-SheyD-Shey/autoharness/.agents/skills/context-pruning/SKILL.md

context-pruning

Skill10 starsChanged todayMITView on GitHub

Layered review folding and active context pruning in AutoHarness

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
  1. Distinctive:

    Use when managing context window usage in multi-round agent sessions:

    line 9
  2. Very specific:

    When a critic finding is resolved in a subsequent round, collapse previous round points into a one-line summary: Round N settled: <issue> …

    line 20
  3. Very specific:

    Keep log file references (runs/*.log, answers/*.txt) on disk so any detail remains reversible.

    line 22
  4. Distinctive:

    Keep tool definitions, static instructions, and system configuration at the start of the prompt.

    line 24
  5. Distinctive:

    Place dynamic data (latest diff, latest review) in the suffix so the prefix remains cacheable by model providers.

    line 25
  6. Distinctive:

    Verify that folded reviews maintain accurate references to log files on disk.

    line 28
  7. Distinctive:

    Verify that token consumption remains bounded across multiple rounds.

    line 29

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Tiered context organization:
    • Save full stdout/stderr of runs in .autoharness/tasks/<id>/runs/ and reviews in answers/ (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).
  2. 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.
  3. 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

  1. Verify that folded reviews maintain accurate references to log files on disk.
  2. 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/.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.