[BUG] Bash tool's heredoc commit format triggers approval prompt on every commit regardless of auto-accept settings

Resolved 💬 6 comments Opened Mar 5, 2026 by AmitZoh Closed Apr 19, 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?

The Bash tool's system prompt instructs Claude to format all commit messages using a $() heredoc pattern:

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

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

Problem: This $() command substitution causes every git commit to require manual user approval, even when the user has auto-accept enabled. The shell substitution is presumably flagged as
potentially dangerous, bypassing the auto-accept setting.

Note: Trying to work around this with instructions in claude.md doesn't help

What Should Happen?

Expected behavior: Commits should respect auto-accept settings. The built-in example should use a format that doesn't trigger approval prompts, such as multiple -m flags or git commit -F
<file>.

Error Messages/Logs

Steps to Reproduce

  1. Make a code change
  2. Ask Claude to commit
  3. Claude generates a commit using the built-in heredoc pattern: git commit -m "$(cat <<'EOF' ... EOF)"
  4. User is prompted for approval even with "Accept edits" enabled
  5. This happens on every commit with no way to avoid it, since the Bash tool's system prompt hardcodes this format

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.69

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

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