Agent teams broken in 2.1.113: H.toolUseContext.getAppState is not a function
Summary
Agent team spawning crashes the CLI with a TypeError in cli.js on Claude Code 2.1.113. The same workflow works correctly on 2.1.98.
Error
ERROR H.toolUseContext.getAppState is not a function. (In 'H.toolUseContext.getAppState()', 'H.toolUseContext.getAppState' is undefined)
/$bunfs/root/src/entrypoints/cli.js:8238:15639
The error originates from the internal telemetry call l("tengu_ask_user_question_finish_plan_interview", ...) at the same line — toolUseContext.getAppState() is invoked but the method doesn't exist on the context object in this build.
Environment
- CLI version (broken): 2.1.113 (
/Users/<user>/.local/bin/claude, installMethod: native) - CLI version (working): 2.1.98
- OS: macOS (Darwin 25.4.0)
- Terminal: iTerm2
- Teammate backend: iTerm2 split panes (
teammateMode: "tmux"in~/.claude.json, auto-detects iTerm2) CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1is set in~/.claude/settings.json
Reproduction
- On 2.1.113, from a Claude Code session:
````
TeamCreate({ team_name: "test-team", description: "..." })
Agent({ name: "foo", subagent_type: "frontend-web-engineer", team_name: "test-team", mode: "acceptEdits", prompt: "..." })
- Teammate spawns in an iTerm2 pane.
- When the root session interacts with the teammate (permission request, message, etc.), the CLI throws the above error and loses control of the teammate.
- Agent panes continue running but are unreachable from the lead —
SendMessageand shutdown requests are not processed.
Expected
Same as 2.1.98: the lead retains control, teammates accept edits without per-file prompts (given acceptEdits mode), and permission requests route back to the lead.
Actual
Root session error, teammates become orphaned, requires manual kill of panes.
Workaround
Rolling back to 2.1.98 restores team functionality, but removes access to the newer models (Opus 4.7). So there's currently no version that supports both teams + latest models.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗