When AI agents have long conversations, they can use up millions of words of memory. Compression helps keep the conversation short so the agent can still work well. But simple compression can lose important details.
The real goal is tokens per task not tokens per request. Losing a file path or error message makes the agent waste time re-fetching information. Smart methods like structured summaries save space while keeping key facts.
This skill explains three ways to compress: anchored iterative summarization, opaque compression, and regenerative full summary. Each one balances saving memory against losing details.
Global
mkdir -p ~/.claude/skills/context-compressionProject
mkdir -p .claude/skills/context-compressionSource Repository
Find Skillsvercel-labs/skills
Find and install the perfect skill to extend your AI agent
Microsoft Foundrymicrosoft/azure-skills
Build, deploy, and improve AI agents on Microsoft Foundry from start to finish
Azure Aimicrosoft/azure-skills
Search, transcribe, and analyze with Azure AI tools for smarter apps
Azure Hosted Copilot Sdkmicrosoft/azure-skills
Build, deploy, and manage your Copilot SDK apps on Azure with ease
Triagemattpocock/skills
Triage issues with a state machine driven by clear roles and agent briefs
Handoffmattpocock/skills
Hand off your work to another AI agent with a clear summary
Image Editagentspace-so/runcomfy-agent-skills
Smart router picks the best AI model for your image editing needs
Agentspaceagentspace-so/skills
See your AI agent's live folder from any browser instantly