[Bug] Claude Code injecting ANSI escape sequences into commit messages and PR descriptions

Status Fixed / completed
Reported on v2.1.71
Maintainer reply None cached
Activity 3 comments · opened Mar 9, 2026 · closed Mar 11, 2026

Bug Description

Despite giving it explicit instructions not to, Claude Code has once again injected ANSI/termimal escape characters into my commit messages and pull request descriptions. I do not really understand why it does this, but even if Anthropic isn't willing to fix this, I would at least love some documentation or guidance on how to fix this going forward (putting things in CLAUDE or similar files is unreliable).

I've reported this before but it was closed as a "duplicate". Similar issues include:

Very tired of wasting credits telling the clanker to go back and fix this.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.71
  • Feedback ID: 10f14eee-6365-48db-af05-9da101726b7e

<img width="861" height="203" alt="Image" src="https://github.com/user-attachments/assets/9de2fb51-a2bc-446d-82ce-f07ab9395ea7" />

View original on GitHub ↗

3 Comments

himynameisdave · 7 months ago

Please don't close this as a duplicate/staleness!

himynameisdave · 7 months ago

I _think_ this could be a conflict with pygmentize that I have configured locally and I think might be conflicting with some stuff. Happy to close this out for now and reopen if I see the issue.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.