memory_edit — Claude Code prompt: what it does, how to install
The memory_edit prompt for Claude Code and ChatGPT edits or deletes saved memory only after a direct request in the current message. It searches for the entry before changing it.
Apache-2.0 ★ 9,488 updated 2026-11-16
.claude/commands/memory_edit.mdWhat memory_edit does
The prompt changes or removes a single existing memory entry only when the user explicitly requests that action in the current message. It calls memory_search first and takes a stable ID from the latest results; a new search replaces the earlier candidates. When several entries match, the quote must include the exact ID. Otherwise, the prompt narrows the search to one entry or asks the user to identify it.
For an edit, quote holds the user’s exact words from the current message, while content supplies the replacement text. Keywords can be replaced too. Successful changes appear in the result card and can be undone. Passwords, codes, and card numbers must never be stored.
What it helps with
- edit one memory entry after a direct request
- remove a chosen entry without guessing its ID
- replace an entry’s text and optionally its keywords
- undo a successful memory change
Example prompts for the agent
- Update my saved note about my code editor: I now use Neovim.
- Delete the saved note about my old address.
- Replace the text for ID
mem_123with “I prefer concise answers”.
How to install memory_edit
Manually: put the files in place
.claude/commands/memory_edit.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about memory_edit
How do I install memory_edit in Claude Code?
Save the prompt file at .claude/commands/memory_edit.md.
What does memory_edit do?
It edits or deletes one existing memory entry after a direct user request. First, it calls memory_search and uses a stable ID from the latest results.
What does memory_edit need to work?
It needs memory_search to find an entry and retrieve its stable ID. The prompt forbids storing passwords, codes, or card numbers.
Source text
memory_edit.md · Apache-2.0
Update or delete one existing memory only when the current user message explicitly asks for that change. Call memory_search first and use an exact stable id from its latest result set; a new search replaces the previous candidates. If the latest search returns multiple entries, quote must contain the exact stable id, otherwise narrow the search to one entry or ask the user to specify that id; never guess. quote must be the exact current user words requesting the update or deletion, not a previous turn. For update, content is the replacement and optional keywords replace the old keywords. Every successful change appears in the result card and can be undone. Never store passwords, codes or card numbers.
© wangzan101 · Apache-2.0 · wangzan101/Mika