Repository navigation
Conversation
A `:*` suffix is equivalent to a trailing ` *`, so `Bash(prefix:*)` only matches when the command continues with a space. A rule like `Bash(gh api --method PATCH repos/o/r/issues/comments/:*)` therefore never matches `gh api --method PATCH repos/o/r/issues/comments/12345`, and the command is silently denied (anthropics#1823). parseSdkOptions now logs a warning for allowedTools and disallowedTools rules ending in `/:*` or `=:*`, suggesting the `prefix*` form. The rule is still passed through unchanged. Also documents the behavior in docs/configuration.md. Refs anthropics#1823 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This branch has not been deployed
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
Refs #1823.
In Claude Code, a
:*suffix means the same as a trailing*, soBash(prefix:*)only matches when the command continues with a space (permissions docs). #1823 used this rule:The command it was meant to allow puts the comment ID directly after the slash (
.../comments/12345), so the rule never matches and the edit is denied every time. The create path (gh pr comment 5 ...) has a space after the prefix, which is why it worked. The action passes the rule through unchanged, so parsing isn't the problem. The rule is just easy to get wrong, and nothing tells you.Changes
parseSdkOptionslogscore.warningfor anyallowedTools/disallowedToolsrule ending in/:*or=:*, and suggests theprefix*form. The rule is still passed through unchanged, so this can't break an existing workflow./and=, which are almost always followed directly by more text. Rules likeBash(git -C .:*)orBash(gh pr comment:*)can legitimately be followed by a space, so they don't warn.docs/configuration.mdexplaining the rule with the comment-ID example.Testing
base-action/test/parse-sdk-options.test.ts: warns for/:*in allowedTools, warns for=:*in disallowedTools, no warning for the rule shapes used in the docs and examples.bun test(969 pass),bun run typecheck,bun run format:checkall pass.🤖 Generated with Claude Code