TUI renderer crash dumps minified bundle source into terminal during long session
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
- Normal TUI status bar rendered correctly (model info, git status, usage meters)
- Immediately below, a large blob of minified JavaScript appeared — thousands of characters of internal bundle code from
B:/~BUN/root/src/entrypoints/cli.js - A stack trace followed at the bottom
- 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 minifiedinsertBeforefunction in the Ink reconciler host config. From the dump: it detaches a node from its current parent, finds the index of thebeforesibling inchildNodes, splices the new node in, and callsyogaNode.insertChild(). If thebeforenode is not found inchildNodes, it falls through to anappendChild-style path instead.insertChildis the Yoga layout node'sinsertChildwrapper (classpW$), which delegates tothis.yoga.insertChild(child.yoga, index).prappears twice (recursive), consistent with the React reconciler commit phase.HH,Hf,Cfare 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.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗