[BUG] Git commands should use robust flags to bypass user gitconfig customizations

Resolved 💬 4 comments Opened Sep 1, 2025 by jchia Closed Jan 5, 2026

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.98
  • Operating System: Ubuntu 24.04
  • Terminal: Gnome Terminal

Bug Description

Claude Code's git commands can fail or produce unparseable output when users have customized .gitconfig with external tools, custom pagers, or format settings.

Steps to Reproduce

  1. Configure ls as external diff tool: git config diff.external ls
  2. Ask Claude Code to show diff between two commits
  3. Command crashes with "fatal: external diff died, stopping at..."

Expected Behavior

Claude Code should receive standard, parseable, git output in a consistent format regardless of user git configuration.

Actual Behavior

Git commands fail to produce a diff, or produces custom-formatted diff output that Claude Code cannot parse reliably, breaking functionality.

Additional Context

  • Although users typically don't do extreme things like git config diff.external ls, less extreme things like git config diff.external difft are common and can change formatting and parsing.
  • The issue affects multiple git commands: diff, show, log, status
  • Workaround: git --no-pager diff --no-ext-diff works correctly
  • Suggested fix: For git diff, use robust flags like --no-ext-diff, --no-pager, --no-color by default. Other commands may require different measures.

View original on GitHub ↗

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