[BUG] Bash tool returns minified cli.js source instead of command output in subagents

Resolved 💬 3 comments Opened Apr 23, 2026 by antonsynd Closed Apr 26, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When subagents (spawned via Agent tool) execute Bash commands, the tool result sometimes
returns minified JavaScript from Claude Code's internal CLI bundle
(/$bunfs/root/src/entrypoints/cli.js) instead of actual command output.

The corrupted output contains thousands of characters of minified React/Ink terminal
renderer code. This causes subagents to hang indefinitely since they can't interpret the
results.

What Should Happen?

No hanging and no renderer code emitted to the terminal

Error Messages/Logs

Subagent ran: grep "public const string" DiagnosticCodes.cs | sed ...

  Got back:
  Error: Exit code 1
  O=Jq9(q,K),T=Jq9(q.style,K.style),$=!1;if(O)for(let[A,z]of Object.entries(O)){...
  (thousands of chars of minified JS from Ink renderer)

  Stack trace:
  - createInstance (/$bunfs/root/src/entrypoints/cli.js:495:249)
  - BU (/$bunfs/root/src/entrypoints/cli.js:477:57938)
  ...

Steps to Reproduce

  1. Spawn multiple subagents in parallel (Agent tool, run_in_background: true)
  2. Have each run Bash commands concurrently
  3. Some subagents receive minified JS instead of command output
  4. Affected subagents hang indefinitely

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.116

Claude Code Version

2.1.118

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

  • The /$bunfs/root/ path is Bun's virtual filesystem for the bundled CLI
  • Appears to be a race condition where the Ink renderer's internal output leaks into

captured Bash stdout

  • Main agent Bash commands appear unaffected — only subagents
  • Version: 2.1.118
  • Model: Opus 4.6 (1M context)
  • OS: macOS Darwin 25.4.0, arm64
  • Shell: zsh
  • Platform: Anthropic API (direct)

<img width="1511" height="547" alt="Image" src="https://github.com/user-attachments/assets/576a98a8-15ba-4629-91fe-f79bba3ba433" />

View original on GitHub ↗

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