claude-code - 💡(How to fix) Fix [BUG] Custom status line content overlaps with resume hint on exit [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#48548Fetched 2026-04-16 06:57:05
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

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.

Root Cause

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.

Fix Action

Fix / Workaround

Workaround attempts (all failed)

Code Example

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

---

"statusLine": {
     "type": "command",
     "command": "~/.claude/statusline.sh"
   }
RAW_BUFFERClick to expand / collapse

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:
    "statusLine": {
      "type": "command",
      "command": "~/.claude/statusline.sh"
    }
  2. Use any script that outputs status text (model info, token counts, etc.)
  3. Run a session, then type /exit or press Ctrl-D
  4. 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

extent analysis

TL;DR

Clear the terminal line used by the status bar before printing the "Resume this session with:" message to prevent overlap.

Guidance

  • Consider using ANSI escape \033[2K to clear the terminal line before printing the resume hint.
  • Verify that the status line is properly cleared by checking the terminal output after exiting a session.
  • If using a custom status line command, ensure it does not interfere with the clearing of the status line.
  • Test the fix in different terminal environments (e.g., iTerm2, macOS Terminal) to ensure compatibility.

Example

printf "\033[2K"  # Clear the terminal line
echo "Resume this session with: $UUID"

Notes

The suggested fix assumes that the issue is caused by the status line not being cleared before printing the resume hint. If the issue persists, further investigation into the custom status line command and its interaction with Claude Code may be necessary.

Recommendation

Apply the workaround by clearing the terminal line using ANSI escape \033[2K before printing the "Resume this session with:" message, as it is a straightforward and non-invasive solution that can be easily tested and verified.

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…

FAQ

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.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING