CLI crashes with String.prototype.repeat error during parallel agent rendering in narrow terminals

Resolved 💬 3 comments Opened Apr 17, 2026 by joshualexanderl Closed Jun 25, 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?

Environment

  • Claude Code version: 2.1.111
  • Model: Opus 4.7 (1M context)
  • OS: macOS (Darwin 25.3.0)
  • Plan: Claude Max
  • Installed via: native install
  • Terminal: Cursor

Error

String.prototype.repeat argument must be greater than or equal to 0 and not be Infinity
at repeat (unknown)
at bf8 (/$bunfs/root/src/entrypoints/cli.js:8211:213)
at JD (/$bunfs/root/src/entrypoints/cli.js:477:21011)
at x$ (/$bunfs/root/src/entrypoints/cli.js:477:39565)
at SHH (/$bunfs/root/src/entrypoints/cli.js:477:50277)
at GO (/$bunfs/root/src/entrypoints/cli.js:477:86962)
at imH (/$bunfs/root/src/entrypoints/cli.js:477:85926)
at q2H (/$bunfs/root/src/entrypoints/cli.js:477:85748)
at c3H (/$bunfs/root/src/entrypoints/cli.js:477:82484)
at h_ (/$bunfs/root/src/entrypoints/cli.js:477:6495)

Reproduction

  1. Launch 3 parallel Explore agents via a single assistant turn.
  2. Work in a narrow terminal window where content wraps at around 25 characters.
  3. As the agent status tree renders (├─ └─ nested connectors with N tool uses · Nk tokens status lines), the CLI crashes mid render.
  4. Running claude -r to resume hits the same crash because the render state replays.

Likely cause

String.prototype.repeat is being called with a negative or Infinity argument deep in the render pipeline. Most likely source is a width math calculation for tree connectors or column padding where stdout.columns - contentWidth goes negative when content overflows the terminal, or a division produces Infinity when a dimension is reported as 0.

Almost certainly fixable with Math.max(0, ...) or a width floor around the offending .repeat() call.

Contributing factors

  • CLI warning on startup: Large cumulative agent descriptions will impact performance (~17.6k tokens > 15.0k) — I have many agent plugins installed (VoltAgent, Octo, GSD, superpowers, personas). This likely makes rendered status strings longer and raises exposure to the overflow.
  • Binary is Bun compiled (/$bunfs/ in stack). Possible interaction with Bun's process.stdout.columns handling on SIGWINCH.

Frequency

Reproducible every time I run multiple parallel agents in this narrow terminal. Has happened across multiple sessions today.

Workarounds tried

  • claude -r resume — re crashes at the same render.
  • Starting a fresh session with pasted context — works and avoids the broken render state.

Attempted to file via CLI

/bug and /feedback are disabled in my config (CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1), which is why I'm filing here instead. Consider allowing /bug to bypass that flag since crash reports are arguably essential traffic.

What Should Happen?

See if we can prevent this error in the future

Error Messages/Logs

Steps to Reproduce

  1. Install Claude

Code v2.1.111 (native
install) on macOS 15
(Darwin 25.3.0).

  1. Enable several

agent plugin
ecosystems so the
startup shows the
"Large cumulative
agent descriptions
~17.6k tokens >
15.0k" warning.

  1. Open Cursor's

integrated terminal
and narrow the panel
so text wraps around
25 characters wide.

  1. Launch claude

and send a prompt
that causes the
assistant to dispatch
3 parallel Explore
agents in a single
turn (e.g., "research
three angles in
parallel: X, Y, Z").

  1. Wait for the agent

status block to
render with the ├─ └─
tree and "N tool
uses · Nk tokens"
status lines.

  1. CLI crashes with

the String.prototype.
repeat stack trace.

  1. claude -r resume

reproduces the same
crash because the
render replays.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.111

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • Cursor integrated

terminal (zsh inside
Cursor).

  • Crash reliably

reproduced with 3
parallel Explore
agents + narrow
terminal panel.

  • Shell env: CLAUDE_C

ODE_DISABLE_NONESSENT
IAL_TRAFFIC=1,
CLAUDE_CODE_EXPERIMEN
TAL_AGENT_TEAMS=1,
CLAUDE_CODE_MAX_TOOL_
USE_CONCURRENCY=15.

  • Many agent plugins

enabled (VoltAgent,
Octo, GSD,
superpowers, Notion,
Sanity) — CLI warns
"Large cumulative
agent descriptions
~17.6k tokens >
15.0k" on startup.

  • Widening the

terminal panel
appears to avoid the
crash, but not
verified
exhaustively.

View original on GitHub ↗

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