context-compression

Compress long agent conversations into structured summaries preserving decisions and files.

Updated Feb 3, 2026
One-click install
npx skills add https://github.com/jaaaackieLai/deep-learning-claude-code --skill context-compression-jaaaackielai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/jaaaackieLai/deep-learning-claude-code/tree/main/skills/context-engineering/context-compression
Command: npx skills add https://github.com/jaaaackieLai/deep-learning-claude-code --skill context-compression-jaaaackielai

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Compress lengthy agent conversations to reduce token usage while preserving essential context.

Core Features & Use Cases

  • Anchored iterative summarization to maintain persistent session state and file-level context.
  • Structured summaries that preserve decisions, files, and next steps across compressions.
  • Evaluation hooks to measure token savings vs. information loss and guide compression strategy.

Quick Start

Run an evaluation cycle by compressing a long conversation and review the anchored summary output to verify critical files, decisions, and next steps are preserved.

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 context to save tokens?

To compress agent context and save tokens, apply anchored iterative summarization to reduce lengthy conversations while preserving essential state. This technique maintains persistent session context and file-level details to prevent information loss during compression.

What is anchored iterative summarization for long-running sessions?

Anchored iterative summarization is a state-management technique that compresses long-running agent conversations into structured summaries. It preserves critical files, decisions, and next steps across multiple compression cycles to maintain persistent session state without losing key artifacts.

How do I preserve decisions and files when summarizing code-debugging chats?

To preserve decisions and files when summarizing code-debugging chats, generate structured summaries that explicitly retain artifacts, decisions, and next steps. This ensures critical debugging context survives the compression of lengthy conversation logs without losing key state.

How do I measure token savings versus information loss in context compression?

To measure token savings versus information loss in context compression, use evaluation hooks to compare compressed structured summaries against original conversations. This validates whether critical decisions and files survive the summarization process effectively.

When should I use context compression for agent sessions?

Use context compression for agent sessions when lengthy conversations approach context window limits and require efficient summarization. It is particularly applicable to long-running sessions and code-debugging chats where preserving state is critical for continued operation.

What is the best way to maintain persistent state across conversation compressions?

The best way to maintain persistent state across conversation compressions is using structured summaries with anchored iterative summarization. This approach ensures file-level context, decisions, and next steps survive each compression cycle without degradation.