Permission matching fails for commands using <<< (here-string) syntax
Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Workaround ✓ Mentioned in thread ↓
Activity 6 comments · opened Mar 22, 2026 · closed Apr 8, 2026
💡 Likely answer: A maintainer (bcherny, collaborator)
responded on this thread — see the highlighted reply below.
Description
Bash permission allowlist entries like Bash(cut:*), Bash(tr:*), Bash(uniq:*) fail to match when the command uses <<< (here-string) syntax, even though the command prefix is correct.
Steps to reproduce
- Add
Bash(cut:*)to permissions insettings.json - Run a command without
<<<:cut --help— auto-allowed - Run a command with
<<<:cut -d' ' -f1 <<< "hello world"— prompts for permission
Expected behavior
Both commands start with cut and should match Bash(cut:*).
Actual behavior
Only commands without <<< are matched. The here-string syntax causes the permission check to fail.
Affected commands
Any command using <<<, confirmed with cut, tr, and uniq. Piping via echo "..." | cut ... works as a workaround (matched by Bash(echo:*)).
6 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Not a duplicate — this is specifically about
<<<(here-string) syntax breaking permission matching, which is distinct from the suggested duplicates:2>&1(output redirects)#character()While all are in the same class of "shell special syntax breaks Bash permission glob matching",
<<<is a different operator (here-string input redirection) and may need a separate fix depending on how the matcher is implemented.Environment
Workaround: Use pipe syntax instead of here-strings until this is fixed.
The permission matcher parses the command prefix to check against your allowlist.
<<<confuses the parser because it changes the command structure — the string after<<<gets treated as part of the command rather than input.If you want to auto-approve the pipe variant, your
Bash(echo:*)permission will match the full pipeline sinceechois the first command.Workaround: Use pipe syntax instead of here-strings until this is fixed.
The permission matcher parses the command prefix to check against your allowlist.
<<<confuses the parser because it changes the command structure — the string after<<<gets treated as part of the command rather than input.If you want to auto-approve the pipe variant, your
Bash(echo:*)permission will match the full pipeline sinceechois the first command.Thanks for the report. This is fixed in v2.1.85.
In v2.1.81 the new shell parser (which handles
<<<here-strings correctly) was still gated to internal builds only, so external users fell back to the legacy regex checks that tripped on<<<. v2.1.85 removed that gate — all builds now use the new parser.Verified on current main:
cut -d' ' -f1 <<< "hello world"with allow ruleBash(cut:*)returnsallow. Please upgrade and reopen if you still see it.This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.