Skip to content
bobmatnyc avatar

Session Compression

Compression techniques for long multi-turn AI conversations, from progressive summarization to prompt caching.

CCM score
47 of 100
skills.sh installs
672
GitHub stars
79
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers context-window limits, compression ratios, and progressive thresholds that trigger light, medium, or aggressive compression as usage grows
  • Includes a LangChain ConversationSummaryBufferMemory setup and a custom ProgressiveCompressor class that summarizes older turns and keeps recent ones verbatim
  • Shows Anthropic prompt caching with cache_control to reduce repeated context costs on stable conversation history
  • Designed for chatbots, code assistants, and support sessions that exceed about 50% of the context window

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill session-compression -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

AI Session Compression Techniques

Summary

Compress long AI conversations to fit context windows while preserving critical information.

Session compression enables production AI applications to manage multi-turn conversations efficiently by reducing token usage by 70-95% through summarization, embedding-based retrieval, and intelligent context management. Achieve 3-20x compression ratios with minimal performance degradation.

Key Benefits:

  • Cost Reduction: 80-90% token cost savings through hierarchical memory
  • Performance: 2x faster responses with compressed context
  • Scalability: Handle conversations exceeding 1M tokens
  • Quality: Preserve critical information with <2% accuracy loss

When to Use

Use session compression when:

  • Multi-turn conversations approach context window limits (>50% capacity)
  • Long-running chat sessions (customer support, tutoring, code assistants)
  • Token costs become significant (high-volume applications)
  • Response latency increases due to large context
  • Managing conversation history across multiple sessions

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Categories
Memory & Context, AI Agents & LLM Apps
First seen
Jun 3, 2026

More from bobmatnyc/claude-mpm-skills

All 154

Similar to Session Compression

More Memory & Context