[BUG] Multi-line bash commands saved as full permission entries, corrupting settings.local.json
Description
When a user approves a multi-line bash command (like gh issue create with a heredoc body), Claude Code saves the entire command including the multi-line body as a permission entry in settings.local.json, instead of just the command prefix.
This corrupts the settings file and causes parsing errors on next session.
Steps to Reproduce
- Run a command like:
gh issue create --repo foo/bar --title "Title" --body "$(cat <<'EOF'
Multi-line
body
here
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/16462
- https://github.com/anthropics/claude-code/issues/12658
- https://github.com/anthropics/claude-code/issues/16004
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 Generated with Claude Code
This issue has been automatically closed as a duplicate of #16462.
If this is incorrect, please re-open this issue or create a new one.
🤖 Generated with Claude Code
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.