claude-code - 💡(How to fix) Fix Allow annotating settings.json entries (esp. permissions.allow) — JSON forbids comments

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

  • why a rule exists,
  • what it pairs with (e.g. an allow rule that only suppresses a prompt because a PreToolUse hook is the real guard),
  • when/whether it's safe to remove.
RAW_BUFFERClick to expand / collapse

Feature request: allow annotating settings.json (esp. permissions.allow) entries

Problem

~/.claude/settings.json (and project .claude/settings.json) is strict JSON, which forbids comments. That makes it impossible to annotate individual entries inline — most painfully in permissions.allow/permissions.deny, where each entry is a bare pattern string with no room to explain:

  • why a rule exists,
  • what it pairs with (e.g. an allow rule that only suppresses a prompt because a PreToolUse hook is the real guard),
  • when/whether it's safe to remove.

This hurts auditability and safe reverts. Concrete example: I added "Bash(sed -n *)" to permissions.allow purely as ergonomics for a read-only idiom, with a PreToolUse hook (guard-sed.sh) as the actual security guard that blocks in-place sed. There is no way to record that relationship next to the allow entry — the rationale has to live in a separate README, which drifts from the file it documents. A reviewer reading settings.json cold sees an unexplained allow rule.

Requested options (any one would help)

  1. Accept JSONC (// and /* */ comments) for settings.json / settings.local.json, as VS Code does for its settings. Lowest-friction; matches developer expectations.
  2. Structured permission rules with an optional comment/description field, e.g. allow entries that may be either "Bash(sed -n *)" or { "pattern": "Bash(sed -n *)", "comment": "read-only; guard-sed.sh blocks in-place sed" }.
  3. A sidecar annotations map keyed by rule string (less ideal — drifts when rules change).

Option 1 or 2 preferred.

Why it matters

As permission allowlists and hook setups grow, undocumented entries accumulate and become risky to touch — exactly the rules where intent matters most. Inline annotation keeps the rationale next to the rule, supporting safe audit and revert.

Environment

Claude Code CLI, user-level ~/.claude/settings.json. macOS.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Allow annotating settings.json entries (esp. permissions.allow) — JSON forbids comments