Git commit doesn't show the actual commit message

Resolved 💬 5 comments Opened Jul 3, 2025 by prndP Closed Aug 20, 2025

Problem

When using the Bash tool with heredoc patterns like git commit -m "$(cat <<'EOF'...)", the tool only returns command success status and basic output, but doesn't echo back the actual content that was constructed via the heredoc. This creates a blind spot where users can't verify that:

  1. The heredoc content was formatted correctly
  2. Multi-line content was properly constructed
  3. Specific feedback or corrections were applied accurately

Example

Command:

  git commit -m "$(cat <<'EOF'
  feat: add user authentication system

  - Implement JWT token handling
  - Add login/logout endpoints
  - Create user session management
  - Fix password validation bug

  🤖 Generated with Claude Code
  EOF
  )"

Current tool output:

  [main abc1234] feat: add user authentication system
   3 files changed, 45 insertions(+), 2 deletions(-)

Issue: There's no way to verify that the full multi-line commit message was actually written correctly, or that specific bullet points were included/excluded as intended.

Suggested Improvement

Show the full commit message content in the tool result, either:

  1. Echo back the complete message after successful commit
  2. Add an optional flag to display the message content
  3. Include the full message in the tool response alongside the

current file stats

Impact
This would help users:

  • Verify commit message formatting is correct
  • Confirm that feedback/corrections were properly applied
  • Catch heredoc syntax issues before they become part of commit

history

  • Build confidence in the git workflow automation

Workaround
Currently users need to run git log -1 --pretty=format:"%B" as a separate command to see what was actually committed.

View original on GitHub ↗

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