anthropics / anthropics/claude-plugins-official
code-modernization: recommended workspace settings use Write(path) rules that never match
- Dominant language
- Python
- Stars
- 36.3k
- Forks
- 4.1k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 539
Description
`plugins/code-modernization/README.md`, the **Recommended workspace setup** section (lines 88–95), tells readers to put this in the project they're modernizing:
```json
{
"permissions": {
"allow": ["Read(**)", "Write(analysis/**)", "Write(modernized/**)", "Edit(analysis/**)", "Edit(modernized/**)"],
"deny": ["Edit(legacy/**)", "Write(legacy/**)"]
}
}
```
File permission checks only ever match `Edit(path)` rules, and `Edit` covers every file-editing tool including Write. The three `Write(...)` entries therefore never match anything. Copying the block into a project's `.claude/settings.json` produces a startup warning per entry:
```
Permission allow rule (.claude/settings.json): Write(analysis/**) is not matched by
file permission checks — only Edit(path) rules are. Use Edit(analysis/**) instead
(Edit rules cover all file-editing tools).
```
**This is a docs problem, not a security one.** The `Edit(...)` rules sitting alongside them already do the work, so the containment the section describes was never weakened — `deny: Edit(legacy/**)` blocks writes to `legacy/` on its own. The risk is that readers copy the pattern into their own settings and learn a rule form that silently does nothing.
Suggested replacement:
```json
{
"permissions": {
"allow": ["Read(**)", "Edit(analysis/**)", "Edit(modernized/**)"],
"deny": ["Edit(legacy/**)"]
}
}
```
A line after the block noting that `Edit(...)` covers every file-editing tool would stop the `Write` entries being added back.
I grepped the rest of the repo for the same pattern — `Write(`, `MultiEdit(`, and `NotebookEdit(` with a path argument — and this README is the only site.
I opened #5332 with exactly this change (one file, +4/−2), but the repo's automation auto-closes external PRs since `code-modernization` is an internal plugin, so I'm raising it here instead. The diff on that PR is still viewable if it's useful.
Contributor guide
No contributing guide indexed for this repository
Research direction
Open plugins/code-modernization/README.md and inspect the Recommended workspace setup section at lines 88–95, then compare it with the proposed replacement in the issue. Done means the example no longer contains ineffective Write(path) entries and explicitly notes that Edit(path) covers file-editing tools.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100