context-compression

Compress long-running AI agent session context with anchored iterative summarization.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/goodnight000/KittyCourt --skill context-compression-goodnight000
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/goodnight000/KittyCourt/tree/main/.codex/skills/Agent-Skills-for-Context-Engineering-main/skills/context-compression
Command: npx skills add https://github.com/goodnight000/KittyCourt --skill context-compression-goodnight000

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Long-running AI agent sessions accumulate vast conversation histories that exhaust context windows. This Skill provides structured context compression to maintain essential signals while dramatically reducing token usage.

Core Features & Use Cases

  • Anchored Iterative Summarization: Persistently summarize new content and merge with existing session state to prevent information loss.
  • Flexible Compression Strategies: Support anchored, regenerative, and opaque approaches to balance fidelity and efficiency.
  • Artifact & Decision Tracking: Preserve file changes, decisions, and next steps across compression cycles for reliable continuation.

Quick Start

Activate the context-compression skill in a long-running session by enabling anchored iterative summaries. When the history approaches the context limit, generate a targeted, sectioned summary that preserves intent, changes, decisions, and next steps, then merge it with prior summaries for seamless continuation.

Frequently Asked Questions about context-compression

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

FAQPage Schema
How do I reduce token usage in long-running LLM agent sessions without losing context?

Apply structured context compression to persistently summarize conversation history, merging new content with existing session state to preserve critical signals like file modifications and decisions while reducing memory pressure.

What is anchored iterative summarization for AI agents?

Anchored iterative summarization is a context compression strategy that persistently summarizes new conversation content and merges it with prior summaries, ensuring essential intent, changes, and next steps survive across compression cycles.

How do I preserve file modifications and decisions when compressing conversation history?

Use a compression skill with structured artifact tracking to maintain file changes, decisions, and next steps across compression cycles, ensuring reliable continuation of long-running agent tasks within limited context windows.

When should I use regenerative versus opaque context compression strategies?

Use regenerative or opaque compression strategies to balance fidelity and efficiency depending on session needs; anchored approaches prevent information loss by persistently merging new summaries with existing session state.

Does context compression work for AI agent sessions with millions of tokens?

Yes, structured context compression specifically targets millions of tokens of accumulated conversation history in long-running AI agent sessions, maintaining critical signals within limited context windows through probe-based evaluation.

How do I evaluate context compression fidelity for LLM debugging sessions?

Use probe-based evaluation to assess compression fidelity, verifying that anchored iterative summaries preserve critical signals such as file modifications, decisions, and next steps across compression cycles without information loss.