This skill should be used when the user asks to compress context, summarize conversation history, implement compaction, reduce token usage, or mentions context compression, structured summarization, tokens-per-task optimization, or long-running agent sessions exceeding context limits.
The context-compression skill is designed to effectively manage and optimize conversation history within AI agent sessions, particularly when these sessions generate extensive token usage that can exceed context window limits. By implementing context compression techniques, the skill addresses the challenge of retaining essential information while reducing the overall token count, thus facilitating more efficient interactions and task completions. This is especially important for applications that generate millions of tokens, where traditional methods may lead to critical information loss and inefficiencies in processing requests.
Key features of the context-compression skill include various compression strategies such as Anchored Iterative Summarization, Opaque Compression, and Regenerative Full Summary, each tailored to balance token savings against the risk of information loss. The skill also emphasizes the importance of tokens-per-task as a more relevant metric for evaluating compression effectiveness, as it accounts for the total tokens consumed throughout a task rather than just the request phase. Additionally, structured summaries are encouraged to ensure clarity and completeness in capturing session intents, modified files, decisions made, current states, and next steps, enhancing the overall utility of the agent during long-running sessions.
This skill is particularly beneficial for developers, AI researchers, and technical professionals who work with AI agents in coding environments or other scenarios involving complex conversation histories. It is ideal for those looking to implement effective summarization strategies, debug issues related to information retention, and build evaluation frameworks that assess compression quality while ensuring that vital details are not lost during interactions.
Activate this skill when agent sessions exceed context window limits or when designing conversation summarization strategies.
The main strategies include Anchored Iterative Summarization, Opaque Compression, and Regenerative Full Summary.
Yes, context compression can result in information loss, particularly if the compression method sacrifices interpretability for higher compression ratios.
The skill is applicable in environments where AI agents are used, regardless of the programming language, as long as there is a need for efficient context management.
Tokens-per-task is crucial as it measures the total tokens used from the start to the completion of a task, highlighting the efficiency of the compression strategy.
Quick Setup:
.claude/skills/