anthropics / anthropics/claude-plugins-official

code-modernization: recommended workspace settings use Write(path) rules that never match

オープン
#5,333 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
36.3k
フォーク
4.1k
平均マージ
2日 14時間
マージ済み PR(30日)
539

説明

`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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

領域
documentation
issue の種類
ドキュメント
難易度
1/5
見積もり時間
1時間未満
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。