[BUG] HEREDOC git commit command fragment incorrectly captured in settings.local.json permissions

Resolved 💬 5 comments Opened Nov 29, 2025 by telos27 Closed Jan 31, 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?

When approving a git commit command that uses HEREDOC format, a fragment of the commit message content is incorrectly captured and added
to the permissions.allow array in .claude/settings.local.json, corrupting the file with invalid data.

The malformed entry looked like:
"Bash(3\")\n- Identified C-rule issue: universal rules flagged incorrectly\n\n🤖 Generated with Claude
Code
\n\nCo-Authored-By: Claude <noreply@anthropic.com>\nEOF\n)\")"

What Should Happen?

The permission should capture a valid command pattern like "Bash(git commit:*)" instead of a fragment of the HEREDOC content.

Error Messages/Logs

Steps to Reproduce

  1. Use Claude Code to make a git commit with HEREDOC message format:

git commit -m "$(cat <<'EOF'
Commit message here

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"

  1. Approve the command when prompted
  2. Check .claude/settings.local.json - a corrupted entry appears in permissions.allow

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.55

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗