agentleFS
yeaight7yeaight7/agent-powerups/skills/context-compression/SKILL.md

context-compression

Skill6 starsChanged 4 months agoApache-2.0View on GitHub

Use when conversation context is bloated, constraints are being forgotten, or a compact handoff is needed before continuing work.

24 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use bdi-mental-states, hosted-agents and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Downey6689Skill

    bdi-mental-states

    Transforms external RDF context into BDI mental states. Invoke when modeling beliefs, desires, and intentions.

    Also in 5 projects that use this

  • Downey6689Skill

    hosted-agents

    Guidance for hosted/sandboxed agents. Invoke when running background agents in isolated VMs or multi-client setups.

    Also in 5 projects that use this

  • DVwebBiz11Skill

    self-improvement-loops

    This skill should be used when the harness, scaffold, workflow, or optimizer itself is the optimization target: recursive self-improvement (RSI) loops, meta-harnesses, self-improving harnesses that mine their own failures and propose bounded edits, evolutionary or population-based search over agent scaffolds, acceptance gates for self-modifying systems, and agentic context evolution where the mechanism that produces context is versioned and evolved. Route governance of a single autonomous loop (locked surfaces, durable logs, rollback, novelty gates, approval boundaries) to harness-engineering, measurement and quality-gate design to evaluation, judge design to advanced-evaluation, and remote sandbox infrastructure to hosted-agents.

    Also in 4 projects that use this

  • DVwebBiz11Skill

    long-horizon-prompting

    This skill should be used when writing, enhancing, or evaluating the launch prompt for a long-running autonomous agent or a parallel multi-agent orchestration attacking a hard problem: pseudo-formal task briefs that define terms and an exact success predicate linguistically, enumerate non-counting outcomes, set persistence rules with explicit stop and return conditions and effort floors, manage a diverse portfolio of parallel approaches with an approach registry and blocked-route bookkeeping, and gate the return on adversarial audit. Route agent topology and coordination protocols to multi-agent-patterns, runtime control surfaces and loop governance to harness-engineering, evaluator and quality-gate construction to evaluation, judge design to advanced-evaluation, and compaction or memory mechanics to context-compression and memory-systems.

    Also in 4 projects that use this

  • AbdelrhmanAlquranSkill

    latent-briefing

    This skill should be used when the user asks to "share memory between agents", "KV cache compaction for multi-agent", "orchestrator worker context", "latent briefing", "reduce worker tokens", "cross-agent memory without summarization", or discusses Attention Matching compaction, recursive language models with workers, or token explosion in hierarchical agents.

    Also in 4 projects that use this

  • Dimks777Skill

    memory-system

    Развёртывание и обслуживание 3-слойной системы памяти для любого агента OpenClaw — чтобы контекст переживал сессии. Активируется на: настрой память, memory setup, проверь память, memory check, почисти память, memory cleanup, память.

    Also in 5 projects that use this

  • +2 more from Downey6689

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 17 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when context approaches limits or response quality degrades (repeated mistakes, forgotten constraints, lost-in-the-middle effects) — …

    line 9
  2. Distinctive:

    Before finalizing, verify the handoff can answer:

    line 52
  3. Distinctive:

    Do NOT silently drop critical architectural constraints or user preferences during compression.

    line 59
  4. Distinctive:

    Write the handoff document to disk before asking the user to restart.

    line 60
  5. Distinctive:

    All four quality probes (recall, artifact, continuation, decision) can be answered from the artifact without re-reading the full transcript.

    line 65

“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Context Compression

When to use

Use when context approaches limits or response quality degrades (repeated mistakes, forgotten constraints, lost-in-the-middle effects) — typically after many turns of debugging or complex planning.

Requirements / Checks

  • Active session contains long stack traces, large file dumps, or multiple failed iterations.

Workflow

  1. Diagnose bloat — identify: redundant outputs (same file read multiple times), contradictory instructions that accumulated over turns, constraint forgetting (earlier requirements no longer respected).
  2. Draft summary — synthesize the current valid state of the code or plan in 3–5 sentences.
  3. Extract anti-patterns — list what failed and why: "Attempted X → failed because Y". These are critical to prevent the next session from looping on the same mistakes.
  4. Generate handoff artifact — write the following template to disk:

    ## Goal
    [One-sentence objective]
    
    ## Current state
    [What is working / what is in place right now]
    
    ## Blocker / next step
    [The exact next action to take]
    
    ## Anti-patterns (do not repeat)
    - Tried X → failed because Y
    - Tried A → blocked by B
    
    ## Key files
    - `path/to/file.ts` — [what it does / why it matters]
    
    ## Open risks
    - [Anything uncertain or requiring verification]
    
    ## Decisions made
    - [Key tradeoffs and why alternatives were rejected]
  5. Restart — tell the user to start a new chat session and attach the handoff file as the first message.

Quality Probes

Before finalizing, verify the handoff can answer:

  • Recall: exact commands, errors, versions, decisions that still matter.
  • Artifact: files created, modified, inspected, intentionally untouched.
  • Continuation: next action, current blocker, validation state, open risks.
  • Decision: why key tradeoffs were chosen and what alternatives were rejected.

Safety Constraints

  • Do NOT silently drop critical architectural constraints or user preferences during compression.
  • Write the handoff document to disk before asking the user to restart.

Validation / Done Criteria

  • Handoff artifact exists on disk and is in the template format above.
  • User is explicitly told to restart the session and attach the file.
  • All four quality probes (recall, artifact, continuation, decision) can be answered from the artifact without re-reading the full transcript.

Anti-loss Checklist

  • Goal is clearly stated.
  • Current blocker / next step is identified.
  • Failed approaches are documented to prevent looping.
  • Relevant file paths are listed.
  • Key decisions and their reasons are recorded.

References

  • references/compression-quality-probes.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.