with one click
memory-hygiene
Audit and update Claude memory files after PRs, milestones, or architectural changes. Use after merging PRs, deleting files, or changing architecture.
Menu
Audit and update Claude memory files after PRs, milestones, or architectural changes. Use after merging PRs, deleting files, or changing architecture.
| name | memory-hygiene |
| description | Audit and update Claude memory files after PRs, milestones, or architectural changes. Use after merging PRs, deleting files, or changing architecture. |
| allowed-tools | Read, Edit, Write, Glob, Grep |
Audit and update Claude's memory files to prevent stale context across sessions.
~/.claude/projects/-Users-arthurfantaci-jama-mcp-server/
└── memory/
├── MEMORY.md # Index of auto-memory entries (~100 lines max)
└── <type>_<topic>.md # Auto-memory fact files (user/feedback/project/reference)
The user-private project-scoped
CLAUDE.mdtier is intentionally unused for this project; project conventions live in the publicCLAUDE.md(see "Memory hygiene" section there).
<repo-root>/
├── CLAUDE.md # Project conventions and pointers (~150 lines max)
└── MEMORY.md # Working state: phase, branch, current task (~100 lines max)
Extract paths mentioned in memory files and verify each still exists:
grep -oE '[a-zA-Z_/]+\.(py|md|toml|yml|yaml|json|sh)' CLAUDE.md MEMORY.md
Remove references to deleted files. Update paths that have moved.
Compare the architecture description in CLAUDE.md against the actual layout:
ls -la src/jama_client/
ls -la src/jama_mcp_server/
Update the architecture section if module structure has changed.
In MEMORY.md, keep only the last 5–10 significant decisions or PRs. Remove older entries.
CLAUDE.md should be at most ~150 lines.MEMORY.md should be at most ~100 lines.wc -l CLAUDE.md MEMORY.md
wc -l ~/.claude/projects/-Users-arthurfantaci-jama-mcp-server/memory/MEMORY.md
If over limit, consolidate or archive content.
Review any "Patterns" or "Gotchas" sections. Remove patterns that have been refactored away. Update patterns that have evolved.
MEMORY.md should accurately reflect:
If the phase has just transitioned, run the Phase Handoff Protocol from the author's global ~/.claude/CLAUDE.md.
Stale tool names in instructional prose are silently overridden by the model at runtime but obscure protocol drift. After mcp-neo4j-memory updates (or as a periodic check), scan for known-stale identifiers in living instructional surfaces:
grep -n 'search_nodes\|open_nodes' ~/.claude/CLAUDE.md .claude/skills/memory-hygiene/SKILL.md MEMORY.md CLAUDE.md
Cross-check live tool names against mcp__memory__* (visible in the session's available-tools list). Update prose only on living surfaces — never edit the date-stamped audit at ~/.claude/claude-code-config-audit.md, which is preserved as a historical artifact.
The scan above uses known-stale strings; the underlying principle — compare protocol prose against the live tool surface — also catches future drift involving names not yet anticipated.
After running, report:
docs/internal/.