context-compression

Compress conversational and code context using anchored iterative summarization.

3|Updated Dec 23, 2025
One-click install
npx skills add https://github.com/boazcstrike/opencode --skill context-compression-boazcstrike
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/boazcstrike/opencode/tree/main/skills/context-compression
Command: npx skills add https://github.com/boazcstrike/opencode --skill context-compression-boazcstrike

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 anchored iterative summarization and opaque compression to reduce token usage.
  • Tokens-Per-Task Optimization: Focuses on minimizing total tokens consumed for task completion, not just per request.
  • Artifact Trail Integrity: Aims to preserve critical information like file paths and changes, even under heavy compression.
  • Use Case: When an AI agent has been working on a complex coding task for hours, its conversation history can become enormous. This Skill compresses that history so the AI can continue working effectively without forgetting previous steps or file modifications.

Quick Start

Use the context-compression skill to summarize the current 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 reduce token usage when a long-running AI agent exceeds context window limits?

You can reduce token usage for long-running AI agents by applying context compression strategies like anchored iterative summarization. This minimizes total tokens consumed per task while preventing information loss in large conversation histories.

What is anchored iterative summarization for context compression?

Anchored iterative summarization is a context compression technique that reduces large conversation histories. It preserves artifact trail integrity, ensuring critical details like file paths and modifications are maintained even under heavy compression.

How do I preserve file paths and changes when compressing code context for AI agents?

To preserve file paths and changes during code context compression, the system focuses on artifact trail integrity. It ensures that critical information remains intact and accessible to the AI agent even after applying heavy compression strategies.

Does context compression work for complex coding tasks that span several hours?

Yes, context compression is designed for complex, long-running coding tasks. It compresses enormous conversation histories so the AI agent can continue working effectively without forgetting previous steps or file modifications.

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

The best way to optimize tokens-per-task is to implement context compression strategies that minimize total tokens consumed for task completion. This approach ensures efficient agent performance throughout long-running sessions without exceeding context limits.

When should I use probe-based evaluation for AI context compression?

Probe-based evaluation should be used during AI context compression to evaluate the effectiveness of the summarization. It helps ensure that the compressed context retains the necessary information for the agent to continue task execution accurately.