Summary
Wildcard patterns in ALLOWED_TOOLS (e.g., Bash(git *)) don't appear to work correctly. Even setting ALLOWED_TOOLS="*" still results in permission denials.
This was split from #143 which addressed the display bug for denied commands.
Evidence
User 1 (from #143)
ALLOWED_TOOLS="Write,Read,Edit,Bash(git *),Bash(npm *),Bash(pytest)"
Result: git commit commands blocked
User 2 (from #143)
ALLOWED_TOOLS="*" # Allow EVERYTHING
Result: Still got permission denied after 1 API call
[2026-02-01 11:56:33] [SUCCESS] 🏁 Graceful exit triggered: permission_denied
Current Implementation
In ralph_loop.sh lines 950-960, tools are added to the command array:
if [[ -n "$CLAUDE_ALLOWED_TOOLS" ]]; then
CLAUDE_CMD_ARGS+=("--allowedTools")
local IFS=','
read -ra tools_array <<< "$CLAUDE_ALLOWED_TOOLS"
for tool in "${tools_array[@]}"; do
tool=$(echo "$tool" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
if [[ -n "$tool" ]]; then
CLAUDE_CMD_ARGS+=("$tool")
fi
done
fi
This looks correct - tools are properly split and added.
Investigation Needed
-
Verify --allowedTools flag is reaching Claude CLI
- Add debug logging to print the actual command being executed
- Confirm the tools array is populated correctly
-
Test Claude CLI directly
- Does
claude --allowedTools "Bash(git *)" -p "run git status" work?
- Does
claude --allowedTools "*" -p "run npm install" work?
- Test both interactive and non-interactive modes
-
Check Claude CLI documentation
- Does Claude CLI support
* as "allow all"?
- What's the correct wildcard syntax for
Bash commands?
- Is there a difference between
Bash(git *) vs Bash(git:*)?
-
Mode-specific behavior
- Does the
-p flag (non-interactive) have different permission handling?
- Does
--continue affect permissions?
Possible Causes
- Claude CLI doesn't support
* as "allow all tools"
- Claude CLI doesn't support space-based wildcards in non-interactive mode
- The
--allowedTools flag isn't being passed in all code paths
- Shell escaping issues when building the command
Related
Summary
Wildcard patterns in
ALLOWED_TOOLS(e.g.,Bash(git *)) don't appear to work correctly. Even settingALLOWED_TOOLS="*"still results in permission denials.This was split from #143 which addressed the display bug for denied commands.
Evidence
User 1 (from #143)
ALLOWED_TOOLS="Write,Read,Edit,Bash(git *),Bash(npm *),Bash(pytest)"Result:
git commitcommands blockedUser 2 (from #143)
Result: Still got permission denied after 1 API call
Current Implementation
In
ralph_loop.shlines 950-960, tools are added to the command array:This looks correct - tools are properly split and added.
Investigation Needed
Verify
--allowedToolsflag is reaching Claude CLITest Claude CLI directly
claude --allowedTools "Bash(git *)" -p "run git status"work?claude --allowedTools "*" -p "run npm install"work?Check Claude CLI documentation
*as "allow all"?Bashcommands?Bash(git *)vsBash(git:*)?Mode-specific behavior
-pflag (non-interactive) have different permission handling?--continueaffect permissions?Possible Causes
*as "allow all tools"--allowedToolsflag isn't being passed in all code pathsRelated
lib/response_analyzer.sh- Permission denial extractionralph_loop.sh-build_claude_command()function