claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Multi-line bash commands saved as full permission entries, corrupting settings.local.json

Open ThatDragonOverThere opened this issue 10 months ago • 1 comments

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

  1. Run a command like:
gh issue create --repo foo/bar --title "Title" --body "$(cat <<'EOF'
Multi-line
body
here

ThatDragonOverThere avatar Jan 16 '26 23:01 ThatDragonOverThere

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/16462
  2. https://github.com/anthropics/claude-code/issues/12658
  3. 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

github-actions[bot] avatar Jan 16 '26 23:01 github-actions[bot]

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

github-actions[bot] avatar Jan 20 '26 09:01 github-actions[bot]

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.

github-actions[bot] avatar Jan 27 '26 14:01 github-actions[bot]