context-compression

Compress long agent conversation histories using structured summarization and probe-based quality evaluation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Long-running AI agent sessions exceed context window limits, and naive compression loses critical details like file paths, error messages, and decision rationale, forcing agents to re-fetch information and waste tokens. ## 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 Quality 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). - Compression Method Selection: Choose between anchored iterative, opaque, and regenerative summarization based on session length, file-tracking needs, and interpretability requirements. - Use Case: A coding agent debugging a 401 authentication error over 178 messages hits the context limit. Use this Skill to compress the history into a structured summary preserving the root cause, modified files, and remaining test failures, then verify quality with probes before discarding the original history. ## Quick Start Ask the agent to compress the current conversation history into a structured summary and evaluate whether critical file and decision details survived compression.

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?▼

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, which prevents cumulative detail loss across compression cycles.

How do I evaluate context compression quality?▼

Use probe-based evaluation: after compression, ask questions testing recall, artifact tracking, continuation, and decision retention. Score responses across six dimensions including accuracy and artifact trail, since metrics like ROUGE miss functional information loss.

What is the difference between anchored iterative and opaque compression?▼

Anchored iterative summarization maintains interpretable structured summaries scoring 3.70 quality at 98.6% compression, while opaque compression achieves 99.3% ratios but sacrifices interpretability and scores 3.35. Use opaque only for short sessions with low re-fetching costs.

When should I trigger context compression 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 best 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 destroys the agent's ability to invoke tools. Also protect early session turns containing task constraints and preserve code blocks and identifiers verbatim.