context-compression

Compress extensive conversation histories for AI agents using iterative summarization.

Updated Jun 17, 2025
One-click install
npx skills add https://github.com/jax2730/workcode --skill context-compression-jax2730
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/jax2730/workcode/tree/main/LLM%26Dialog/Agent-Skills-for-Context-Engineering-main/skills/context-compression
Command: npx skills add https://github.com/jax2730/workcode --skill context-compression-jax2730

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the challenge of managing large conversation histories in AI agent sessions, preventing context window limits and optimizing token usage for efficient task completion.

Core Features & Use Cases

  • Context Compression: Implements strategies like anchored iterative summarization and opaque compression to reduce token count.
  • Tokens-Per-Task Optimization: Focuses on minimizing total tokens used per task, not just per request, by preserving critical information.
  • Use Case: For long-running coding sessions that generate millions of tokens, this Skill ensures the agent can maintain context without exceeding limits, allowing it to remember file modifications and previous decisions.

Quick Start

Use the context-compression skill to summarize the conversation history to reduce token usage.

Frequently Asked Questions about context-compression

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

FAQPage Schema
How do I compress LLM context for long-running agent sessions?

To compress LLM context for long-running agent sessions, use anchored iterative summarization and opaque compression techniques. This reduces token count while preserving critical information like file modifications and previous decisions.

What is the best way to manage token limits in AI agents?

The best way to manage token limits in AI agents is optimizing tokens-per-task rather than tokens-per-request. This approach ensures sustained performance by compressing conversation histories while retaining essential context.

Why does my AI agent lose memory of previous decisions in long coding sessions?

Your AI agent loses memory in long coding sessions because extensive conversation histories exceed context window limits. Context compression overcomes this by summarizing history to retain file modifications and decisions.

Can I use context compression to optimize token usage for large language models?

Yes, you can use context compression to optimize token usage for large language models. It implements strategies like anchored iterative summarization to reduce token count and maintain context without exceeding limits.

When do I need context compression for session management?

You need context compression for session management when long-running coding sessions generate millions of tokens. It ensures the agent maintains context and remembers previous decisions without exceeding context window limits.

Does context compression affect an agent's ability to remember file modifications?

Context compression does not negatively affect an agent's ability to remember file modifications. It prioritizes preserving critical information through anchored iterative summarization, ensuring the agent retains necessary context for sustained performance.