context-compression

Implement structured summarization and probe-based evaluation for compressing long agent conversation histories.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/NT-boop-star/BRMV-tract --skill context-compression-nt-boop-star
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/NT-boop-star/BRMV-tract/tree/main/antigravity/skills/context-compression
Command: npx skills add https://github.com/NT-boop-star/BRMV-tract --skill context-compression-nt-boop-star

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Long-running agent sessions generate millions of tokens of conversation history that exceed context windows, and naive compression loses critical details like file paths, error messages, and decision rationale, forcing costly re-exploration. ## Core Features & Use Cases - Anchored Iterative Summarization: Maintain persistent structured summaries with explicit sections for session intent, file modifications, decisions, and next steps, merging new spans incrementally instead of regenerating from scratch. - Probe-Based Evaluation: Generate recall, artifact, continuation, and decision probes from conversation history, then score responses across six dimensions (accuracy, context awareness, artifact trail, completeness, continuity, instruction following) using an LLM judge rubric. - Compression Method Selection: Choose between anchored iterative, opaque, and regenerative summarization based on session length, file-tracking needs, and re-fetching costs, with benchmark data comparing compression ratios and quality scores. - Use Case: A coding agent debugging a 401 error across 178 messages hits the context limit; the skill compresses history into a structured summary preserving the root cause, modified files, and failing tests, then validates quality with probes before discarding the original history. ## Quick Start Ask the agent to compress the current conversation history into a structured summary with sections for session intent, files modified, decisions, and next steps.

Frequently Asked Questions about context-compression

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress conversation history without losing file tracking information?

Use anchored iterative summarization with explicit sections for files modified, files read, and decisions made. Summarize only newly truncated spans and merge them into the existing summary rather than regenerating, and track artifact trails separately since general summarization scores only 2.2-2.5 out of 5 on file tracking.

What is the best context compression method for long coding sessions?

Anchored iterative summarization scores highest (3.70 overall) for long sessions where file tracking matters, achieving 98.6% compression. Opaque compression reaches 99.3% but sacrifices interpretability, while regenerative summaries suit sessions with clear phase boundaries.

How do I evaluate whether compression preserved important information?

Use probe-based evaluation instead of metrics like ROUGE. Generate recall, artifact, continuation, and decision probes from the original history, then score model responses against a six-dimension rubric covering accuracy, context awareness, artifact trail, completeness, continuity, and instruction following.

When should compression be triggered in an agent session?

Trigger at 70-80% context utilization for fixed thresholds, or use a sliding window keeping the last N turns plus a summary for predictable context size. Task-boundary triggers work when sessions have clear phase transitions like research, implementation, and testing.

Why does my agent forget which files it modified after compression?

General summarization cannot reliably maintain artifact trails because file paths and identifiers get paraphrased or dropped. Preserve identifiers verbatim in dedicated summary sections and implement a separate artifact index in the agent scaffolding rather than relying on the summarizer.

What should never be compressed in agent context?

Never compress tool definitions, function call schemas, or API specs, since summarizing parameter names or types destroys the agent's ability to invoke tools. Also protect early turns containing task constraints and preserve code blocks verbatim, since code does not tolerate token-level loss like prose does.