claude-code - 💡(How to fix) Fix [Bug] Ink renderer crashes in spawned teammate agents during tmux mode sessions [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52139Fetched 2026-04-23 07:35:37
View on GitHub
Comments
2
Participants
2
Timeline
13
Reactions
2
Timeline (top)
labeled ×6cross-referenced ×4commented ×2subscribed ×1

Error Message

Claude Code's Ink renderer (React-for-terminal) is crashing repeatedly inside spawned teammate agents during an agent-team session. The crashes happen in the teammate subprocess (tmux pane), not the main session. Stack trace points into createInstance inside the Ink reconciler in the bun-packed cli.js. Crashes appear to be triggered by something about the content a teammate produces or receives — possibly very long single-line text (e.g., an unwrapped dotnet build error) or a specific character sequence.

  • Shortly after running dotnet build whose output included compiler errors (unclear if the error output itself was the trigger)

Root Cause

Bug Description

Ink renderer crashes in spawned teammate agents (tmux mode)

Summary

Claude Code's Ink renderer (React-for-terminal) is crashing repeatedly inside spawned teammate agents during an agent-team session. The crashes happen in the teammate subprocess (tmux pane), not the main session. Stack trace points into createInstance inside the Ink reconciler in the bun-packed cli.js. Crashes appear to be triggered by something about the content a teammate produces or receives — possibly very long single-line text (e.g., an unwrapped dotnet build error) or a specific character sequence.

Affected teammates in this session: both a general-purpose worker (opus-4-7) and a custom read-only godot-mcp proxy (haiku-4-5). Occurred at least three times during a single ~2-hour session of focused implementation work.

Environment

  • Claude Code version: 2.1.117 (from --agent-id args visible in ps)
  • OS: macOS / Darwin 25.3.0
  • Shell: zsh
  • Teammate mode: tmux (teammateMode: "tmux" in ~/.claude.json)
  • Experimental feature: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 enabled
  • Binary shape: bun-packed (/$bunfs/root/src/entrypoints/cli.js)
  • Agent types active: general-purpose (Opus 4.7), custom godot-mcp subagent (Haiku 4.5)
  • MCP servers in play: godot-mcp-pro (some queries to a running Godot 4 editor)

Repro pattern (not a minimal repro, but the triggering workload)

  1. Create a team via TeamCreate.
  2. Spawn two teammates: a worker and a read-only MCP proxy.
  3. Give the worker a task that involves running dotnet build and/or coordinating with the MCP proxy for editor queries.
  4. At some point during the work, the worker's or proxy's subprocess crashes. The tmux pane shows a long minified JS stack trace with fragments ending in createInstance in the Ink reconciler.

Crashes observed during:

  • MCP tool invocations that return moderately large results (scene trees, execute_editor_script output)
  • Shortly after running dotnet build whose output included compiler errors (unclear if the error output itself was the trigger)
  • Teammate activity in general once the session had been running for a while

Stack trace fragments (top of the relevant frames)

 - createInstance (/$bunfs/root/src/entrypoints/cli.js:495:249)
 - BU (/$bunfs/root/src/entrypoints/cli.js:477:57938)
 - gTH (/$bunfs/root/src/entrypoints/cli.js:477:87786)
 - XWH (/$bunfs/root/src/entrypoints/cli.js:477:86997)
 - bgH (/$bunfs/root/src/entrypoints/cli.js:477:85896)
 - Ir (/$bunfs/root/src/entrypoints/cli.js:477:85717)
 - MWH (/$bunfs/root/src/entrypoints/cli.js:477:82456)
 - T_ (/$bunfs/root/src/entrypoints/cli.js:477:6497)
 - hH (/$bunfs/root/src/entrypoints/cli.js:477:4980)
 - eH (/$bunfs/root/src/entrypoints/cli.js:477:5281)

The surrounding minified source shows the Ink reconciler's createInstance and its nearby isInsideText/textStyles handling (ink-text, ink-virtual-text, ink-box host contexts). A <Box> nested inside a <Text> throws ("<Box> can't be nested inside <Text> component"), which suggests the crash may be a React invariant from malformed element trees produced by the reconciler under certain content.

Impact

  • Loss of in-flight agent work — the teammate subprocess dies mid-task; any uncommitted edits in that agent's workspace survive on disk, but the subprocess can't be resumed. Recovery requires spawning a fresh teammate and re-briefing.
  • Zombie state — crashed teammates remain tracked as "active members" in the team config (~/.claude/teams/<name>/config.json, isActive: true), blocking TeamDelete. Cleanup requires either killing the orphan OS process (SIGTERM was ignored; SIGKILL worked), killing the tmux pane (tmux kill-pane -t %<id>), and then hand-editing the config to flip isActive: false before TeamDelete will accept the cleanup. This recovery path is not discoverable — users stuck in this state would likely just restart their whole session.
  • Works around, doesn't fix — we've mitigated by piping dotnet build through | tail -30 and telling the MCP proxy to summarize rather than relay raw tool results. These are plausibly the trigger, but the root cause is unclear.

Asks

  1. Ideally: fix the Ink-layer crash (React invariant around ink-text/ink-box nesting, possibly a content-type issue).
  2. Failing that: a supported cleanup path for zombie teammates — a --force flag on TeamDelete or a "mark member inactive" mechanism that doesn't require hand-editing JSON.
  3. Optional nice-to-have: the crash output would be more useful if Claude Code captured it into a log file rather than only the tmux pane, so users can recover it after closing the pane.

Additional context

If it helps, I'm happy to share:

  • The full session transcript leading up to the crashes
  • The ~/.claude/teams/<name>/config.json contents
  • The scenario files (Godot C# project using `Nav… Note: Content was truncated.
RAW_BUFFERClick to expand / collapse

Bug Description

Ink renderer crashes in spawned teammate agents (tmux mode)

Summary

Claude Code's Ink renderer (React-for-terminal) is crashing repeatedly inside spawned teammate agents during an agent-team session. The crashes happen in the teammate subprocess (tmux pane), not the main session. Stack trace points into createInstance inside the Ink reconciler in the bun-packed cli.js. Crashes appear to be triggered by something about the content a teammate produces or receives — possibly very long single-line text (e.g., an unwrapped dotnet build error) or a specific character sequence.

Affected teammates in this session: both a general-purpose worker (opus-4-7) and a custom read-only godot-mcp proxy (haiku-4-5). Occurred at least three times during a single ~2-hour session of focused implementation work.

Environment

  • Claude Code version: 2.1.117 (from --agent-id args visible in ps)
  • OS: macOS / Darwin 25.3.0
  • Shell: zsh
  • Teammate mode: tmux (teammateMode: "tmux" in ~/.claude.json)
  • Experimental feature: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 enabled
  • Binary shape: bun-packed (/$bunfs/root/src/entrypoints/cli.js)
  • Agent types active: general-purpose (Opus 4.7), custom godot-mcp subagent (Haiku 4.5)
  • MCP servers in play: godot-mcp-pro (some queries to a running Godot 4 editor)

Repro pattern (not a minimal repro, but the triggering workload)

  1. Create a team via TeamCreate.
  2. Spawn two teammates: a worker and a read-only MCP proxy.
  3. Give the worker a task that involves running dotnet build and/or coordinating with the MCP proxy for editor queries.
  4. At some point during the work, the worker's or proxy's subprocess crashes. The tmux pane shows a long minified JS stack trace with fragments ending in createInstance in the Ink reconciler.

Crashes observed during:

  • MCP tool invocations that return moderately large results (scene trees, execute_editor_script output)
  • Shortly after running dotnet build whose output included compiler errors (unclear if the error output itself was the trigger)
  • Teammate activity in general once the session had been running for a while

Stack trace fragments (top of the relevant frames)

 - createInstance (/$bunfs/root/src/entrypoints/cli.js:495:249)
 - BU (/$bunfs/root/src/entrypoints/cli.js:477:57938)
 - gTH (/$bunfs/root/src/entrypoints/cli.js:477:87786)
 - XWH (/$bunfs/root/src/entrypoints/cli.js:477:86997)
 - bgH (/$bunfs/root/src/entrypoints/cli.js:477:85896)
 - Ir (/$bunfs/root/src/entrypoints/cli.js:477:85717)
 - MWH (/$bunfs/root/src/entrypoints/cli.js:477:82456)
 - T_ (/$bunfs/root/src/entrypoints/cli.js:477:6497)
 - hH (/$bunfs/root/src/entrypoints/cli.js:477:4980)
 - eH (/$bunfs/root/src/entrypoints/cli.js:477:5281)

The surrounding minified source shows the Ink reconciler's createInstance and its nearby isInsideText/textStyles handling (ink-text, ink-virtual-text, ink-box host contexts). A <Box> nested inside a <Text> throws ("<Box> can't be nested inside <Text> component"), which suggests the crash may be a React invariant from malformed element trees produced by the reconciler under certain content.

Impact

  • Loss of in-flight agent work — the teammate subprocess dies mid-task; any uncommitted edits in that agent's workspace survive on disk, but the subprocess can't be resumed. Recovery requires spawning a fresh teammate and re-briefing.
  • Zombie state — crashed teammates remain tracked as "active members" in the team config (~/.claude/teams/<name>/config.json, isActive: true), blocking TeamDelete. Cleanup requires either killing the orphan OS process (SIGTERM was ignored; SIGKILL worked), killing the tmux pane (tmux kill-pane -t %<id>), and then hand-editing the config to flip isActive: false before TeamDelete will accept the cleanup. This recovery path is not discoverable — users stuck in this state would likely just restart their whole session.
  • Works around, doesn't fix — we've mitigated by piping dotnet build through | tail -30 and telling the MCP proxy to summarize rather than relay raw tool results. These are plausibly the trigger, but the root cause is unclear.

Asks

  1. Ideally: fix the Ink-layer crash (React invariant around ink-text/ink-box nesting, possibly a content-type issue).
  2. Failing that: a supported cleanup path for zombie teammates — a --force flag on TeamDelete or a "mark member inactive" mechanism that doesn't require hand-editing JSON.
  3. Optional nice-to-have: the crash output would be more useful if Claude Code captured it into a log file rather than only the tmux pane, so users can recover it after closing the pane.

Additional context

If it helps, I'm happy to share:

  • The full session transcript leading up to the crashes
  • The ~/.claude/teams/<name>/config.json contents
  • The scenario files (Godot C# project using `Nav… Note: Content was truncated.

extent analysis

TL;DR

The most likely fix or workaround for the Ink renderer crashes in spawned teammate agents is to address the malformed element trees produced by the reconciler under certain content, possibly by improving the handling of long single-line text or specific character sequences.

Guidance

  1. Investigate the content triggering the crash: Examine the output of dotnet build and the results from the MCP proxy to identify any patterns or common characteristics that may be causing the crash.
  2. Improve error handling in the Ink reconciler: Consider adding try-catch blocks or error handling mechanisms to the createInstance function to prevent the crash and provide more informative error messages.
  3. Implement a cleanup mechanism for zombie teammates: Introduce a --force flag on TeamDelete or a "mark member inactive" mechanism to allow users to recover from crashed teammates without manual JSON editing.
  4. Capture crash output to a log file: Modify Claude Code to log the crash output to a file, enabling users to recover the information even after closing the tmux pane.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The provided information suggests that the crash is related to the content processed by the Ink reconciler, but the exact cause is unclear. Further investigation is necessary to determine the root cause and implement a definitive fix.

Recommendation

Apply a workaround by implementing a cleanup mechanism for zombie teammates, such as a --force flag on TeamDelete, to mitigate the impact of the crashes until a more permanent solution is found. This will allow users to recover from crashed teammates without manual intervention.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] Ink renderer crashes in spawned teammate agents during tmux mode sessions [2 comments, 2 participants]