Bỏ qua để vào nội dung chính
Fix Claude Code Terminal Flicker: NO_FLICKER Config (May 2026)

Fix Claude Code Terminal Flicker: NO_FLICKER Config (May 2026)

Bởi Ryan Patel
02 thg 5, 20264 phút đọc

export CLAUDE_CODE_NO_FLICKER=1

# Fix Claude Code Terminal Flicker: NO_FLICKER Config (May 2026) > **TL;DR:** Claude Code's TUI flickers on narrow terminals because the status line redraws faster than your emulator can paint. Fix: export CLAUDE_CODE_NO_FLICKER=1, widen your window to ≥100 columns, and confirm your emulator's damage_tracking setting. Most cases resolve in under a minute.

Symptom

You launch claude, start typing, and the bottom three lines of the screen — model badge, token meter, working-directory hint — strobe at roughly 30 Hz. Cursor jumps. Long output looks like it's tearing. The faster you type, the worse it gets.

$ claude
> refactor apps/worker/src/scheduler.ts
[blink][blink][blink]   ← status line redrawing
sonnet-4-6 │ 12,488 tok │ ~/news-app

This started showing up widely after the 2.5.x release in March 2026 when Anthropic added the live token meter to the bottom chrome. It's not in your head.

Cause

The TUI uses an alt-screen + per-frame diff. Two things conspire:

  • Status line refresh interval defaults to 100 ms while a stream is active.
  • Narrow terminals (<100 cols) force the status line to truncate-and-rewrap on every paint.

Combined, you get a full-line clear-and-rewrite at 10 Hz, which exposes any latency in your emulator's damage tracking. Alacritty and Windows Terminal default settings are most prone; iTerm2 and Kitty hide it well.

Fix in 30 seconds

export CLAUDE_CODE_NO_FLICKER=1
claude

NO_FLICKER=1 tells the TUI to redraw the status line only on token boundaries (every ~512 tokens) instead of every frame. You lose the smooth token-meter animation; you keep your eyesight.

If flicker persists, widen the terminal:

tput cols    # check current width
# <100? resize the window or use a smaller font

Permanent fix (shell rc)

Pin it in your shell rc so every session inherits:

# ~/.zshrc  (or ~/.bashrc)
export CLAUDE_CODE_NO_FLICKER=1
export CLAUDE_CODE_STATUS_INTERVAL_MS=500   # belt + suspenders

Reload: source ~/.zshrc. Confirm the env var is exported into the CLI:

claude doctor | grep -i flicker
# CLAUDE_CODE_NO_FLICKER=1   ✓

If you're orchestrating from a parent process (e.g. /advisor in CI via a wrapper), pass the var explicitly through your runner — pnpm/bun won't always inherit shell exports cleanly.

Terminal-specific notes

Alacritty

# ~/.config/alacritty/alacritty.toml
[debug]
render_timer = false

[window]
dynamic_padding = false   # padding redraw is the real culprit

Set dynamic_padding = false first; it removes a per-frame layout pass that interacts badly with the TUI's alt-screen.

iTerm2 (macOS)

Profiles → Terminal → uncheck "Disable session-initiated window resizing", and set "Maximum frames per second" to 60. Older defaults capped at 30 fps which produced visible tearing during streams. The flicker usually goes away without NO_FLICKER=1.

Windows Terminal

// settings.json
{
  "profiles": {
    "defaults": {
      "useAtlasEngine": true,
      "experimental.rendering.forceFullRepaint": false
    }
  }
}

Atlas is much faster than the legacy DirectX renderer. After enabling, restart Windows Terminal, not just the tab.

WezTerm

-- ~/.wezterm.lua
return {
  front_end = "WebGpu",
  max_fps   = 60,
  animation_fps = 60,
}

WezTerm's WebGpu front-end resolves nearly all flicker without env var help. Old OpenGL setting is the worst offender on Linux X11.

Verify

Run a long stream and watch the bottom chrome:

claude
> explain the difference between RSC and SSR in 1500 words

# status line should redraw smoothly, no strobe
# token meter increments in steps, not every frame

If you still see strobing, run claude --debug 2>tui.log and grep for render. A render time >16 ms per frame means the bottleneck is your emulator, not Claude Code.

FAQ

Does CLAUDE_CODE_NO_FLICKER=1 disable any features?

Only the smooth animation of the live token meter. Numbers still update — just in chunks instead of every frame. No functional features (slash commands, MCP, hooks) are affected.

Why does flicker only happen on narrow terminals?

The status line truncates and rewraps when columns drop below ~100. The rewrap path clears the whole line; the wide-line path only updates changed cells. Different code paths, different paint cost.

Will tmux make the flicker worse?

Sometimes. tmux's aggressive-resize on plus a small pane forces extra redraws. Either set aggressive-resize off in ~/.tmux.conf or run Claude Code in a full-window pane.

Is the flicker an Anthropic bug or a terminal bug?

Both. Anthropic's status line redraws more aggressively than necessary; many emulators have suboptimal damage tracking. CLAUDE_CODE_NO_FLICKER=1 is the official escape hatch while a proper fix is being shipped through the 2.7 release branch.

Không spam, hủy đăng ký bất kỳ lúc nào.

Bài viết liên quan