- Entity format: 3-line compact registry (### Name / key facts / status+links) Heavy entries promoted to thread files. Cross-domain pointers for shared entities. - Pattern satellites: core patterns.md cap reduced from 110→70 lines (5.5KB). Domain-specific patterns go in satellite files loaded only by owning skill. - Reflect: pattern routing rules, entity format enforcement (step 3b) - Housekeeping: entity registry enforcement (step 5b), glacier inactive entities - Evolve: scorecard metrics for pattern distribution + entity compression ratio - README: updated entity example to 3-line format Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5.9 KiB
Use this skill to perform memory housekeeping. Trigger if the user says "housekeeping", "clean up memory", "prune memory", "archive old data", or similar maintenance requests.
1. Garbage Collect Memory
Review and archive stale data per CLAUDE.md glacier rules. All glacier files must have YAML frontmatter.
Observations — archive by primary tag:
- If any
observations.mdhas >50 entries, group oldest entries by primary tag and move tomemory/glacier/{domain}/observations-{tag}.md - If
memory/cog-meta/self-observations.mdhas >50 entries, group by primary tag →memory/glacier/cog-meta/observations-{tag}.md
Other files — standard rules:
- If any
action-items.mdhas >10 completed items, move tomemory/glacier/{domain}/action-items-done.md - Apply same logic for all domains listed in
memory/domains.yml - If
memory/cog-meta/improvements.mdhas >10 implemented items, move tomemory/glacier/cog-meta/improvements-done-{YYYY}.md
2. Prune Hot Memory (rule-based)
Keep ALL hot-memory.md files under 50 lines. Relevance judgment (promote/demote) is /reflect's job — you apply structural rules:
Files to check:
Read memory/domains.yml to discover all active domains. Check hot-memory.md for each domain, plus the cross-domain memory/hot-memory.md.
Pruning priority (trim in this order):
- Resolved items — anything with
strikethrough, "DONE", "RESOLVED" - Past events — entries about dates that have already occurred
- SSOT violations — same fact in hot-memory AND the canonical file (entities, action-items, etc.). Keep in canonical file, replace hot-memory copy with
[[link]]or remove - Stale entries — items not referenced in 14+ days
- Low-signal entries — FYI items with no action or deadline
Where trimmed entries go:
- Entries with lasting value → append to domain's
observations.md - Entries that are purely historical → let them go
- Never silently delete — always move or note removal in debrief
3. Surface Opportunities & Accountability
Review all action-items.md files across every domain:
- Stale items (open >2 weeks): list with age and suggested next action
- Dormant domains: if any domain has 0 new observations in >4 weeks, flag
- Health escalation: items open >6 months get flagged with urgency label
- Birthday prep: if any birthday in entities.md is <2 weeks away, pull interests and suggest ideas
Be direct. Don't just report — recommend specific actions.
4. Rebuild Glacier Index
Scan all memory/glacier/**/*.md files. Extract YAML frontmatter. Write results to memory/glacier/index.md:
# Glacier Index
<!-- Auto-generated by housekeeping. Do not edit. -->
<!-- Last updated: YYYY-MM-DD -->
| File | Domain | Type | Tags | Date Range | Entries | Summary |
|------|--------|------|------|------------|---------|---------|
5. Link Audit (discover missing links)
For each non-glacier memory file:
- Entity mentions: Scan for names matching
### <Name>headers in entities.md — add[[links]]if missing - Cross-domain references: If a file mentions a topic from another domain, add a cross-domain link
- Action item references: If an observation references a task, link it
Only add links where the reference is substantive.
5b. Entity Registry Format Enforcement
Scan all entities.md files for registry format compliance:
- 3-line max: Any
### entrywith >3 content lines should be compressed. If the entry has an associated detail file (→ [[link]]), compress to: name/relationship, pipe-separated key facts, status+link. If no detail file exists and entry is >5 lines, flag as a promotion candidate (suggest creating a thread file). - Glacier candidates: Entries with
status: inactiveorlast:date >6 months ago → move toglacier/{domain}/entities-inactive.md(leave a stub with archived comment). - Missing metadata: Flag entries missing
status:orlast:fields.
5c. Temporal Fact Maintenance
Scan all entities.md files for (until YYYY-MM) markers with past dates:
- If the line has no
strikethrough, add it - If already struck through, move to a
## Historicalsubsection at the bottom of that entity's block (create the subsection if absent) - Report moved facts in the debrief
6. Rebuild Link Index
Scan all memory files (excluding glacier/) for [[wiki-links]]. For each link, record: target → source.
Rewrite memory/link-index.md:
# Memory Link Index
<!-- Auto-generated by housekeeping. Do not edit. -->
<!-- Last updated: YYYY-MM-DD -->
| Target | Linked from |
|--------|-------------|
| `personal/entities` | `personal/observations`, `personal/hot-memory` |
Rules:
- Only include targets with at least one inbound link
- Combine multiple sources per target on one row (comma-separated)
- Exclude glacier files from both source and target
7. Write Briefing Bridge
Write key findings to memory/cog-meta/briefing-bridge.md so foresight can pick them up:
# Briefing Bridge
<!-- Auto-generated by housekeeping. Consumed by foresight. -->
<!-- Last updated: YYYY-MM-DD -->
## Stale Items (>2 weeks)
- <item> — <age> — suggested action: <action>
## Birthday Prep
- <name> birthday in <N> days — interests: <from entities>
## Dormant Domains
- <domain> — last activity: <date>
## Health Escalation
- <item> — open <N> months
Only include sections that have content.
8. L0 Header Maintenance
Check all active memory files for missing <!-- L0: ... --> headers. If a file is missing its L0:
- Read the file content, write a one-line summary (max 80 chars)
- Add on the line after the
# Title
L0 headers are the first tier of the retrieval protocol — they let any skill scan what a file contains before deciding to read it.
9. Compose Debrief
Summarize everything done:
- What was archived/pruned
- Upcoming events flagged
- Action items surfaced
- Links added
Keep it concise but informative.