context-compression

Compress large AI conversation histories and codebase contexts using summarization strategies.

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

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 task completion.

Core Features & Use Cases

  • Context Compression Strategies: Implements various methods like Anchored 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, to avoid costly re-fetching.
  • 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 context to keep the agent focused and efficient, preventing it from "forgetting" previous actions or file modifications.

Quick Start

Use the context-compression skill to summarize the last 5000 tokens of the current conversation.

Frequently Asked Questions about context-compression

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

FAQPage Schema
How do I compress large AI conversation histories to prevent context loss?

You can compress large AI conversation histories using Anchored Iterative Summarization and Opaque Compression strategies. These methods reduce token usage to prevent information loss and maintain agent efficiency when working with long-running sessions that exceed context window limits.

What is context compression for LLM efficiency and when do I need it?

Context compression for LLM efficiency reduces conversation and codebase size to fit within AI context windows. You need it when conversation histories grow to millions of tokens, causing the AI agent to forget previous actions or file modifications during long-running complex tasks.

What's the best way to optimize tokens-per-task for large codebase agents?

Optimize tokens-per-task for large codebase agents by implementing structured summarization and probe-based evaluation for quality assurance. This approach minimizes total tokens consumed per task rather than per request, preventing costly re-fetching when the agent processes large codebases.

Can I summarize the last 5000 tokens of a conversation to reduce context window usage?

Yes, you can summarize the last 5000 tokens of a conversation to reduce context window usage. Using structured summarization strategies compresses recent history, ensuring the agent retains critical information without exceeding context window limits while maintaining task efficiency.

Does context compression work without losing previous file modifications in long-running sessions?

Context compression preserves previous file modifications in long-running sessions by using Anchored Iterative Summarization to retain key actions. Probe-based evaluation provides quality assurance, preventing information loss when managing large conversation histories and codebases.

Why does my AI agent forget previous actions when processing a large codebase?

Your AI agent forgets previous actions because large codebase conversation histories exceed context window limits, causing information loss. Implementing context compression strategies reduces token usage, keeping the agent focused and preventing it from losing track of file modifications.