| name | compound-nightly |
| description | Nightly maintenance for the compound loop — review each project STATE.md, promote only verified lessons to durable rules, keep MEMORY.md under budget, and log a short digest. Conservative and local only — never edits source, never pushes, never messages anyone. Schedule it to run nightly (see Scheduling). |
Compound nightly distill
Steady, unattended compounding. This is the maintenance half of the loop: it does not write
code — it promotes already-verified outcomes into durable rules and keeps memory healthy.
Procedure
- Find state files:
find . ~ -maxdepth 3 -name STATE.md -not -path '*/node_modules/*' -not -path '*/.git/*'
(scope to your project roots as you prefer).
- Promote verified lessons only. For each
STATE.md with real content, review
Open failures. Promote one to a generalized rule under Verified facts /
General rules only when there's concrete evidence the fix holds (tests passing, a
merged commit). Never invent a lesson. If a fix looks done but you can't confirm it, leave
it and note it under Waiting for human. Update Last session with the date.
- Memory hygiene. If
MEMORY.md exceeds ~200 lines / 25 KB, consolidate it: merge
duplicate rules, drop stale entries, and push detail into per-topic files, so the index
still auto-loads into subagents. (If a memory-consolidation skill is available in your
setup, you may use it instead.)
- Digest. Append one dated line of what changed to a log (e.g.
~/.claude/logs/compound-nightly.md). If nothing to do, log "idle — no history yet".
Guardrails
- LOCAL ONLY: no source edits, no
git push, no external messages.
- Conservative: promote on evidence, not optimism. Churn is failure, not progress.
Scheduling
Run nightly via Claude Code scheduled tasks or /schedule. Example cron (local time):
41 3 * * *. Keep the prompt self-contained — scheduled runs start fresh with no memory of
prior sessions, so point them at this skill explicitly.