TUI renderer crash dumps minified bundle source into terminal during long session

Resolved 💬 4 comments Opened Mar 7, 2026 by watchthelight Closed Apr 4, 2026

Description

During a long-running Claude Code session (~12 hours), the terminal UI crashed and rendered a large chunk of its own minified JavaScript (Ink/Yoga renderer internals) directly into the terminal buffer, followed by a stack trace. The application did not recover gracefully — raw bundle source replaced normal UI output.

This is a renderer/reconciler crash, not a model output issue.

Environment

| Field | Value |
|---|---|
| Claude Code version | 2.1.71 |
| Platform | Windows 11 Pro 10.0.26200 |
| Shell | bash |
| Model | Opus 4.6 (1M context) |
| Editor mode | -- INSERT --, bypass permissions on |

Session state at time of crash

| Metric | Value |
|---|---|
| Session duration | ~12h 22m |
| Session tokens | ~537k consumed, ~202k current window |
| RAM usage | 58% (18.5 / 31.4 GB) |
| Repo diff | +2176 -458 |
| Cache hit rate | 99% |
| Streaming speed | 36 t/s |

Heavy, long-lived session with significant repo churn.

Symptoms

  1. Normal TUI status bar rendered correctly (model info, git status, usage meters)
  2. Immediately below, a large blob of minified JavaScript appeared — thousands of characters of internal bundle code from B:/~BUN/root/src/entrypoints/cli.js
  3. A stack trace followed at the bottom
  4. The UI did not recover or show a clean error dialog

What the dumped code contains

The spilled source is from Claude Code's own Bun-bundled runtime and includes:

  • Yoga layout engine wrappers: setWidth, setFlexBasis, calculateLayout, getComputedPadding, freeRecursive, etc.
  • Ink/React custom reconciler host config: createInstance, createTextInstance, appendChild, removeChild, commitUpdate, removeChildFromContainer
  • Ink component types: ink-text, ink-box, ink-link, ink-progress, ink-raw-ansi, ink-virtual-text
  • ANSI/border rendering: Unicode box-drawing character maps (single, double, round, bold, classic, arrow), color application, border text positioning
  • Flexbox enum mappings: FLEX_DIRECTION_COLUMN, JUSTIFY_CENTER, OVERFLOW_HIDDEN, POSITION_TYPE_ABSOLUTE, WRAP_WRAP_REVERSE, etc.

Stack trace

<anonymous> (B:/~BUN/root/src/entrypoints/cli.js:597:98864)
<anonymous> (B:/~BUN/root/src/entrypoints/cli.js:597:98690)
HH (B:/~BUN/root/src/entrypoints/cli.js:598:264)
Hf (B:/~BUN/root/src/entrypoints/cli.js:598:3694)
Cf (B:/~BUN/root/src/entrypoints/cli.js:598:5250)
<anonymous> (B:/~BUN/root/src/entrypoints/cli.js:598:6763)
insertChild (B:/~BUN/root/src/entrypoints/cli.js:598:31104)
gW$ (B:/~BUN/root/src/entrypoints/cli.js:598:36700)
pr (B:/~BUN/root/src/entrypoints/cli.js:584:65020)
pr (B:/~BUN/root/src/entrypoints/cli.js:584:65119)

Analysis

The crash originates in the UI tree reconciliation / child insertion path:

  • gW$ is the minified insertBefore function in the Ink reconciler host config. From the dump: it detaches a node from its current parent, finds the index of the before sibling in childNodes, splices the new node in, and calls yogaNode.insertChild(). If the before node is not found in childNodes, it falls through to an appendChild-style path instead.
  • insertChild is the Yoga layout node's insertChild wrapper (class pW$), which delegates to this.yoga.insertChild(child.yoga, index).
  • pr appears twice (recursive), consistent with the React reconciler commit phase.
  • HH, Hf, Cf are minified functions in the Ink/Yoga layout pipeline leading up to the insertion.

Most probable bug class: tree mutation inconsistency — e.g., inserting a child before a nonexistent sibling, double-inserting a node, or operating on a freed/stale Yoga layout node. Long sessions with heavy UI churn (large diffs, streaming output, frequent rerenders) increase the likelihood of hitting this.

The raw bundle source appearing on screen suggests the error boundary or crash fallback itself partially failed, causing diagnostic/source content to spill into the active terminal buffer rather than rendering a clean error message.

Reproduction

Not deterministic. Conditions that likely contributed:

  • Very long session (~12h)
  • High token throughput and large context (~537k tokens)
  • Large repo diff (+2176 -458)
  • Active editor/INSERT mode
  • Bypass permissions enabled (high tool/action churn)

Raw dump

Raw terminal dump will be attached in a follow-up comment.

View original on GitHub ↗

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