keel-compact
Skill9 starsChanged 51 days agoMITView on GitHub
Pre-compact ritual — bring the disk fully up to date (runs the /keel-handover procedure, which cascades to /keel-distill, PLAN flips and the LESSONS sweep), verify freshness, then hand off to the built-in /compact. One command to remember instead of several.
In this repository17 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- keel-adoptSkill
- keel-agent-team-createSkill
- keel-agent-team-startSkill
- keel-auditSkill
- keel-autopilotSkill
- keel-continueSkill
- keel-distillSkill
- keel-handoverSkill
- keel-phase-reviewSkill
- keel-pilotSkill
- keel-planSkill
- keel-researchSkill
- keel-statsSkill
- keel-teamSkill
- keel-tidySkill
- keel-updateSkill
The file
Files
/keel-compact — refresh the disk, THEN compact
Compaction summarizes the conversation lossily; the pincer (PreCompact snapshot + SessionStart
re-ground) restores only what is ON DISK. This skill exists so a forgotten ritual can't turn a
manual compact into an information-loss event — the failure mode: /compact run with a stale
HANDOVER, and the snapshot faithfully backs up the stale file. Run it whenever you are about to
compact (or the context feels near-full). The individual skills stay directly invokable as
always — this is the umbrella, not a replacement.
- Run the full
/keel-handoverprocedure (rules.md §1.4) — it already cascades:/keel-distillwhen caps are hit, the session block (a)–(d), PLAN.md status flips + the regenerated diagram, TASKS.md cleanup, and the §9.31 sweep of unwritten agreements intoLESSONS.md. Do not duplicate its steps here — invoke it. - Freshness gate — RUN
python3 .claude/keel-compact-check.py(ONE call; itsrcis the verdict). It measures the mechanical half of the list below and prints its own scope: size per always-loaded file (lines · KB · over-long lines — caps read from.claude/keel-caps), HANDOVER block count + top-block date + "written this session" + STALE-DISK debt,## Nowper lane,## Reviewevidence files, ghost citations, and the push boundary. rc 0 pass · 1 RED (fix, re-run) · 2 the instrument failed (fall back to the list by hand). It refuses to fake the one non-mechanical item and PRINTS it instead — the §9.31 sweep is yours. Why a script: on a live 5-agent project this checklist cost 17 / 25 / 59 tool turns per ritual at the fullest context of the session (~37M cache reads for one run). The list it replaces, for reference:HANDOVER.mdtop block carries THIS session'sYYYY-MM-DD HH:MMand describes THIS session (same-day ≠ same-session: another session's block from today is still stale — add your own).TASKS.md ## Nowmatches reality; finished items deleted (one-liners in block (a)).- No agreement / gotcha / failed approach from this conversation is still unwritten (§9.31).
- Caps respected (defaults —
.claude/keel-capsoverrides, rules §10.40): HANDOVER ≤ 3 blocks / ~150 · LESSONS ≤ ~250 · TASKS ≤ ~100 (else/keel-distill) — in LINES and KB, with no line over its per-line cap (a line cap alone once let HANDOVER reach 244 KB on 146 lines). PLAN.mdstatuses + Current focus current (if the project uses PLAN.md).
- Offer an approved commit + the batched push (rules.md §1.3, §6.15) — this is the natural push
boundary: commits accrued through the session go out here in ONE approval (the
askon push fires once, not per-commit — that's the point). git is the second safety net beside.claude/snapshots/: even a bad summary then loses nothing. - Hand off: tell the user — "Disk is fresh; now run
/compact." A skill CANNOT invoke the built-in/compactitself; stop here and let the user trigger it.
Enforcement: this ritual is not just advice — the compact-gate PreCompact hook (matcher
manual) BLOCKS a stale manual /compact with exit 2 and points here, so forgetting it can't
silently cost a session (on older CLIs the block degrades to a warning). Emergency bypasses:
/compact keel-force · touch .claude/compact-force (one-shot).
Scope honesty: the gate covers MANUAL compacts only. Auto-compact is never blocked (a blocked
auto-compact could wedge a full session) — the defense there remains the hot-path discipline
(§9.31: write it the moment it appears) + the pincer. For full determinism you can disable
auto-compact in /config and compact only via this ritual (trade-off: forget too long and the
session hits the hard context limit mid-turn).
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
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.

