Skills Prompts Hues

Popular categories

Agent skill · Agent Skills for Context Engineering

/context-compression Compress long agent sessions without losing the file trail

This skill teaches the agent to compress conversation history in a way that keeps work moving. It sets tokens per task, not per request, as the goal, compares three summarization approaches, and favours structured summaries with fixed sections for intent, files changed, decisions, state and next steps, merged incrementally and checked with probe questions.

Works with

  • Claude Code
  • Cursor, Codex, Claude Code

Used forBuilding skills and MCP

When to use it

  • Coding sessions keep hitting the context limit and the agent loses track of which files it changed.
  • You are designing the summarization or handoff step of an agent framework.
  • You need a way to measure whether a compression method preserves what matters.

How it works

  1. 1
    Pick an approach

    Chooses anchored iterative summaries for long file-heavy sessions, opaque compression for short cheap ones, or full regeneration when humans read the summary.

  2. 2
    Fix the sections

    Defines mandatory summary sections suited to the task, such as root cause for debugging or schemas for migrations.

  3. 3
    Merge, do not regenerate

    Summarizes only the newly truncated span and folds it into existing sections, deduplicating by file and decision.

  4. 4
    Choose triggers

    Uses a sliding window or a 70 to 80 percent utilization threshold, or task boundaries when sessions have clear phases.

  5. 5
    Probe the result

    Asks recall, artifact, continuation and decision questions after compression and scores six dimensions.

What it steers the agent away from

  • Compressing tool definitions or schemas, which breaks tool calls.
  • Paraphrasing file paths, error codes and identifiers into vague prose.
  • Losing the constraints set in the first turns of a session.

Install this skill

It installs with the Agent Skills for Context Engineering pack.

Claude Code (plugin marketplace)Installs all published skills as one plugin; they activate from task context.
/plugin marketplace add muratcankoylan/Agent-Skills-for-Context-Engineering
/plugin install context-engineering@context-engineering-marketplace
Cursor, Codex, Claude Code (single skill copy)Run from a clone of the repo; copy whole folders, since flattening SKILL.md breaks its reference links.
mkdir -p .cursor/skills
cp -R skills/context-fundamentals .cursor/skills/
mkdir -p .claude/skills
cp -R skills/context-fundamentals .claude/skills/
mkdir -p .codex/skills
cp -R skills/context-fundamentals .codex/skills/

Commands come from the author’s README; check it for changes before you run them.

Questions

Why not just compress as much as possible?

Lost details force the agent to re-read and re-derive, so the total tokens for the task can rise even when each request shrinks.

Are the compression ratios in the skill universal?

No. The skill presents them as figures from one benchmark source and says not to treat them as constants.

More guides from Agent Skills for Context Engineering

Also in this pack

All 21 skills →

Summary by trendhub. The skill itself lives in muratcankoylan/Agent-Skills-for-Context-Engineering/skills/context-compression by Muratcan Koylan (MIT); read the full, current text there.