claude-code - 💡(How to fix) Fix [BUG] Teammate CLI crashes when receiving permission_response [1 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#51818Fetched 2026-04-23 07:44:03
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×2

Error Message

Environment: Claude Code version: 2.1.117 Platform: macOS (Darwin 25.4.0) Shell: zsh Teammate backend: tmux Teammate model: sonnet Teammate agentType: custom (.claude/agents/backend-dev.md, .claude/agents/frontend-dev.md)

Stack trace captured from the teammate's tmux pane (identical across both crashes):

  • 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)

Message flow (observed in ~/.claude/teams/{team}/inboxes/):

  1. teammate → team-lead: permission_request { tool_name: "Bash", input: { command: "git push && git log --oneline -4" } }

  2. team-lead → teammate: permission_response { type: "permission_response", subtype: "success", response: { updated_input: { command: "git push && git log --oneline -4" } } }

  3. (no further messages from teammate — pane shows the stack trace above)

Minimal reproduction steps:

  1. Start a Claude Code session as the team lead (claude)
  2. Call TeamCreate to create a team, then Agent to spawn a teammate with tmux backend
  3. Assign the teammate any task that culminates in a git push (or any Bash command that triggers a permission_request)
  4. Approve the permission request from the team lead
  5. Observe the teammate's tmux pane — the stack trace above appears and the teammate stops responding

Code Example

Environment:
Claude Code version: 2.1.117
Platform: macOS (Darwin 25.4.0)
Shell: zsh
Teammate backend: tmux
Teammate model: sonnet
Teammate agentType: custom (.claude/agents/backend-dev.md, .claude/agents/frontend-dev.md)

Stack trace captured from the teammate's tmux pane (identical across both crashes):
- 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)

Message flow (observed in ~/.claude/teams/{team}/inboxes/):
1. teammate → team-lead: permission_request
   { tool_name: "Bash", input: { command: "git push && git log --oneline -4" } }

2. team-lead → teammate: permission_response
   { type: "permission_response", subtype: "success",
     response: { updated_input: { command: "git push && git log --oneline -4" } } }

3. (no further messages from teammate — pane shows the stack trace above)

Minimal reproduction steps:
1. Start a Claude Code session as the team lead (claude)
2. Call TeamCreate to create a team, then Agent to spawn a teammate with tmux backend
3. Assign the teammate any task that culminates in a git push (or any Bash command that triggers a permission_request)
4. Approve the permission request from the team lead
5. Observe the teammate's tmux pane — the stack trace above appears and the teammate stops responding
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

Agent Team teammates crash immediately upon receiving a permission_response from the team lead. Reproduces 100% — occurred 2/2 times within a single session, with identical stack traces at the same trigger point, across different agent roles.

What Should Happen?

  • After receiving permission_response, the teammate should execute the approved Bash command
  • Execution result (stdout / stderr / exit code) should be returned to the team lead
  • An idle notification should be emitted afterwards
  • Even if the command itself fails, the teammate process should not crash
  • If the teammate hits an unrecoverable error, it should shut down gracefully:
    • Notify the team lead with the crash reason
    • Automatically set isActive: false in config.json
    • TeamDelete should succeed without manual intervention

Error Messages/Logs

Environment:
Claude Code version: 2.1.117
Platform: macOS (Darwin 25.4.0)
Shell: zsh
Teammate backend: tmux
Teammate model: sonnet
Teammate agentType: custom (.claude/agents/backend-dev.md, .claude/agents/frontend-dev.md)

Stack trace captured from the teammate's tmux pane (identical across both crashes):
- 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)

Message flow (observed in ~/.claude/teams/{team}/inboxes/):
1. teammate → team-lead: permission_request
   { tool_name: "Bash", input: { command: "git push && git log --oneline -4" } }

2. team-lead → teammate: permission_response
   { type: "permission_response", subtype: "success",
     response: { updated_input: { command: "git push && git log --oneline -4" } } }

3. (no further messages from teammate — pane shows the stack trace above)

Minimal reproduction steps:
1. Start a Claude Code session as the team lead (claude)
2. Call TeamCreate to create a team, then Agent to spawn a teammate with tmux backend
3. Assign the teammate any task that culminates in a git push (or any Bash command that triggers a permission_request)
4. Approve the permission request from the team lead
5. Observe the teammate's tmux pane — the stack trace above appears and the teammate stops responding

Steps to Reproduce

  1. Team lead (parent Claude Code session) spawns a teammate via TeamCreate + Agent (tmux backend, model: sonnet)
  2. Teammate completes its primary task — git commits are created, working tree is clean
  3. Teammate sends a permission_request via its inbox, asking to run a Bash command (in both cases: git push)
  4. Team lead replies with permission_response containing approve: true
  5. At that moment, the teammate CLI process crashes:
  • The approved command is never executed
  • No idle notification is emitted
  • The plain-text report body intended for the team lead is lost
  • ~/.claude/teams/{team}/config.json still has isActive: true for the dead member (requires manual edit)

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.117

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

No response

extent analysis

TL;DR

The teammate process crashes immediately after receiving a permission_response from the team lead, likely due to an issue with the createInstance function in cli.js.

Guidance

  • Review the createInstance function in cli.js (line 495) to identify potential issues with handling permission responses.
  • Verify that the permission_response message is correctly formatted and contains the expected data, such as approve: true and the updated input command.
  • Check the teammate's inbox for any errors or unexpected messages that may be causing the crash.
  • Consider adding error handling to the teammate process to catch and log any exceptions that may occur when processing the permission response.

Example

No code example is provided as the issue is likely specific to the createInstance function and requires further investigation.

Notes

The issue is reported to be a regression, and the last working version is not specified. It may be helpful to review the change history of the createInstance function and the surrounding code to identify potential causes of the issue.

Recommendation

Apply a workaround by adding error handling to the teammate process to catch and log any exceptions that may occur when processing the permission response, until the root cause of the issue can be identified and fixed.

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