Repository navigation
Conversation
Rule matching reads `:*`, `*:*`, `::*` and `*:**` as broad wildcards. That errs on the safe side for a deny or ask rule. As an allow rule it made the Claude hook auto-approve what it rewrites, while Claude Code does not read them as every command, so without RTK the same settings prompt, and under `-p` the tool call does not run. The Claude settings loader now skips an allow rule that names no command and spells its wildcard with a colon, and Claude Code keeps that decision. Hosts that read Claude's settings through this loader get the same rules. `*` and `**`, which Claude Code does read as every command, and rules naming a command such as `git:*`, still allow. Deny and ask rules keep the broad reading, and Cursor's and Gemini's own rules are untouched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
📊 Automated PR Analysis
SummaryFixes RTK's Claude settings loader so colon-spelled catch-all patterns ( Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
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.
Summary
With
Bash(:*)orBash(*:*)inpermissions.allow, the Claude hook auto-approves every command it rewrites, while Claude Code on its own prompts, and under-pthe tool call doesn't run. RTK's matcher reads these spellings as wildcards, which is right for a deny or ask rule and too generous for an allow rule.The Claude settings loader now skips an allow rule that names no command and spells its wildcard with a colon, so Claude Code keeps that decision. Hosts that read Claude's settings through this loader get the same rules.
Unchanged:
*and**, which Claude Code does read as every command; rules naming a command such asgit:*; deny and ask rules; Cursor's and Gemini's own rules.Measured
Claude Code 2.1.318 in
-pmode against a mock API, one scriptedgit status && touch marker:Bash(*)Bash(**)Bash(git:*),Bash(touch:*)Bash(:*)Bash(*:*)Bash(*:**)Not in this PR
Rules that name a command can still read wider than Claude Code does, for example
Bash(*:rm)orBash(git -C * status:*), which #1105 asked for. That needs a stricter allow reading rather than a list of spellings. How Cursor and Gemini read these spellings wasn't checked.Test plan
cargo fmt --all,cargo clippy --all-targets,cargo test --all, and both with--no-default-featuresrtk hook claudeandrtk rewriteend to end intests/hook_decision_protocol_test.rs🤖 Generated with Claude Code