gc
Skill1 starsChanged 12 days agoMITView on GitHub
Garbage-collect the NEO second brain. Runs a deterministic staleness scan over .neo/brain/LESSONS.md (dead anchors, aged entries, missing datestamps), then spawns neo-shadow to review only the flagged entries against the current codebase — keep, rewrite, or archive. Use when /neo:status flags lesson rot, when LESSONS.md grows past ~30 entries, or when the user says "clean the brain", "prune lessons", or "gc".
The file
Files
/neo:gc — collect stale memory
Scan: !bash "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/brain-gc.sh" 2>/dev/null || echo "scan unavailable — read .neo/brain/LESSONS.md and review manually"
Steps
- Guard: if
.neo/brain/is missing, stop and point to/neo:init. CheckDECISIONS.md: for each entry, test itsReverses when:condition against the codebase/git and note any that are currently true. If the scan above reports healthy (no dead anchors, no aged, no undated) AND no decision is reversed, report "Brain healthy — nothing to collect" and stop. Spawn neo-shadow (Agent tool) with the 6-section contract. TASK: review ONLY the flagged lesson entries from the scan plus the decisions NEO found reversed (quoted) against the current codebase, one verdict each. For a reversed decision: KEEP (condition misjudged — say why) or ARCHIVE (move the whole entry to
.neo/brain/archive/DECISIONS.mdunder a## YYYY-MM-DDheading with a one-line reason; create the file if absent). For lessons:- KEEP — still true. For
UNDATEDentries, stamp today's date and the default provenance tag:- [YYYY-MM-DD] [observed] <unchanged text>. ForAGEDentries confirmed still true, refresh the datestamp (date = last confirmed). - REWRITE — the kernel is true but details drifted (file moved, command renamed). Update text, anchor, and datestamp. A
DEAD-ANCHORoften means the file moved — grep for its new location before concluding it's gone. - ARCHIVE — no longer applies (dependency removed, pattern retired). Move the line to
.neo/brain/archive/LESSONS.mdunder a## YYYY-MM-DDheading with a one-line reason. Create the archive file if absent.
EXPECTED OUTCOME: every remaining LESSONS.md entry datestamped and true against the current codebase; archived entries preserved verbatim with reasons. MUST NOT: delete any entry outright (archive instead), touch entries the scan did not flag or decisions NEO did not quote, touch anything outside
.neo/brain/. CONTEXT: the full scan report above, the quoted reversed decisions, plus the current date.- KEEP — still true. For
- Verify + report: from the shadow's report, relay one line: "GC done — N kept, N rewritten, N archived; decisions: N kept, N archived." If the shadow was unsure about any entry, it keeps it marked
(unverified)— surface those to the user for a human call.
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.

