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
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
ConversationSummaryBufferMemorysetup and a customProgressiveCompressorclass that summarizes older turns and keeps recent ones verbatim - Shows Anthropic prompt caching with
cache_controlto 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 -yInstalls 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- Opentelemetry658
- Hono Cloudflare651
- Wordpress Security Validation643
- Xlsx607
- Tanstack Query604
- Fastify590
- Api Design Patterns588
- Skill Creator577
- Git Workflow576
- Express Production528
- Golang Grpc525
- Axum517
- Hono Core511
- Zustand506
- Asyncio503
- Typescript Core496
- Bug Fix490
- Mypy487
- Celery484
- Threat Modeling484
- Wordpress Block Editor Fse484
- Supabase Backend Platform482
- Local Llm Ops478
- Web Performance Optimization476
Similar to Session Compression
More Memory & Contextcontext-window-managementSkilldavila7/claude-code-templates590 installsStrategies for managing LLM context windows through summarization, trimming, routing, and avoiding context rot.
context-optimizationSkillmuratcankoylan/agent-skills-for-context-engineering506 installsContext-window budgeting skill covering masking, compaction, KV-cache ordering, and sub-agent partitioning for token efficiency.
billion-contextPluginranxianglei/billion-context8.7K starsContext-compression plugin for Claude Code · month-long single sessions (billions of tokens) · high compression quality even in small context windows (100K is e
context-compressionSkillsickn33/agentic-awesome-skills1.4K installsStructured context compression strategies that keep file trails and decisions intact across long agent sessions.
prompt-cachingSkilldavila7/claude-code-templates440 installsMulti-level LLM caching guide covering prompt prefixes, full responses, and cache-augmented generation patterns.
context-engineeringSkillmrgoonie/claudekit-skills510 installsCurated context engineering playbook for agent systems covering compaction, memory, multi-agent patterns, and evaluation.