Skip to content

Fix regex for claude-code-settings tool permission rules - #6359

Open
pieterb wants to merge 2 commits into
SchemaStore:masterfrom
pieterb:patch-1
Open

pieterb wants to merge 2 commits into
SchemaStore:masterfrom
pieterb:patch-1

Conversation

@pieterb

@pieterb pieterb commented Sep 15, 2026

Copy link
Copy Markdown

Claude Code writes tool permission rules that didn't match the regex pattern. Specifically, Claude Code writes permission rules with nested parentheses.

Normally, left/right parentheses matching is beyond the capabilities of regex validation, but Claude Code escapes the nested parentheses with a backslash. For example:

Bash(python3 -c "import sys,json; d=json.load\(sys.stdin\); print\('OK' if d.get\('id'\) else d\)")

The added test case fails with the old regex, but passes the new regex.

Claude Code writes tool permission rules that didn't match the regex pattern. Specifically, Claude Code writes permission rules with nested parentheses.
Normally, left/right parentheses matching is beyond the capabilities of regex validation, but Claude Code escapes the nested parentheses with a backslash. For example:

`Bash(python3 -c "import sys,json; d=json.load\(sys.stdin\); print\('OK' if d.get\('id'\) else d\)")`
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the PR!

This section of the codebase is owned by @domdomegg, @bogini, @sarahdeaton, and @ant-kurt - if they write a comment saying "LGTM" then it will be merged.

@pieterb pieterb changed the title Patch 1 Fix regex for claude-code-settings tool permission rules Sep 15, 2026
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