agentleFS
jthiruveedulajthiruveedula/agentkit/skills/context-compressor/SKILL.md

context-compressor

Skill0 starsChanged 2 months agoMITView on GitHub

Write short summarization checkpoints (goal, decisions+reasons, state, open threads, memory keys) to survive context pressure. Use when a session is long, before compaction or risky multi-step runs, at task boundaries, or before handoff.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before compaction (while you still have full context, not at the warning).

    line 24
  2. Distinctive:

    Before a risky multi-step run (migrations, refactors, bulk edits).

    line 25
  3. Distinctive:

    Before handing off (see Handoff format).

    line 27
  4. Distinctive:

    Keep: decisions + reasons, file paths, identifiers (PR numbers, keys, order codes), error signatures, current state, open threads + next …

    line 41
  5. Distinctive:

    Write it before context gets tight, not when the warning fires.

    line 52
  6. Very specific:

    Use stable canonical keys: proj.<name>.checkpoint.

    line 53
  7. Distinctive:

    No transcripts, no history, no speculation.

    line 71

“Common” is measured: kept by at least 6 in 10 of the 3 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 Compressor

Checkpoints are resumption kits, not logs. A good one lets the next session act without re-reading history. The blank template lives in reference/template.md; scripts/checkpoint.py render prints it and scripts/checkpoint.py lint <file> enforces it.

Procedure

  1. Render the blank: python3 scripts/checkpoint.py render > checkpoint.md.
  2. Fill each section from current state (see anatomy below); cite paths, don't paste content.
  3. Lint: python3 scripts/checkpoint.py lint checkpoint.md; fix and repeat until clean (max 3 attempts, then report what still fails).
  4. Save under proj.<name>.checkpoint, replacing the previous one.

When to checkpoint

  • Before compaction (while you still have full context, not at the warning).
  • Before a risky multi-step run (migrations, refactors, bulk edits).
  • At task boundaries.
  • Before handing off (see Handoff format).

Checkpoint anatomy

Target: < 40 lines. Required sections (lint enforces these):

  • Goal — one line: the outcome this workstream is driving toward.
  • Decisions — bullets, each with its reason.
  • State — Done: list and In flight: list, artifacts cited.
  • Open threads — unresolved items, each with a concrete → next: action.
  • Memory keys touched — canonical keys, what changed and why.

Keep vs. drop

Keep: decisions + reasons, file paths, identifiers (PR numbers, keys, order codes), error signatures, current state, open threads + next actions, constraints handed down. Drop: transcripts, dead-end explorations, raw tool output, repeated confirmations, resolved threads, speculation.

The test: if you can only resume by re-reading the transcript, the checkpoint failed. See reference/keep-drop.md for the table.

Compaction hygiene

  • Write it before context gets tight, not when the warning fires.
  • Use stable canonical keys: proj.<name>.checkpoint. One checkpoint per workstream.
  • Supersede, don't append. Rewriting one checkpoint replaces the old one; appending versions makes every future read pay for history.
  • Lint it: python3 scripts/checkpoint.py lint checkpoint.md. Limit 60 lines; aim for 40.

Handoff format

Compress a checkpoint into a subagent brief by dropping everything but:

Goal: <one line>
Constraints: <hard limits — what NOT to do>
State: <done / in flight, artifact paths only>
Next: <the single action the subagent should take first>

No transcripts, no history, no speculation. The brief fits in a single task message; the subagent re-derives the rest from the repo.

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.