Skip to content

docs(claude-md): add Memory hygiene section#21

Merged
xmap merged 1 commit into
mainfrom
worktree-memory-hygiene
Jun 2, 2026
Merged

docs(claude-md): add Memory hygiene section#21
xmap merged 1 commit into
mainfrom
worktree-memory-hygiene

Conversation

@xmap
Copy link
Copy Markdown
Owner

@xmap xmap commented Jun 2, 2026

Summary

  • Adds a 15-line ## Memory hygiene section to CLAUDE.md codifying six rules that curb auto-memory drift:
    1. Grep MEMORY.md before creating a new memo; prefer edit-in-place
    2. When tagging SUPERSEDED, demote the index entry in the same edit
    3. Demote SHIPPED memos to ## Reference once the work has been on main for 30+ days
    4. Verify-before-quoting for any index line with a count, phase tag, or date older than 7 days
    5. Mutable phase status doesn't belong in index descriptions
    6. Split memo files over ~300 lines

Why

Auto-memory grew monotonically for 25 days with only one hygiene event (the 2026-05-08 reset). Without explicit rules, SUPERSEDED entries keep their index slot, terminal status leaks into descriptions, and the same concept gets saved twice (Federation BC was duplicated until 2026-06-02). These rules become part of the per-session prompt context, so future sessions follow them without re-deriving the policy.

Pairs with a separate session-side /memory-audit skill and SessionStart hook (configured in ~/.claude/skills/ and ~/.claude/settings.json) that mechanically catch drift; this PR ships the prose half.

Test plan

  • Skim the diff: 11 added lines, no other file touched
  • Confirm em-dash hard rule still satisfied (grep "—" CLAUDE.md shows only pre-existing lines 15 and 33)
  • Merge and verify a new session in main loads the section into context

🤖 Generated with Claude Code

…to-memory drift

Auto-memory grows monotonically. Without explicit rules, SUPERSEDED entries
keep their index slot, terminal status leaks into descriptions, and the
same concept gets saved twice (Federation BC was duplicated until 2026-06-02).

Six rules cover the load-bearing gaps: pre-write dedup grep, SUPERSEDED
demotion in the same edit, SHIPPED demotion after 30 days, verify-before-
citing for index lines with counts/phase-tags/old-dates, durable-claim-only
in the index, and split-at-300-lines for memo files.

Lives in CLAUDE.md so future-Claude reads the rules every session without
having to recall a meta-memory.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Coverage report

This PR does not seem to contain any modification to coverable code.

@xmap xmap merged commit ae28c7f into main Jun 2, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant