context-compression

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

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/whatswithavi/Ecchelon_project --skill context-compression-whatswithavi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/whatswithavi/Ecchelon_project/tree/main/.agent/skills/context-compression
Command: npx skills add https://github.com/whatswithavi/Ecchelon_project --skill context-compression-whatswithavi

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 window limits, 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, token savings targets, and re-fetching costs. - Use Case: A coding agent debugging a 401 authentication error across 178 messages compresses its history into a structured summary preserving the root cause, modified files, and failing tests, then validates the compression by probing whether the agent still knows which files it changed. ## 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 in long-running AI agent sessions?▼

Use anchored iterative summarization: maintain a persistent structured summary with sections for session intent, files modified, decisions, and next steps. When compression triggers, summarize only the newly truncated span and merge it into existing sections rather than regenerating the whole summary.

What is the best context compression method for coding agents?▼

Anchored iterative summarization scores highest at 3.70 overall with 98.6% compression, compared to regenerative (3.44) and opaque (3.35) methods. It preserves accuracy and context awareness best, making it the default choice when file tracking matters.

How do I evaluate whether context compression lost important information?▼

Use probe-based evaluation instead of metrics like ROUGE. After compression, ask typed probes covering recall, artifact tracking, continuation, and decisions, then score responses across six dimensions including accuracy and artifact trail.

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 file operations, so implement a separate artifact index or explicit file-state tracking outside the summarizer.

When should I trigger context compression in an agent session?▼

Default to a sliding window approach keeping the last N turns plus a structured summary, or trigger at 70-80% context utilization. Use task-boundary triggers when sessions have clear phase transitions like research, implementation, and testing.

What should never be compressed in agent conversation history?▼

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.