context-compression

Compress long conversation histories to optimize token usage while preserving critical context.

Updated Jan 9, 2026
One-click install
npx skills add https://github.com/samvanme/SBSitev0 --skill context-compression-samvanme
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/samvanme/SBSitev0/tree/main/claudeskills/Agent-Skills-for-Context-Engineering-main/skills/context-compression
Command: npx skills add https://github.com/samvanme/SBSitev0 --skill context-compression-samvanme

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill helps AI agents manage long-running conversations by compressing prior context while preserving essential information.

Core Features & Use Cases

  • Anchored iterative summarization: maintains structured session state across compressions.
  • Probes for evaluation: recall, artifact tracking, continuation, and decision probes to ensure information integrity.
  • Reference integration: works with a lightweight evaluation framework and references for reproducibility.

Use Case: When an agent has thousands of tokens of history, apply context compression to retain goals, key decisions, and modified artifacts while trimming verbose context.

Quick Start

Provide the original conversation history and a compressed context to the agent. Then prompt it with recall, artifact, and decision probes to validate preserved information.

Frequently Asked Questions about context-compression

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

FAQPage Schema
How do I compress conversation history to optimize token usage in long-running agent sessions?

Compress conversation history by applying anchored iterative summarization to retain goals, key decisions, and modified artifacts while trimming verbose context. This reduces token usage while preserving essential information for long-running agent sessions.

What is the best way to preserve modified artifacts during LLM context compression?

Preserve modified artifacts during context compression by using structured artifact tracking. The session state is sectioned into intent, files, decisions, and next steps to maintain artifact integrity across compressions.

How do I validate information integrity after summarizing a long debugging workflow?

Validate information integrity after summarizing by prompting the agent with recall, artifact, continuation, and decision probes. These evaluation probes check the compressed context against the original history to ensure critical details remain intact.

Does this context compression approach work for multi-file project discussions?

Yes, context compression works for multi-file project discussions. It applies structured session state management to track modified files and decisions, preventing performance degradation when history growth threatens the session.

When do I need to apply context compression in LLM evaluation workflows?

Apply context compression in LLM evaluation workflows when a session accumulates thousands of tokens of history. It trims verbose context while retaining structured state for reproducibility and continued evaluation.