context-compression

Compress AI conversation histories and codebases to reduce token usage.

5|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/lidge-jun/cli-jaw-skills --skill context-compression-lidge-jun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/lidge-jun/cli-jaw-skills/tree/main/context-compression
Command: npx skills add https://github.com/lidge-jun/cli-jaw-skills --skill context-compression-lidge-jun

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 and codebases that exceed AI context window limits, preventing information loss and ensuring efficient agent performance.

Core Features & Use Cases

  • Context Compression: Implements strategies like iterative summarization and opaque compression to reduce token usage.
  • Tokens-Per-Task Optimization: Focuses on minimizing total tokens consumed per task, not just per request, by preserving critical information.
  • Use Case: When an AI agent is working on a large codebase and its conversation history grows to millions of tokens, this skill can compress the history to keep the agent focused and prevent it from "forgetting" previous actions or 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 AI conversation history to reduce token count?

Compress AI conversation history by applying anchored iterative summarization and opaque compression strategies. This reduces token usage while preserving critical information, preventing large context windows from degrading agent performance.

What is the best way to optimize tokens-per-task for long-running agent sessions?

Optimize tokens-per-task by compressing conversation histories and large codebases with iterative summarization. This approach minimizes total tokens consumed per task while keeping the AI agent focused on previous actions and decisions.

When do I need context compression for large codebases?

You need context compression when an AI agent's conversation history grows to millions of tokens and risks exceeding context window limits. It prevents information loss and ensures efficient agent performance during large-scale code analysis.

How does iterative summarization work for LLM context management?

Iterative summarization works by progressively summarizing conversation histories to reduce token usage. It anchors critical information during compression, allowing large context windows to remain focused without forgetting previous actions.

Does context compression work for large-scale code analysis?

Yes, context compression works for large-scale code analysis by reducing the token count of large codebases. It employs opaque compression and summarization strategies to keep agents focused when handling millions of tokens.

What are the limitations of opaque compression for AI agent efficiency?

Opaque compression limitations involve potential trade-offs between aggressive token reduction and retaining nuanced context. While it optimizes tokens-per-task, relying solely on it may risk losing subtle details from complex conversation histories.