[BUG] Screen ghosting when switching between agents view (FleetView) and REPL with alternate screen disabled

Open 💬 1 comment Opened Jul 10, 2026 by halitcengizuzuner

Environment

  • Claude Code: 2.1.202 – 2.1.206 (reproduced across versions)
  • OS: macOS (Darwin 25.5.0)
  • Terminal: Terminal.app
  • CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 (normal-flow mode)

Description

Switching between the background-agents view (claude agents / FleetView) and the interactive REPL does not fully clear the terminal buffer. Output from the two views overlaps, producing ghost renders. Data and session state are intact (purely cosmetic), but it reads as session corruption to the user and has repeatedly triggered "lost session" confusion.

Repro

  1. Run claude with CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 in Terminal.app
  2. Open the agents view (FleetView), then return to the REPL; repeat a few times
  3. Buffer shows interleaved remnants of both views

Workaround

Ctrl+L redraws correctly; resizing the window (SIGWINCH) also forces a clean redraw.

Notes

Observed on 3+ separate occasions across sessions since 2.1.202; still present on 2.1.205/2.1.206. Likely the FleetView↔REPL transition assumes alternate-screen restore instead of explicitly clearing when alt-screen is disabled.

View original on GitHub ↗

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