Context Compression Strategies
Compress long-running agent sessions while preserving files, decisions, risks, and next actions.
The skill mainly provides compression, summarization, and evaluation guidance, with no external side effects, credential handling, or exfiltration logic; no red-line risk is visible. However, sensitive-data handling, user confirmation, permission isolation, rollback, and data-flow disclosure are not specified, so safety-governance points are deducted.
The instructions are coherent and include scripts, references, and tests for heuristic scoring behavior. However, the core LLM judge is explicitly a stub, extraction relies on fragile regexes, and production tokenization, API integration, and abnormal-path handling are incomplete; static evidence therefore keeps this below 10.
Activation conditions, neighboring non-fit skills, three compression strategies, and scenario guidance are clearly described and platform-agnostic. Input/output contracts, precise trigger boundaries, Chinese-language support, and mainland-China reachability are insufficiently documented, warranting deductions.
The skill has frontmatter, layered sections, examples, gotchas, reference pointers, an MIT license, and creation/update/version metadata. Maintenance ownership, update path, changelog, and dependency-install notes are incomplete, while some benchmark and research claims are not independently verifiable from the supplied material.
It offers directly useful guidance and code scaffolding for compression strategy, artifact tracking, probe evaluation, and structured summaries. Yet the production evaluator is unfinished, regex extraction is limited, and representative outputs are not statically verified; substantial implementation and review remain necessary, so the static cap applies.
Auditable scripts, tests, and CI-related evidence are present, with tests covering two heuristic-scoring behaviors. But there is no complete executable coverage of the skill's key paths or independent third-party reproduction evidence; benchmark figures and external references remain insufficiently verified claims.
- The core evaluator's LLM judge remains a demonstration stub and should not be considered production-ready.
- Regex extraction may omit or misidentify errors, files, decisions, and next steps; real-session regression testing is still needed.
- The cited benchmark and external research results lack sufficient independent evidence in the supplied material.
- Handling boundaries for sensitive conversation content, credentials, privacy data, and persisted summaries are unspecified.
What does this skill do, and when should you use it?
This skill is for agent sessions, codebases, and tool trajectories that outgrow the available context window. It recommends anchored iterative summarization, opaque compression, or regenerative full summaries according to session characteristics. Its central objective is minimizing total tokens per completed task, including the cost of re-fetching information lost during compression. The guidance emphasizes durable artifact tracking, structured summary sections, strategic triggers, probe-based evaluation, and six quality dimensions.
It instructs agents to turn truncated session history into structured summaries covering intent, file changes, decisions, current state, and next steps. Later cycles should summarize only newly truncated content, merge it into the existing summary, and deduplicate by file path and decision identity. The skill also recommends tracking created, modified, and read-only files plus function names, variables, error messages, and error codes; evaluating retention with recall, artifact, continuation, and decision probes; and using a three-phase research, planning, and implementation workflow for large codebases.
- A software engineer debugging a long coding session where the agent may forget which files it changed.
- A development team working on a codebase larger than the context window and needing a compact implementation specification.
- An agent engineer designing durable handoff summaries that preserve rationale, identifiers, risks, and next actions.
- A researcher building a compression evaluation framework that tests factual retention and task continuity with probes.
What are this skill's strengths and limitations?
- Clearly distinguishes three compression approaches and their suitable session profiles.
- Treats exact file paths, function names, error codes, and decision rationale as first-class information.
- Provides probe-based evaluation and a six-dimension quality framework.
- Includes a practical research, planning, and implementation workflow for large codebases.
- This is instructional SKILL.md content, not a runnable compression implementation.
- The reported compression ratios and quality scores are explicitly source-specific benchmark figures, not universal guarantees.
- Faulty or overly aggressive summaries can still lose identifiers, early constraints, and code details.
- The source does not describe an independent test suite or platform-specific validation for this skill.
How do you install this skill?
The repository distributes skills as directories. Copy skills/context-compression into a project skill directory, for example: mkdir -p .codex/skills && cp -R skills/context-compression .codex/skills/. It may also be copied to .claude/skills/ or .agents/skills/. The README also documents Claude Code commands for installing the full plugin collection, but those install multiple skills rather than this skill alone.
How do you use this skill?
Load the directory in an Agent Skills-compatible client and invoke it for a long session or under context pressure, for example: “Compress this coding session while preserving intent, full paths of created and modified files, function names, error messages, decisions, current test status, and next steps.” For long-running coding work with artifact tracking, follow the recommended combination of structured summaries and sliding-window triggers.
How does this skill compare with similar options?
The skill compares anchored iterative summarization, opaque compression, and regenerative full summaries. It also distinguishes its scope from the collection’s context-optimization, context-degradation, filesystem-context, and memory-systems skills.