fix(distill): recommend Edit(...) not Write(...) for the catalog allow-rule#6
Merged
Merged
Conversation
…w-rule Claude Code matches file permission checks against Edit(path) rules only — they cover every file-editing tool, including Write. A Write(path) allow rule never applies and Claude Code warns about it at startup: Permission allow rule (settings.json): Write(~/.claudesync/distilled/**) is not matched by file permission checks — only Edit(path) rules are. `claude-memsync init` was printing exactly that rule as its setup hint, and docs/distilling-memories.md carried the same snippet, so anyone following setup added a dead rule and got the warning on every launch. Switch both to Edit(...), explain the distinction where it's stated, and add a troubleshooting entry for users who already have the old rule. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Claude Code matches file permission checks against
Edit(path)rules only — they cover every file-editing tool, includingWrite. AWrite(path)allow rule never applies, and Claude Code warns about it at startup:claude-memsync initprinted exactly that rule as its post-init setup hint (cmd/claude-memsync/init.go), anddocs/distilling-memories.mdstep 3 carried the same snippet. So anyone following setup ended up with a dead rule and a warning on every Claude Code launch — while still getting prompted for writes to the catalog, which is what the rule was supposed to prevent.Changes
cmd/claude-memsync/init.go— the hint now prints"Edit(<dir>/**)"; theprintDistillPermissionHintdoc comment records whyEdit, notWrite.docs/distilling-memories.md— setup step 3 usesEdit(...), with a short note on the distinction, plus a troubleshooting bullet for users who already have the oldWrite(...)rule and see the startup warning.Docs/hint text only — no behavior change in the daemon or CLI.
Verification
gofmt -l .clean;go build ./...andgo test ./...pass.🤖 Generated with Claude Code