Skip to content
Back to skills

Context Pruning

ASecurity

Layered review folding and active context pruning in AutoHarness

  • 10 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
ai-agentsgit

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add D-Shey/autoharness --skill context-pruning --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Context Pruning?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Context Pruning
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/d-shey-context-pruning/badge)](https://www.skillsdirectory.com/skills/d-shey-context-pruning)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: context-pruning
description: Layered review folding and active context pruning in AutoHarness
---

# 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/`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.