context-compression

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

Updated Apr 17, 2026
One-click install
npx skills add https://github.com/Syedyasir001/RVULibPass --skill context-compression-syedyasir001
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/Syedyasir001/RVULibPass/tree/main/.agent/skills/library/context-compression
Command: npx skills add https://github.com/Syedyasir001/RVULibPass --skill context-compression-syedyasir001

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 content incrementally instead of regenerating from scratch. - Probe-Based Evaluation: Test compression quality with recall, artifact, continuation, and decision probes scored across six dimensions including accuracy and artifact trail. - Compression Method Selection: Choose between anchored iterative, opaque, and regenerative approaches based on session length, interpretability needs, and re-fetching costs. - 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 so work continues without re-reading files. ## 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. Summarize only newly truncated content and merge it into existing sections rather than regenerating the full summary, which prevents cumulative detail loss across compression cycles.

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. Opaque compression achieves the best ratio (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. After compression, ask recall, artifact, continuation, and decision questions, then score responses across six dimensions including accuracy and artifact trail using an LLM judge.

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. Task-boundary triggers work when sessions have clear phase transitions like research then implementation.

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

Artifact trail is the weakest dimension across all compression methods, scoring only 2.2-2.5 out of 5. General summarization cannot reliably track files, so implement a separate artifact index or explicit file-state tracking outside 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 breaks the agent's ability to invoke tools. Also protect early turns containing task constraints and preserve code blocks and identifiers verbatim.