context-compression

Compresses agent session history while preserving decisions, artifacts, and continuation plans via anchored, opaque, regenerative methods with probe-based validation.

1|Updated May 16, 2026
One-click install
npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill context-compression-enigmaicon-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/enigmaicon-eng/AI-Enterprise-OS/tree/main/examples/agent-skills/skills/context-compression
Command: npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill context-compression-enigmaicon-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill solves the problem of losing essential task state and artifacts when conversations or code exploration exceed model context limits, leading to re-reading, forgotten decisions, and failed continuation.

Core Features & Use Cases

  • Tokens-per-task optimization: Prioritizes total task cost (including re-fetching) over per-request token savings.
  • Anchored iterative summarization: Maintains a structured, mergeable summary that reduces drift across repeated compression cycles.
  • Opaque vs regenerative strategies: Selects between maximum compression (opaque) and human-interpretable phase summaries (regenerative) based on session needs.
  • Artifact-trail preservation: Explicitly tracks file paths, modified/read files, and key identifiers (e.g., function names, error messages) to prevent “what changed?” failure modes.
  • Probe-based evaluation guidance: Recommends validating compression quality with targeted recall/artifact/continuation/decision probes rather than relying on surface similarity metrics.

Quick Start

Use the context-compression skill when your agent session approaches context limits and you need to compress history without breaking artifact tracking or next-step continuity.

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 context without losing track of modified files and decisions?

Context compression preserves critical state during long-running AI agent sessions by applying anchored summarization and artifact-trail tracking. It explicitly maintains structured sections for file paths, decisions, and continuation plans while trimming tokens to prevent forgotten changes.

What is the best way to manage token limits during long-running debugging sessions?

Token budgeting for debugging continuity requires selecting a compression method like anchored, opaque, or regenerative summarization. This approach prioritizes total task cost over per-request savings, ensuring debugging state persists across truncated session histories without re-reading code.

How does anchored summarization differ from regenerative context compression?

Anchored summarization maintains a mergeable structured summary to reduce drift across repeated compression cycles, while regenerative context compression creates human-interpretable phase summaries. Opaque compression achieves maximum token reduction by sacrificing human readability for session needs.

When do I need probe-based evaluation for context compression?

Probe-based evaluation is needed to validate context compression quality when session history is truncated. It uses targeted recall, artifact, continuation, and decision probes to minimize hallucinated omissions and re-fetching, rather than relying on surface similarity metrics.

Can I use context compression for migration and evaluation workflows?

Context compression applies to coding, debugging, migration, and evaluation workflows where session history must be truncated. It preserves essential task state and artifacts, preventing the failure mode of losing track of key identifiers like function names and error messages during these processes.

Why does my AI agent forget previous decisions after context truncation?

Agents forget decisions after context truncation because standard summarization loses essential task state. Applying artifact-trail preservation with incremental merging explicitly tracks key identifiers and decisions, preventing failed continuation and the need to re-read modified files.