context-compression

Compress agent conversation history into structured summaries with artifact tracking.

27|5|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/Fandry96/k3-agentic-skills --skill context-compression-fandry96
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/Fandry96/k3-agentic-skills/tree/main/skills/context-compression
Command: npx skills add https://github.com/Fandry96/k3-agentic-skills --skill context-compression-fandry96

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Large agent sessions produce enormous conversation histories, blowing through context windows and increasing latency. This skill provides strategies to compress history while preserving essential intent, decisions, and state.

Core Features & Use Cases

  • Anchored Iterative Summarization: Maintain structured, persistent summaries with explicit sections for session intent, file modifications, decisions, and next steps. When compression triggers, summarize only new content and merge it into the existing structure to avoid losing critical details.
  • Opaque Compression: Generate highly compact representations that maximize token savings at the cost of readability, suitable for long-running sessions with high re-fetch costs.
  • Regenerative Full Summary: Produce detailed, human-readable summaries on each compression cycle to facilitate quick reviews and audits.
  • Artifact Tracking: Capture and track which files were read, modified, or created to preserve an accurate history trail across compressions.
  • Evaluation-Probe Ready: Include mechanisms to test recall, artifact integrity, and continuation capability after compression.

Quick Start

Use the context-compression skill to start structuring a session memory and enable incremental compression when token usage grows.

Frequently Asked Questions about context-compression

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress agent conversation history to fit within context windows?

Compress agent conversation history using anchored iterative summarization, which summarizes new content and merges it into a persistent structure with explicit sections for session intent, file modifications, and decisions to preserve critical details.

What is the best way to preserve file modification history during context compression?

Preserve file modification history during context compression by using artifact tracking, which captures and tracks which files were read, modified, or created to maintain an accurate history trail across multiple compression cycles.

When do I need to summarize long-running agent sessions?

Summarize long-running agent sessions when token usage grows large enough to exceed context windows or increase latency, triggering incremental compression to maintain structured, persistent summaries with explicit sections for decisions and next steps.

Can I generate human-readable summaries after compressing agent context?

Generate human-readable summaries after compressing agent context using regenerative full summary, which produces detailed summaries on each compression cycle to facilitate quick reviews and audits of the session history.

Does context compression work with multi-session workflows?

Context compression works with multi-session workflows by applying structured summaries and incremental merging to preserve critical details across sessions, ensuring state and artifact integrity are maintained when context windows are exceeded.

What are the trade-offs of opaque compression for agent memory?

Opaque compression for agent memory maximizes token savings by generating highly compact representations at the cost of readability, making it suitable for long-running sessions with high re-fetch costs where minimal context footprint is required.