[bug] Experimental agent team mode: "q.toolUseContext.getAppState is not a function" when sub-agent triggers permission prompt
Resolved 💬 3 comments Opened Apr 17, 2026 by JJ22007 Closed Apr 18, 2026
Summary
In experimental agent team mode (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 + teammateMode: "tmux"), a runtime error appears in the sub-agent pane every time its tool use hits the permission-prompt code path.
Error
ERROR q.toolUseContext.getAppState is not a function
file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:8493:15619
Location in bundled CLI
cli.js line 8493, inside the React hook that emits tengu_tool_use_show_permission_request:
let Y = q.toolUseContext.getAppState().toolPermissionContext.mode;
d("tengu_tool_use_show_permission_request", { ... });
On the sub-agent side, q.toolUseContext has no getAppState() method, so this throws before the permission UI can render.
Steps to reproduce
~/.claude/settings.json→{"env":{"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS":"1"}}~/.claude.json→"teammateMode": "tmux"- Start
claudeinside tmux, form a team (e.g. leadvault-organizer+ sub-agentsscanner-a,scanner-bspawned via--agent-id ... --team-name ... --parent-session-id ...). - Lead dispatches a Bash task to a sub-agent that needs permission (e.g.
find "$DIR" -type f -name "*.md"). - Sub-agent pane prints
Waiting for team lead approval, and the ERROR above appears on the sub-agent pane at the same moment.
Environment
- claude-code: 2.1.112 (global npm install at
/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code) - macOS: 26.3 (25D125), Apple Silicon
- node: v25.6.1
- tmux: 3.6a
Expected
Sub-agent should forward the permission request to the team lead without calling getAppState() on a context that doesn't have it.
Actual
TypeError logged in sub-agent pane each time a tool use reaches the permission-prompt branch.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗