Crash: "H.toolUseContext.getAppState is not a function" in lN permission renderer when teammate invokes project-scoped skill
Summary
Claude Code 2.1.113 crashes with TypeError: H.toolUseContext.getAppState is not a function at cli.js:8238:15639 (inside lN, the permission-prompt renderer) when an Agent Teams teammate invokes a project-scoped skill that triggers a cross-session permission gate.
Environment
- Claude Code: 2.1.113 (darwin arm64, installed via official installer)
- Also reproduces on 2.1.109 and 2.1.112
- Feature flag:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
Reproducer
- Start CC in a project with a custom skill at
.claude/skills/<name>/SKILL.mdwhere<name>is NOT in the session's allow list. - Enable Agent Teams:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1. - Team lead spawns a teammate via
TeamCreate. - Teammate invokes
Skill(<name>). - Permission request routes through the cross-session inbox (
~/.claude/teams/{team}/inbox/). - Lead's \
lN\renderer fires on the inbox entry and crashes.
Stack
\\\\
TypeError: H.toolUseContext.getAppState is not a function
at lN (cli.js:8238:15639)
\\
Root cause (hypothesis)
\lN\ assumes \toolUseContext\ is a live class instance with methods. The cross-session inbox serializes \toolUseContext\ as JSON on disk, stripping methods. When the lead rehydrates the inbox entry for rendering, \toolUseContext\ is a plain object and \getAppState\ is undefined.
Expected
Either (a) \lN\ guards \typeof toolUseContext.getAppState === 'function'\ before calling, or (b) the cross-session inbox rehydration reconstructs the class instance with methods, or (c) the inbox carries enough state that the renderer can recompute app state without needing the method.
Confirmed workaround
Set \permissions.defaultMode: \"bypassPermissions\"\ in \settings.json\. The permission prompt never renders in the cross-session path, so the crash can't fire. Verified working in our environment. Loses the interactive safety gate but PreToolUse hook-based safety (exit-code-2 blocks) remains enforced.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗