Skip to content

fix: warn when a :* tool rule follows a slash or equals sign - #1834

Open
rmnvg wants to merge 1 commit into
anthropics:mainfrom
rmnvg:fix/warn-colon-star-after-non-word-prefix
Open

rmnvg wants to merge 1 commit into
anthropics:mainfrom
rmnvg:fix/warn-colon-star-after-non-word-prefix

Conversation

@rmnvg

@rmnvg rmnvg commented Sep 15, 2026

Copy link
Copy Markdown

Summary

Refs #1823.

In Claude Code, a :* suffix means the same as a trailing *, so Bash(prefix:*) only matches when the command continues with a space (permissions docs). #1823 used this rule:

Bash(gh api --method PATCH repos/<owner>/<repo>/issues/comments/:*)

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

  • parseSdkOptions logs core.warning for any allowedTools / disallowedTools rule ending in /:* or =:*, and suggests the prefix* form. The rule is still passed through unchanged, so this can't break an existing workflow.
  • The check only covers / and =, which are almost always followed directly by more text. Rules like Bash(git -C .:*) or Bash(gh pr comment:*) can legitimately be followed by a space, so they don't warn.
  • Adds a short note to docs/configuration.md explaining the rule with the comment-ID example.

Testing

  • 3 new tests in 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:check all pass.

🤖 Generated with Claude Code

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant