Expand .claude/settings.json with read-only permissions and schema reference#2983
Expand .claude/settings.json with read-only permissions and schema reference#2983
Conversation
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>
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Suggested labelsenhancement 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Comment |
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>
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
.claude/settings.json
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Why
The previous
.claude/settings.jsononly 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 toolsWebSearch,WebFetch— web research (API docs, error messages, etc.)Bash(git log:*),git status,git diff,git show,git branch— read-only git inspectionBuild & development workflow:
Bash(./build.sh:*)— the main build wrapper covering all targets (compile, test, lint, format, watch)Bash(dotnet restore:*)— package restoreBash(dotnet test:*)— direct test runsBash(dotnet run:*)— covers bothdotnet run --project buildanddotnet run --project src/tooling/docs-builderBash(dotnet format:*)— formatting and lint checksBash(dotnet watch:*)— watch mode developmentBash(dotnet workload:*)— workload management (aspire etc.)Bash(npm ci:*),npm run lint,npm run fmt:*,npm run test:*,npm run watch:*— JS toolchainNot pre-approved (still prompt):
dotnet publish, container builds, docker — these have broader impact and are infrequent enough that a prompt is appropriate.$schemaadded for IDE autocomplete and validation via SchemaStore.🤖 Generated with Claude Code