[BUG] Brace expansion check inconsistently triggers on single-quoted JSON arguments
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The "Brace expansion" security check inconsistently triggers on commands with single-quoted JSON arguments. Same allowlist pattern Bash(baragi *), same JSON structure — one command passes, another prompts.
baragi is my own cli command to manage tasks, work items
Passes (no prompt):baragi next --json='{"fields":["title","status","priority","is_blocked"]}'
Prompts ("Brace expansion"):baragi work get WORK-262 --json='{"fields":["title","status","priority","description","acceptance_criteria","depends_on","labels","parent_id"]}'
Both have {...,....} inside single quotes. The braces cannot expand.
Regression? — Yes, started around 2.1.90
Version — 2.1.90
Platform — Anthropic API
OS — macOS
Terminal — ghostty
You can attach your screenshot too.
What Should Happen?
Both commands should be auto-allowed without prompting, since Bash(baragi *) is in the allowlist and the braces are inside single quotes where shell brace expansion cannot occur.
Error Messages/Logs
Claude says "Brace expansion" and asking permissions
Steps to Reproduce
- Add
Bash(baragi *)to the allow list in~/.claude/settings.json(baragi is a custom CLI tool for task management — not publicly available, but the issue is reproducible with any CLI tool that accepts JSON arguments) - Run a command with short JSON containing braces — auto-allowed:
````
baragi next --json='{"fields":["title","status","priority","is_blocked"]}'
- Run a command with longer JSON (more comma-separated values) — prompts with "Brace expansion":
````
baragi work get WORK-262 --json='{"fields":["title","status","priority","description","acceptance_criteria","depends_on","labels","parent_id"]}'
This is not a baragi-side issue — the permission prompt appears before the command is executed. Claude Code's own "Brace expansion" check intercepts the command at the permission layer. The JSON is inside single quotes, so the shell would never perform brace expansion. The issue is that Claude Code's detector doesn't respect quoting context.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.89
Claude Code Version
2.1.90
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗