Skip to content

fix(distill): recommend Edit(...) not Write(...) for the catalog allow-rule#6

Merged
rockfordlhotka merged 1 commit into
mainfrom
fix/distill-permission-rule-edit
Jul 24, 2026
Merged

fix(distill): recommend Edit(...) not Write(...) for the catalog allow-rule#6
rockfordlhotka merged 1 commit into
mainfrom
fix/distill-permission-rule-edit

Conversation

@rockfordlhotka

Copy link
Copy Markdown
Member

Problem

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 (~/.claude/settings.json): Write(~/.claudesync/distilled/**) is not matched by file permission checks — only Edit(path) rules are. Use Edit(~/.claudesync/distilled/**) instead (Edit rules cover all file-editing tools).

claude-memsync init printed exactly that rule as its post-init setup hint (cmd/claude-memsync/init.go), and docs/distilling-memories.md step 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>/**)"; the printDistillPermissionHint doc comment records why Edit, not Write.
  • docs/distilling-memories.md — setup step 3 uses Edit(...), with a short note on the distinction, plus a troubleshooting bullet for users who already have the old Write(...) rule and see the startup warning.

Docs/hint text only — no behavior change in the daemon or CLI.

Verification

gofmt -l . clean; go build ./... and go test ./... pass.

🤖 Generated with Claude Code

…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>
@rockfordlhotka
rockfordlhotka merged commit b31c26b into main Jul 24, 2026
3 checks passed
@rockfordlhotka
rockfordlhotka deleted the fix/distill-permission-rule-edit branch July 24, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant