settings.local.json permissions not honored in --print mode
Description
When running claude --print --permission-mode acceptEdits, the permissions.allow and permissions.deny lists in .claude/settings.local.json are not applied. All Bash commands are denied regardless of matching allow patterns.
Steps to Reproduce
- Create
.claude/settings.local.json:
{
"permissions": {
"allow": ["Bash(git *)", "Bash(gh pr *)", "Bash(echo *)"],
"deny": []
}
}
- Run:
claude --print --permission-mode acceptEdits --verbose --output-format stream-json "run echo hello"
- The
echo hellocommand is denied despite matchingBash(echo *)in the allow list.
Expected Behavior
Bash commands matching patterns in permissions.allow should be auto-approved, same as in interactive mode.
Actual Behavior
All Bash commands are denied. The permission_denials array in the JSONL result output contains every Bash tool use, including ones that match allow patterns.
Environment
- Claude Code version: 2.1.76
- Platform: Linux (Docker container on amd64), also reproduced on macOS ARM
- The same
settings.local.jsonworks correctly in interactive (non---print) mode
Impact
This makes --print mode unusable for automated workflows that need Bash access (e.g., CI/CD, fleet management tools). The workaround is --permission-mode bypassPermissions which removes all permission controls.
Workaround
Using --permission-mode bypassPermissions instead of acceptEdits bypasses the issue but also bypasses all permission controls, including deny lists.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗