Git Commit Message Escaping Fails with Incorrect Quote Handling

Resolved 💬 10 comments Opened May 13, 2025 by mattgodbolt Closed Nov 29, 2025

Bug Description
Claude has issues committing git messages that require escaping. I've tried many times to explain how to do it but it always ends in pain. Seems like it doesn't want to escape properly, and/or uses the wrong quotes. Even when CLAUDE.md tells it to use HEREDOC-style that doesn't help.

Environment Info

  • Platform: linux
  • Terminal: gnome-terminal
  • Version: 0.2.108
  • Feedback ID: 92766efb-1a14-43b6-a0ee-1063b15429a5

Errors

[{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at aQ (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:5909)\n    at file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:5645\n    at Array.map (<anonymous>)\n    at oh (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:5636)\n    at qJ6 (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:13025)\n    at C$ (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:104:19797)\n    at rE (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:42551)\n    at aE (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:38100)\n    at rN (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:38028)\n    at g$ (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:37882)","timestamp":"2025-05-13T14:09:48.508Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at aQ (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:5909)\n    at file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:5645\n    at Array.map (<anonymous>)\n    at oh (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:5636)\n    at qJ6 (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:13025)\n    at C$ (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:104:19797)\n    at rE (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:42551)\n    at aE (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:38100)\n    at rN (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:38028)\n    at g$ (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:37882)","timestamp":"2025-05-13T14:09:48.510Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at aQ (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:5909)\n    at file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:5645\n    at Array.map (<anonymous>)\n    at oh (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:5636)\n    at qJ6 (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:13025)\n    at C$ (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:104:19797)\n    at rE (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:42551)\n    at aE (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:38100)\n    at rN (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:38028)\n    at g$ (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:37882)","timestamp":"2025-05-13T14:09:48.511Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at aQ (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:5909)\n    at file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:5645\n    at Array.map (<anonymous>)\n    at oh (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:5636)\n    at qJ6 (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:1865:13025)\n    at C$ (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:104:19797)\n    at rE (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:42551)\n    at aE (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:38100)\n    at rN (file:///opt/compiler-explorer-old/node/lib/node_modules/@anthropic-ai/claude-code/cli.js:106:38028)\n    at g$ (file:///opt/compiler-explorer-old/node/lib/node_modul

Note: Error logs were truncated.

I'm not quite sure what all these errors are ^^ nothing obvious in my logs.

But try as I might Claude keeps trying to commit messages using things like:

git commit -m"Message with `backticks` and $DOLLAR_SIGNS"

which leads to errors and sometimes truncated and broken commit messages.

View original on GitHub ↗

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