claude-code - 💡(How to fix) Fix Subagent crashes CLI process when chrome-devtools MCP returns results (Ink renderer crash at createInstance) [1 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#53190Fetched 2026-04-26 05:22:03
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×6commented ×1

When a subagent spawned via the Agent tool has the chrome-devtools-mcp plugin enabled and calls any chrome-devtools tool (e.g. take_screenshot, list_pages), the entire Claude Code CLI process crashes. The crash occurs inside the Ink terminal rendering pipeline at createInstance, not in the MCP connectivity layer.

Error Message

Partial stack provided by user (minified, from /$bunfs/root/src/entrypoints/cli.js):

- createInstance (/$bunfs/root/src/entrypoints/cli.js:502:249)
- PL (/$bunfs/root/src/entrypoints/cli.js:484:58456)
- LYH (/$bunfs/root/src/entrypoints/cli.js:484:88642)
- rZH (/$bunfs/root/src/entrypoints/cli.js:484:87842)
- RD6 (/$bunfs/root/src/entrypoints/cli.js:484:86738)
- iZH (/$bunfs/root/src/entrypoints/cli.js:484:86558)
- jM_ (/$bunfs/root/src/entrypoints/cli.js:484:83272)
- aH (/$bunfs/root/src/entrypoints/cli.js:484:6552)
- LH (/$bunfs/root/src/entrypoints/cli.js:484:5006)
- FH (/$bunfs/root/src/entrypoints/cli.js:484:5318)

The call chain (createInstance → PL → LYH → rZH → RD6 → iZH → jM_ → aH → LH → FH) maps to the Ink React renderer — specifically the reconciler.createInstance path that builds and renders the terminal UI tree.

Root Cause

When a subagent spawned via the Agent tool has the chrome-devtools-mcp plugin enabled and calls any chrome-devtools tool (e.g. take_screenshot, list_pages), the entire Claude Code CLI process crashes. The crash occurs inside the Ink terminal rendering pipeline at createInstance, not in the MCP connectivity layer.

Code Example

- createInstance (/$bunfs/root/src/entrypoints/cli.js:502:249)
- PL (/$bunfs/root/src/entrypoints/cli.js:484:58456)
- LYH (/$bunfs/root/src/entrypoints/cli.js:484:88642)
- rZH (/$bunfs/root/src/entrypoints/cli.js:484:87842)
- RD6 (/$bunfs/root/src/entrypoints/cli.js:484:86738)
- iZH (/$bunfs/root/src/entrypoints/cli.js:484:86558)
- jM_ (/$bunfs/root/src/entrypoints/cli.js:484:83272)
- aH (/$bunfs/root/src/entrypoints/cli.js:484:6552)
- LH (/$bunfs/root/src/entrypoints/cli.js:484:5006)
- FH (/$bunfs/root/src/entrypoints/cli.js:484:5318)

---

// .claude/settings.json
{
  "enabledPlugins": {
    "chrome-devtools-mcp@claude-plugins-official": true
  }
}
RAW_BUFFERClick to expand / collapse

Summary

When a subagent spawned via the Agent tool has the chrome-devtools-mcp plugin enabled and calls any chrome-devtools tool (e.g. take_screenshot, list_pages), the entire Claude Code CLI process crashes. The crash occurs inside the Ink terminal rendering pipeline at createInstance, not in the MCP connectivity layer.

Version

2.1.119 (bun runtime — /$bunfs/root/... paths)

Steps to Reproduce

  1. Enable chrome-devtools-mcp@claude-plugins-official in .claude/settings.json
  2. Spawn a subagent with Agent() tool that uses chrome-devtools MCP tools
  3. The subagent calls list_pages or take_screenshot (chrome-devtools MCP)
  4. CLI process crashes

The crash is reproducible 100% of the time — hit it on 3 consecutive spawns across 3 separate subagent instances (explorer, explorer-2, explorer-3).

Stack Trace

Partial stack provided by user (minified, from /$bunfs/root/src/entrypoints/cli.js):

- createInstance (/$bunfs/root/src/entrypoints/cli.js:502:249)
- PL (/$bunfs/root/src/entrypoints/cli.js:484:58456)
- LYH (/$bunfs/root/src/entrypoints/cli.js:484:88642)
- rZH (/$bunfs/root/src/entrypoints/cli.js:484:87842)
- RD6 (/$bunfs/root/src/entrypoints/cli.js:484:86738)
- iZH (/$bunfs/root/src/entrypoints/cli.js:484:86558)
- jM_ (/$bunfs/root/src/entrypoints/cli.js:484:83272)
- aH (/$bunfs/root/src/entrypoints/cli.js:484:6552)
- LH (/$bunfs/root/src/entrypoints/cli.js:484:5006)
- FH (/$bunfs/root/src/entrypoints/cli.js:484:5318)

The call chain (createInstance → PL → LYH → rZH → RD6 → iZH → jM_ → aH → LH → FH) maps to the Ink React renderer — specifically the reconciler.createInstance path that builds and renders the terminal UI tree.

What Was Working Correctly

  • Chrome was running correctly with --remote-debugging-pipe (pipe-based transport, not port 9222)
  • The MCP tool call itself succeeded (chrome responded)
  • The crash happened when the CLI attempted to render the MCP tool result in the terminal

Hypothesis

Chrome-devtools MCP returns large base64 payloads (screenshots can be 100–500 KB base64-encoded). When a subagent's tool result contains a large payload, the Ink renderer crashes during reconciliation — likely a buffer size or string handling issue when trying to render the tool result in the subagent's tmux pane.

This is a rendering crash, not a connectivity crash. The MCP side is working; the terminal rendering side is not.

Config (relevant excerpt)

// .claude/settings.json
{
  "enabledPlugins": {
    "chrome-devtools-mcp@claude-plugins-official": true
  }
}

Environment

  • Platform: macOS 25.4.0 (Darwin)
  • Shell: zsh
  • Claude Code version: 2.1.119
  • Runtime: bun (/$bunfs/root/ path prefix in stack)
  • Session mode: bypassPermissions
  • Subagent spawned via Agent tool with subagent_type: "explorer"

extent analysis

TL;DR

The issue can be mitigated by handling large base64 payloads returned by Chrome-devtools MCP to prevent the Ink renderer from crashing during reconciliation.

Guidance

  • Verify that the crash occurs when rendering large payloads by checking the size of the base64-encoded data returned by Chrome-devtools MCP.
  • Consider implementing a payload size limit or a more efficient rendering mechanism to handle large payloads.
  • Investigate the createInstance function in the Ink React renderer to identify potential buffer size or string handling issues.
  • Test the rendering of smaller payloads to confirm that the issue is related to payload size.

Example

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

Notes

The issue seems to be related to the rendering of large payloads in the terminal, rather than a connectivity issue with Chrome-devtools MCP. The provided stack trace points to the Ink React renderer, specifically the reconciler.createInstance path.

Recommendation

Apply a workaround to handle large base64 payloads, such as implementing a payload size limit or a more efficient rendering mechanism, to prevent the Ink renderer from crashing.

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 Subagent crashes CLI process when chrome-devtools MCP returns results (Ink renderer crash at createInstance) [1 comments, 2 participants]