[BUG] OSC 9;4 progress bar clears during tool execution instead of staying visible across the full turn

Resolved 💬 1 comment Opened Apr 30, 2026 by QAInsights Closed May 1, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When terminalProgressBarEnabled: true, the OSC 9;4 progress indicator is only emitted while the model is generating tokens. As soon as the model pauses to dispatch a tool call, Claude Code emits OSC 9;4 CLEAR and the terminal indicator disappears. It reappears when the model resumes generation, then disappears again for the next tool call. This causes a flickering indicator on terminals that render OSC 9;4 (Ghostty, Windows Terminal, recent iTerm2, ConEmu).

What Should Happen?

The progress indicator stays visible for the entire turn — ideally indeterminate (OSC 9;4 state 3) during tool execution, and running with a percent during model generation (or indeterminate throughout is fine).

Error Messages/Logs

Steps to Reproduce

  1. Run Claude Code inside a terminal that renders OSC 9;4 (Ghostty, Windows Terminal, iTerm2 3.5+).
  2. Ensure terminalProgressBarEnabled is true.
  3. Send a prompt that triggers several tool calls (e.g. "read these 5 files and summarize").
  4. Watch the terminal's tab / title bar progress indicator.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.123

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

Other

Additional Information

Root cause (from reversed binary)

The progress emitter maps Claude's internal completed / null state to OSC 9;4 state 0 (CLEAR):

case "running": emit OSC 9;4 state=1 percent // model generating
case "indeterminate": emit OSC 9;4 state=3
case "error": emit OSC 9;4 state=2
case "completed": emit OSC 9;4 state=0 // CLEAR <-- fires between tool calls
null/empty: emit OSC 9;4 state=0 // CLEAR

The transition to completed happens when a model turn ends, including the intermediate stops used to hand off to tools within a single user turn.

Proposed fix (either works)

  1. Preferred: switch to indeterminate state while a tool call is in flight instead of completed / CLEAR. Progress semantics at the user level are "the agent is still working," which remains true during tool execution.
  2. Alternative: add a setting, e.g. terminalProgressBarScope: "generation" | "turn" (default "turn"), to keep the indicator alive across tool calls in a single turn and only CLEAR when the full turn completes.

Why it matters

The indicator's whole value is signaling "Claude is still working, don't switch away." Flickering it off during tool calls, which can take many seconds or minutes, defeats the purpose — it looks like Claude is idle when it is actually the busiest

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗