Open1

ClaudeCodeのsettings.jsonにコメント記載アイディア

sunakansunakan

"comment: .*" でも "_comment: .*" でもOK

{
  "permissions": {
    "deny": [
      "_description: 特定のファイル操作を全て禁止",
      "Read(.env*)", "Edit(.env*)", "Write(.env*)", "Bash(*:.env*)",
      "Read(**/.env*)", "Edit(**/.env*)", "Write(**/.env*)", "Bash(*:**/.env*)",
      // ...
      "_description: 特定のディレクトリ以下の操作を全て禁止",
      "Read(~/.aws/**)", "Edit(~/.aws/**)", "Write(~/.aws/**)", "Bash(*:~/.aws/**)",
      "Read(**/.aws/**)", "Edit(**/.aws/**)", "Write(**/.aws/**)", "Bash(*:**/.aws/**)",
      // ...
      "_description: 危険コマンド禁止",
      // ...
      "_description: 個別",
      // ...
    ]
  }
}

ラップしたscriptなどを挟まれると防げないので、絶対ではない

2025年7月26日頃
Feature Request: Add a formal description field for comments in settings.json #4475
これはフィールド用