[BUG] Auto-approve patterns don't match multiline commands
Resolved 💬 3 comments Opened Apr 8, 2026 by ducminh-phan Closed May 21, 2026
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?
I open a new issue as suggested here. Auto-approval patterns do not work, even with the suggested pattern when the user is prompted.
What Should Happen?
Bash(PGOPTIONS='-c default_transaction_read_only=on' psql *) should work, and the command is auto-approved
Error Messages/Logs
Steps to Reproduce
- In
.claude/settings.local.json:
{
"permissions": {
"allow": [
"Bash(PGOPTIONS='-c default_transaction_read_only=on' psql *)"
]
}
}
- The agent runs this command
Bash command
PGOPTIONS='-c default_transaction_read_only=on' psql -X "postgres://<redacted>" -c "
SELECT datname, usename, state, count(*)
FROM pg_stat_activity
WHERE pid <> pg_backend_pid()
GROUP BY datname, usename, state
ORDER BY count DESC;
" 2>&1
Query connection counts
This command requires approval
Do you want to proceed?
❯ 1. Yes
2. Yes, and don’t ask again for: PGOPTIONS='-c default_transaction_read_only=on' psql:*
3. No
- I select option 2,
"Bash(PGOPTIONS='-c default_transaction_read_only=on' psql:*)"is added to.claude/settings.local.json. Then the agent runs another query and still asks for approval.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.94 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗