Copyright © 2026 Unity Technologies
Claude Code agent fails to start in Assistant 2.0.0-pre.1 – ANTHROPIC_API_KEY not detected and sessions stuck on reasoning
Environment
Assistant version: 2.0.0-pre.1
Claude Code version: 2.1.71
OS: Windows (primary report), macOS (secondary report)
Editor: Unity Editor (version not specified)
Gateway enabled
Anthropic API key configured
Description
Users report being unable to successfully start Claude Code sessions through the AI Assistant / Unity Gateway. Claude Code works normally outside of Unity (via Windows PowerShell with Unity Editor), but fails when used through the Assistant.
The issue presents in two ways:
Session fails to start due to missing credentials
Session starts but remains stuck on “reasoning” indefinitely and eventually fails without returning a response.
The Unity agent works correctly, indicating the issue may be specific to Claude Code authentication or session startup via Gateway.
In a separate report, Claude Code detects the Unity MCP server configuration and relay correctly, and the relay process is running with a successful handshake, but no Unity MCP tools are available.
Claude initially suggested possible causes:
However, the user confirmed:
Despite the connection appearing successful, no MCP tools are listed.
Error Message
“Failed to start Claude Code session. Missing credentials: ANTHROPIC_API_KEY. Please enter them in Gateway preferences.”
Steps to Reproduce
Install Assistant 2.0.0-pre.1
Configure Claude Code (v2.1.71)
Add ANTHROPIC_API_KEY:
Expected Result
Claude Code session starts normally and returns responses through the Assistant. MCP tools should also be discoverable when the Unity Editor and relay are running.
Actual Result
Session fails with missing credential error
or
Session remains stuck in “reasoning” indefinitely and returns no response
In another case, the relay successfully connects and performs a handshake but no MCP tools are listed.
Troubleshooting Already Attempted
Verified API key is valid
Set ANTHROPIC_API_KEY as Windows environment variable
Added key in Unity Gateway project settings
Added Claude Code integration to MCP Server configuration
Restarted machine
Reinstalled Assistant package
Tested in a fresh Unity project
Verified Claude Code works correctly with non-Unity projects
Confirmed Unity Editor running
Confirmed relay running
Confirmed handshake between Claude Code and relay
Notes
Claude Code works correctly when run from PowerShell outside of Assistant.
Unity agent works correctly inside Assistant.
In some cases the MCP relay connects successfully but returns no tools.
Issue appears specific to Claude Code authentication, Gateway session initialization, or MCP tool discovery.
Impact
Prevents use of Claude Code agent with AI Assistant / Gateway and blocks workflows relying on Claude integration.
Issues you vote on will appear here