[BUG] claude code writes memory without asking for permission
Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Jun 3, 2026 · closed Jun 5, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude code is writing/ adjustingconstantly memory without asking for permisssion. silencly memory is created/updated/deleted. Thats frustrating, because u have allways to check if claude has done anything in the memory, going to the memory file and check it.
What Should Happen?
claude code has a flage that it ask for mermission to change anything on any memory. Like when it will change any file in the normal chat mode.
Error Messages/Logs
Steps to Reproduce
- open claude code
- doing stuff up to the point claude code writing memory
- be frustrated that he has something stupidly written to the memory and u have to correct it.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
v2.1.156
Platform
Other
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
standard terminal ... whatever this is.
4 Comments
You can get this today — there are two supported ways to require approval (or a hard stop) before Claude touches memory. I tested both against
claudev2.1.161.What "memory" is, mechanically: memory writes (
CLAUDE.md, and the auto-memory files under~/.claude/projects/*/memory/) go through the normalWrite/Edittools. That's good news — it means the standard permission and hook machinery can gate them.Option A — native permission rules (no scripts)
Add to
~/.claude/settings.json(or project.claude/settings.json):askprompts you each time before a memory write. Swapask→denyif you'd rather block memory writes entirely. (I verified thedenyform end-to-end: theCLAUDE.mdwrite is refused while normal file writes pass through.)Option B — a PreToolUse hook (if you want one toggle for "ask / block / just log")
A small
PreToolUsehook onWrite|Editcan return a permission decision:permissionDecision: "ask"surfaces the approve/deny prompt;"deny"blocks. I confirmed both actually gate the write — the hook fires onWritetoCLAUDE.mdand the file isn't created unless approved.If you don't want to write the hook yourself, there's a ready-made one (
memory-write-guard) with anoff/ask/blocktoggle in the open-source cc-safe-setup hook collection.Until there's a built-in flag, Option A is the lightest path and needs no scripts.
Thanks for the great explanation! I will test this out as soon as possible. :D
I confirming,
Option A — native permission rules (no scripts)is working with the version v2.1.165This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.