context-compression

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

Updated May 18, 2026
One-click install
npx skills add https://github.com/fts-pro/FTS-MMIS-AFRIKA --skill context-compression-fts-pro
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/fts-pro/FTS-MMIS-AFRIKA/tree/main/.agent/skills/context-compression
Command: npx skills add https://github.com/fts-pro/FTS-MMIS-AFRIKA --skill context-compression-fts-pro

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

What is the best context compression method for long coding agent 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 across six dimensions including accuracy and artifact trail using an LLM judge.

When should context compression be triggered in an agent session?▼

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

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 in the agent scaffolding.

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.