claude-code - 💡(How to fix) Fix Team-lead Claude Code crashes with stack overflow in rQ7/permission-explainer after teammate permission request [3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

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#49303Fetched 2026-04-17 08:45:05
View on GitHub
Comments
3
Participants
3
Timeline
16
Reactions
1
Timeline (top)
labeled ×7cross-referenced ×4commented ×3mentioned ×1

Error Message

  • Crash was deterministic on the next y/n reply — not a transient API error

Fix Action

Fix / Workaround

Workarounds

Code Example

<anonymous> (/$bunfs/root/src/entrypoints/cli.js:8233:15642)
$2          (/$bunfs/root/src/entrypoints/cli.js:477:63169)
aLH         (/$bunfs/root/src/entrypoints/cli.js:477:76220)
rV          (/$bunfs/root/src/entrypoints/cli.js:477:76101)
aLH         (/$bunfs/root/src/entrypoints/cli.js:477:76199)
rV          (/$bunfs/root/src/entrypoints/cli.js:477:76101)
aLH         (/$bunfs/root/src/entrypoints/cli.js:477:76199)
rV          (/$bunfs/root/src/entrypoints/cli.js:477:76101)
[aLH/rV pair repeats]
RAW_BUFFERClick to expand / collapse

What happened

Running Claude Code v2.1.111 (Opus 4.7, xhigh effort, 1M context) as a team lead with 3 teammates spawned via TeamCreate (team name price-1073-parallel, all teammates in split tmux panes with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1). The teammates each sent permission requests to the lead. Shortly after the lead emitted a "Proceed with all three? y/n" prompt and I replied, the lead pane:

  1. Dumped a large block of minified cli.js source directly to the terminal (functions W$8, mb1, lQ7, pb1, Z$8, ib1, qx1, Kx1, gM6, rQ7, …)
  2. Printed an apparent stack overflow with deep aLH ↔ rV recursion inside cli.js:477

The lead process is now gone. The 3 teammate panes are still alive but permanently stuck on "Waiting for team lead approval" — their permission requests have no recipient.

Possible regression

Same team-lead + teammates workflow was run recently on Opus 4.6 (Claude Code version unknown, but older than 2.1.111) without this crash. Something between that version and 2.1.111 / Opus 4.7 appears to have regressed — the permission-explainer path, Opus 4.7 message shape, or agent-teams interaction with either.

Stack trace (tail, pane scrollback)

<anonymous> (/$bunfs/root/src/entrypoints/cli.js:8233:15642)
$2          (/$bunfs/root/src/entrypoints/cli.js:477:63169)
aLH         (/$bunfs/root/src/entrypoints/cli.js:477:76220)
rV          (/$bunfs/root/src/entrypoints/cli.js:477:76101)
aLH         (/$bunfs/root/src/entrypoints/cli.js:477:76199)
rV          (/$bunfs/root/src/entrypoints/cli.js:477:76101)
aLH         (/$bunfs/root/src/entrypoints/cli.js:477:76199)
rV          (/$bunfs/root/src/entrypoints/cli.js:477:76101)
[aLH/rV pair repeats]

The 8233:15642 frame points at rQ7({toolName, toolInput, toolDescription, messages, signal}) — gated on gM6() = permissionExplainerEnabled. It calls Kx1(messages, 1000) to build a context string. The repeating aLH ↔ rV pair looks like an unbounded Ink/React render walk.

Repro signal

  • Team lead + 3 teammates, all sending near-simultaneous permission requests to the lead
  • permissionExplainer path active (default)
  • Crash was deterministic on the next y/n reply — not a transient API error

Impact

  • Orphaned teammates can never be approved and hold tmux panes open indefinitely
  • Lead context (conversation history, queued messages) lost unless /resumed

Workarounds

  • tmux kill-session the orphaned team
  • /resume the lead session from jsonl (worked — session id 418f39ef-… was recoverable)

Environment

  • claude --version: 2.1.111
  • Bun-bundled single-file CLI (/$bunfs/root/src/entrypoints/cli.js)
  • Linux 6.8.0 (Ubuntu EC2)
  • Model: Opus 4.7 (1M context), xhigh effort
  • Feature: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
  • Previously worked: same workflow on Opus 4.6, earlier CC version

extent analysis

TL;DR

The issue can be temporarily worked around by using tmux kill-session to terminate the orphaned team or resuming the lead session from a jsonl file using /resume.

Guidance

  • The crash seems to be related to the permissionExplainer path and the interaction between the team lead and teammates, so disabling this feature might prevent the issue.
  • The repeating aLH ↔ rV pair in the stack trace suggests an unbounded render walk, which could be caused by a circular dependency or an infinite loop in the cli.js code.
  • To mitigate the issue, you can try to reduce the number of simultaneous permission requests or increase the timeout for the Kx1 function.
  • The fact that the issue is deterministic and only occurs when the permissionExplainer path is active suggests that there might be a bug in the cli.js code that can be fixed.

Example

No code snippet is provided as the issue is related to a complex interaction between the team lead and teammates, and the cli.js code is not publicly available.

Notes

The issue seems to be specific to the CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 feature and the Opus 4.7 model, so it might not affect other users or environments. However, the fact that the same workflow worked on Opus 4.6 and an earlier version of Claude Code suggests that there might be a regression bug.

Recommendation

Apply the workaround by using tmux kill-session to terminate the orphaned team or resuming the lead session from a jsonl file using /resume, as this is the most straightforward way to mitigate the issue until a fix is available.

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 Team-lead Claude Code crashes with stack overflow in rQ7/permission-explainer after teammate permission request [3 comments, 3 participants]