-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
bugSomething isn't workingSomething isn't workingp2Non-showstopper bug or popular feature requestNon-showstopper bug or popular feature request
Description
Bug Description
When using multiline YAML for claude_args with Bash tool patterns that contain spaces (like Bash(git diff --name-only HEAD~1)), the SDK incorrectly parses the --allowedTools argument by splitting on spaces.
Reproduction
claude_args: |
--max-turns 15
--allowedTools Bash(git diff --name-only HEAD~1),Bash(git diff HEAD~1),Read,Glob,GrepExpected Behavior
SDK should parse allowedTools as:
["Bash(git diff --name-only HEAD~1)", "Bash(git diff HEAD~1)", "Read", "Glob", "Grep"]Actual Behavior
SDK parses allowedTools as:
["Bash", "git", "diff"]From the logs:
SDK options: {
"allowedTools": [
"Bash",
"git",
"diff"
],
...
"extraArgs": {
"max-turns": "15",
"name-only": "HEAD~1"
},
...
}
Note that --name-only HEAD~1 is also incorrectly parsed as a separate extraArg.
Evidence
Full error:
SDK execution error: error: Claude Code process exited with code 1
Workaround
Put everything on a single line with quotes:
claude_args: --max-turns 15 --allowedTools "Bash(git diff --name-only HEAD~1),Bash(git diff HEAD~1),Read,Glob,Grep"Environment
- Action version:
anthropics/claude-code-action@v1 - Runner:
ubuntu-latest - Event:
pull_request
Notes
The migration guide shows multiline claude_args examples, but they don't include Bash tools with spaces:
claude_args: |
--max-turns 15
--allowedTools Edit,Read,Write,BashThe issue appears to be that shell-quote (or whatever parser is used) doesn't handle the multiline + spaces-in-arguments combination correctly.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingp2Non-showstopper bug or popular feature requestNon-showstopper bug or popular feature request