Terminal banner flickers on startup over SSH: two-phase rendering visible due to latency
Summary
Claude Code's startup banner flickers visibly when running over SSH. The banner renders in two phases (boxed → compact) with a ~50-150ms gap between them. Locally this is invisible, but over SSH the added latency makes both frames visible, causing 3 distinct flickers during a typical startup.
Steps to reproduce
- SSH into any remote machine (no special config needed)
- Run
claude - Observe 3 visible flicker events during startup
Note: SSH alone is sufficient to reproduce — tmux, terminal emulator, TERM value, and COLORTERM are all irrelevant. The flicker occurs with xterm-256color, xterm-ghostty, with or without COLORTERM=truecolor, inside or outside tmux.
Root cause analysis
Claude Code performs two separate synchronized output updates during startup, each wrapped in its own \e[?2026h ... \e[?2026l pair:
- First frame: Full boxed banner with version info
- Second frame: Compact banner (replaces the boxed one)
Because these are separate sync-update blocks, the terminal flushes the first frame to the screen before receiving the second. Over SSH, the network latency (~50-150ms) makes the first frame visible before it gets replaced.
Timing analysis from asciinema recording
| Time (s) | Event | Description |
|-----------|-------|-------------|
| 0.082 | Startup | Claude process begins |
| 0.573 | Flicker 1 | Boxed banner appears (first sync update) |
| 0.623 | Replace | Compact banner replaces boxed (~50ms gap) |
| 1.049 | Flicker 2 | Boxed banner reappears |
| 1.100 | Replace | Compact banner again (~51ms gap) |
| 1.528 | Flicker 3 | Boxed banner reappears |
| 1.582 | Replace | Compact banner again (~54ms gap) |
What was ruled out
- Focus events / kitty keyboard protocol: Flicker occurs regardless of
focus-events offin tmux - TERM value: Happens with both
xterm-ghosttyandxterm-256color - COLORTERM: Happens with and without
COLORTERM=truecolor - Missing terminfo: Happens even with correct terminfo installed
- tmux: Happens with direct SSH, tmux is irrelevant
Asciinema recording
https://asciinema.org/a/T9XuaIvScIBPtUwV
Environment
- Local: Ghostty terminal,
TERM=xterm-ghostty,COLORTERM=truecolor - Remote: NixOS, Linux 6.12.63
- Claude Code: Latest version at time of filing
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗