[BUG] Custom status line content overlaps with resume hint on exit

Resolved 💬 2 comments Opened Apr 15, 2026 by DQNEO Closed May 24, 2026

Description

I customized status line as follows.

<img width="574" height="116" alt="Image" src="https://github.com/user-attachments/assets/5416d0c4-84c2-44db-abad-55f6ac0251a0" />

And after I exit:

<img width="708" height="80" alt="Image" src="https://github.com/user-attachments/assets/eae916e1-7c83-4935-beb3-26e5f4ced877" />

When I exit while using a custom status line command, the session is overlaps with status line. The "Resume this session with:" hint and the claude --resume <UUID> command are printed on top of the status line area, causing the two texts to overlap and produce garbled output.

Expected behavior

On exit, Claude Code should clear the status line area before printing the resume hint, so that the claude --resume <UUID> command is cleanly displayed and can be easily copied.

Actual behavior

The status line content remains on the terminal, and the resume hint overwrites it partially from the left. The result looks like:

Resume this session with:─────────────────────────────────────────────────
claude --resume a1cc35c4-3bf3-46bd-94b5-897222bfe4eet: 120k/1000k 12% | 292.7s                                                    /buddy

Here, t: 120k/1000k 12% | 292.7s is the remaining tail of the status line content (originally Context: 120k/1000k 12% | 292.7s), and /buddy is the right-aligned built-in status element. The claude --resume command only overwrites the left portion, leaving the rest of the status line visible.

Workaround attempts (all failed)

  1. Right-padding with spaces (printf "%-200s") — Claude Code appends its own right-aligned elements (e.g. /buddy, cwd) after the script output, so padding cannot cover them.
  2. Left-padding with spaces — Claude Code trims leading whitespace from status line output, so this has no effect.

Reproduction steps

  1. Configure a custom status line command in settings.json:

``json
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh"
}
``

  1. Use any script that outputs status text (model info, token counts, etc.)
  2. Run a session, then type /exit or press Ctrl-D
  3. Observe the garbled overlap between the resume hint and the status line

Suggested fix

Clear the terminal line(s) used by the status bar (e.g. using ANSI escape \033[2K or equivalent) before printing the "Resume this session with:" message.

Environment

  • Claude Code version: 2.1.92
  • OS: macOS (Darwin 25.4.0, arm64)
  • Terminal: iTerm2 / macOS Terminal
  • Shell: zsh

View original on GitHub ↗

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