claude-code - 💡(How to fix) Fix [BUG] Status line renders raw ANSI escape code \033[0m after cost value [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46467Fetched 2026-04-11 06:19:32
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

The status line displays the raw ANSI escape sequence \033[0m as literal text after the cost value instead of interpreting it as a color reset.

Root Cause

The status line displays the raw ANSI escape sequence \033[0m as literal text after the cost value instead of interpreting it as a color reset.

Code Example

$4.972\033[0m  ctx:5%  Opus 4.6 (1M context)

---

$4.972  ctx:5%  Opus 4.6 (1M context)
RAW_BUFFERClick to expand / collapse

Description

The status line displays the raw ANSI escape sequence \033[0m as literal text after the cost value instead of interpreting it as a color reset.

Observed

$4.972\033[0m  ctx:5%  Opus 4.6 (1M context)

Expected

$4.972  ctx:5%  Opus 4.6 (1M context)

The \033[0m reset code should either be interpreted (resetting terminal color) or not emitted at all in the status line.

Environment

  • macOS, zsh terminal
  • Claude Code CLI
  • Model: Opus 4.6 (1M context)

extent analysis

TL;DR

The issue can be fixed by properly handling ANSI escape sequences in the status line output.

Guidance

  • Verify if the Claude Code CLI supports disabling ANSI escape sequences or provides an option to handle them correctly.
  • Check the documentation of the Opus model to see if it has any configuration options related to output formatting.
  • Investigate if the zsh terminal settings or configuration files (e.g., .zshrc) are interfering with the interpretation of ANSI escape sequences.
  • Consider using a library or function that can strip or handle ANSI escape sequences in the output string.

Example

No code snippet is provided as the issue does not imply a specific programming language or codebase.

Notes

The solution may depend on the specific implementation of the Claude Code CLI and the Opus model. Additional information about the codebase or configuration files may be necessary to provide a more accurate fix.

Recommendation

Apply a workaround to handle ANSI escape sequences in the output string, as the root cause of the issue is likely related to the incorrect interpretation of these sequences.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING