refactor-memory
SkillFiles & storageUse when about to refactor or refine Claude Code auto memory, the MEMORY.md index and its topic files, to delete stale or derivable memories, fix inconsistencies, promote standing decisions to CLAUDE.md or rules, and regroup the index. Not for CLAUDE.md or rules files themselves
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the refactor-memory skill
What this skill tells your AI
The instructions your AI receives, as published by vinta/hal-9000 in skills/refactor-memory/SKILL.md and read by ahel’s review.
Refactor memories so each entry carries what no lookup returns: a decision, a correction, a measured gotcha. Audit entries within the requested scope; their storage and update mechanism depend on the environment.
Instructions
-
Pick the target. Use the scope or directory the user names, otherwise the platform default below. Load the reference for the active environment before reading memories:
- Claude Code: references/claude-code.md for project memory files, index rules, promotion destinations, and direct edits.
- Codex: references/codex.md for shared storage, project filtering, promotion destinations, and session-authorized updates.
State the storage location and audit scope. A shared directory does not make every entry global.
-
Read the evidence. Follow the reference's reading procedure and fetch its official memory guide. Compare entries against applicable loaded instructions, repository files, and current vendor documentation. Inventory the entries in scope before assigning verdicts.
-
Audit entries. Give every entry exactly one verdict, with its location and evidence beside it. Done when no entry in scope lacks one.
- contradiction: conflicts with another memory, or with the current instruction or code it describes. Record both sides.
- delete: no future action depends on it. Covers completed work, settled questions, and facts recoverable from code, git history, loaded instructions, or vendor docs. Check each claim by looking: search the repo, read the instruction, fetch the docs page. Delete outright, never rewrite into a done or synced record.
- rewrite: right fact, wrong form: a recall hook disagrees with the body, a reference is broken, a date is relative, or two entries carry one fact and should merge.
- promote: a memory that is really a standing instruction. Name the destination using the platform reference. Promote only instructions that change future behavior and are not already covered there; use a skill for a multi-step workflow. Tool behavior alone is not a standing instruction.
- keep: earns its index line and recall cost as written.
-
Audit recall. Apply the platform's index or summary checks. Check discoverability, duplicate claims, scope, and evidence references. Propose the layout changes needed for the entries in scope.
-
Get decisions. Present each unresolved contradiction with both sides as choices. Then present numbered delete, rewrite, and promote lists with evidence and the proposed layout. Use the platform's question tool to let the user select the verdicts to apply. Nothing changes until the user chooses.
-
Apply and verify. Apply the selected verdicts through the platform's update mechanism without asking again. Remove a promoted memory only after its destination carries the instruction. Verify the result using the platform reference and report any pending consolidation separately from completed changes. Anything else noticed while editing is a follow-up.
Signals
- GitHub stars
- 130
- Forks
- 25
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
refactor-memory- Source
- github.com/vinta/hal-9000