Reduce Claude Code permission prompts#46
Merged
Conversation
The `gh api` PreToolUse hook matched the endpoint path, so read-only GETs to `comments`/`reviews` endpoints prompted for confirmation just like writes. Common test and lint commands like `bundle exec rspec` and `uv run pytest` also prompted on every run. Narrow the hook to fire only when the call actually mutates (has `-X POST/PATCH/PUT/DELETE` or field flags), and add an `allow` list covering those test runners plus read-only checks (`uv run pyright`, `uv run black --check`). Also fix `deep_merge` in `bootstrap.sh` to union list values instead of replacing them. Previously the `allow` array in `settings.local.json` overwrote any tracked `allow` entries in `settings.json`, so these new rules would have been wiped on the next bootstrap. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
gh apiPreToolUse hook matched the endpoint path, so read-only GETs tocomments/reviewsendpoints prompted for confirmation just like writes. Common test and lint commands likebundle exec rspecanduv run pytestalso prompted on every run.Narrow the hook to fire only when the call actually mutates (has
-X POST/PATCH/PUT/DELETEor field flags), and add anallowlist covering those test runners plus read-only checks (uv run pyright,uv run black --check).Also fix
deep_mergeinbootstrap.shto union list values instead of replacing them. Previously theallowarray insettings.local.jsonoverwrote any trackedallowentries insettings.json, so these new rules would have been wiped on the next bootstrap.🤖 Generated with Claude Code