Skip to content

Expand .claude/settings.json with read-only permissions and schema reference#2983

Merged
Mpdreamz merged 5 commits intomainfrom
feature/claude-settings
Mar 30, 2026
Merged

Expand .claude/settings.json with read-only permissions and schema reference#2983
Mpdreamz merged 5 commits intomainfrom
feature/claude-settings

Conversation

@Mpdreamz
Copy link
Copy Markdown
Member

@Mpdreamz Mpdreamz commented Mar 28, 2026

Why

The previous .claude/settings.json only pre-approved a handful of build commands, so every file read, search, web lookup, and common build step triggered an approval prompt. This creates friction during routine exploration and development — the most common things Claude does before and while making changes.

Read-only operations carry no risk of modifying the codebase, so requiring approval adds noise without adding safety. Common build/test commands are similarly low-risk and needed constantly during development.

What changed

Read-only exploration (no prompts):

  • Read, Glob, Grep — file exploration tools
  • WebSearch, WebFetch — web research (API docs, error messages, etc.)
  • Bash(git log:*), git status, git diff, git show, git branch — read-only git inspection

Build & development workflow:

  • Bash(./build.sh:*) — the main build wrapper covering all targets (compile, test, lint, format, watch)
  • Bash(dotnet restore:*) — package restore
  • Bash(dotnet test:*) — direct test runs
  • Bash(dotnet run:*) — covers both dotnet run --project build and dotnet run --project src/tooling/docs-builder
  • Bash(dotnet format:*) — formatting and lint checks
  • Bash(dotnet watch:*) — watch mode development
  • Bash(dotnet workload:*) — workload management (aspire etc.)
  • Bash(npm ci:*), npm run lint, npm run fmt:*, npm run test:*, npm run watch:* — JS toolchain

Not pre-approved (still prompt): dotnet publish, container builds, docker — these have broader impact and are infrequent enough that a prompt is appropriate.

$schema added for IDE autocomplete and validation via SchemaStore.

🤖 Generated with Claude Code

Common read-only tools (Read, Glob, Grep, WebSearch, WebFetch) and
git inspection commands previously required an approval prompt on
every invocation, interrupting exploration and research workflows.
Adding them to the allow list lets Claude work uninterrupted for
safe, non-mutating operations.

The $schema reference enables IDE autocomplete and validation via
SchemaStore, making future edits to this file less error-prone.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Mpdreamz Mpdreamz requested a review from a team as a code owner March 28, 2026 20:43
@Mpdreamz Mpdreamz requested a review from cotti March 28, 2026 20:43
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 28, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7f4fc416-4dff-4d01-add5-75514a63c088

📥 Commits

Reviewing files that changed from the base of the PR and between 82ec5e3 and 75e8d90.

📒 Files selected for processing (1)
  • .claude/settings.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • .claude/settings.json

📝 Walkthrough

Walkthrough

The .claude/settings.json file now includes a top-level "$schema" reference. The permissions.allow array was changed: removed Bash(find:*), Bash(wc:*), and the prior Bash(git grep:*); added capabilities Read, Glob, Grep, WebSearch, WebFetch; added specific Bash(git <subcommand>:*) patterns, Bash(./build.sh:*); broadened .NET (dotnet restore/test/run/format/watch/workload) and npm permissions (including Bash(npm ci:*) and more Bash(npm run ...) entries); retained Bash(npm exec:*), Bash(npm install:*), and Bash(npx tsc:*).

Suggested labels

enhancement

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: expanding .claude/settings.json with read-only permissions and adding a schema reference.
Description check ✅ Passed The description clearly explains the motivation, detailed changes made, and reasoning for the permission expansions, directly relating to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feature/claude-settings

Comment @coderabbitai help to get the list of available commands and usage tips.

Mpdreamz and others added 3 commits March 28, 2026 21:47
Add allow rules for ./build.sh (the main build wrapper for all targets),
dotnet subcommands (restore, test, run, format, watch, workload), and
common npm scripts (ci, lint, fmt, test, watch).

These are the day-to-day commands needed to compile, test, lint and run
the project. Pre-approving them avoids repeated prompts without opening
up destructive operations like publish or container builds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds read-only Unix pipeline tools (echo, head, tail, sort, uniq, cut,
tr, awk, sed, xargs, which, jq, diff, stat, date, uname, basename,
dirname) that Claude routinely uses for text processing and inspection
but which would otherwise trigger an approval prompt on every use.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The broad Unix utilities (sed, awk, xargs, echo, etc.) carry meaningful
risk since prefix-only matching allows destructive forms like sed -i or
xargs rm. Keeping only the high-value, project-specific commands where
the benefit clearly outweighs the risk.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/settings.json:
- Line 14: The current scope entry "Bash(git branch:*)" allows destructive git
branch flags; replace that entry with a read-only variant such as "Bash(git
branch --list:*)" (or simply "Bash(git branch --list)") so only branch listing
is permitted and flags like -d/-m or creation are disallowed; update the
settings JSON entry that currently contains "Bash(git branch:*)" to the safer
"Bash(git branch --list:*)" string.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 738c0032-7e48-45b6-9ecc-d77aa81795e6

📥 Commits

Reviewing files that changed from the base of the PR and between 1033c0d and 82ec5e3.

📒 Files selected for processing (1)
  • .claude/settings.json

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@Mpdreamz Mpdreamz merged commit 80f260a into main Mar 30, 2026
28 checks passed
@Mpdreamz Mpdreamz deleted the feature/claude-settings branch March 30, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants