[BUG] Xcode 27.0 Claude Agent: claude 2.1.280 exits with code 1 within 40 ms of Xcode's first stdin write; conversations hang on "thinking" forever (2.1.220 works)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Environment
- macOS 26A428, Apple silicon
- Xcode 27.0 (27A266a), Claude Agent signed in with a Claude Max account (OAuth), no API key
- Bundled agent: ~/Library/Developer/Xcode/CodingAssistant/Agents/claude/2.1.280/claude (Xcode fetched it on 2026-09-25 and pointed Agents/XcodeVersions/27A266a/claude to it; previously 2.1.220)
What happened
Since the switch to 2.1.280, every Claude Agent conversation in Xcode shows the thinking indicator indefinitely and never answers. The same Xcode build worked with 2.1.220 on 2026-09-24 (transcripts record "version":"2.1.220").
Unified log (log stream --info --debug) shows the sequence:
- Xcode runs "claude auth status": exit 0
- Xcode launches the agent with: -p --output-format=stream-json --input-format=stream-json --permission-prompt-tool stdio --verbose --mcp-config <tmp>.json --settings {"env":{"ANTHROPIC_MODEL":"opus","CLAUDE_CODE_ENABLE_TELEMETRY":"0","DISABLE_TELEMETRY":"1"},"hasCompletedOnboarding":true} --plugin-dir <tmp>/com.apple.dt.IDEIntelligenceAgents/plugins/27A266a/xcode-integration/ --allowedTools <list> --include-partial-messages --thinking-display summarized --append-system-prompt <text> --debug-file <tmp>/claude-agent-debug-<date>.log
Environment includes CLAUDE_CONFIG_DIR (…/CodingAssistant/ClaudeAgentConfig), CLAUDE_CODE_DISABLE_BACKGROUND_TASKS, CLAUDE_AFK_TIMEOUT_MS, CLAUDE_CODE_FORWARD_SUBAGENT_TEXT, MCP_XCODE_SESSION_ID and (redacted) OAuth refresh token / client id / scopes.
- Xcode: "Signing identity matches = true", "Control response successfully sent to Claude CLI via input stream", "Writing 423 bytes to Claude stdin input stream"
- ~40 ms later: "STDERR from <private>: <private>", EOF, "Stream ended normally - state=uninitialized, isRunning=false, exitCode=1, reason=exit"
- No session transcript is written under ClaudeAgentConfig/projects and the --debug-file is never created, so the exit happens before the agent initialises. Xcode shows no error.
What works
- The same 2.1.280 binary run from Terminal with CLAUDE_CONFIG_DIR set to the Xcode config dir: "-p 'hello'" answers normally (Opus 5.5).
- The same binary with the exact Xcode flags above (empty --mcp-config, the Xcode plugin dir, --allowedTools Agent,ToolSearch,TaskList, --include-partial-messages, --thinking-display summarized, --append-system-prompt), fed a control_response line followed by a stream-json user message, with the Xcode env vars and CLAUDE_CODE_OAUTH_REFRESH_TOKEN / CLAUDE_CODE_OAUTH_CLIENT_ID / CLAUDE_CODE_OAUTH_SCOPES set: exit 0, full answer, system init emitted.
- Repointing Agents/XcodeVersions/27A266a/claude to Agents/claude/2.1.220: Xcode conversations work again immediately.
Not reproducible from Terminal so far: Xcode's real --mcp-config (xcode-tools MCP server), the full --allowedTools list and the full system prompt. The agent's stderr at exit is redacted as <private> by macOS, so the actual error text is unknown.
Ruled out
Network, account, usage limits, re-signing in via Xcode > Settings > Intelligence, restarting Xcode and the Mac, hooks / .claude settings in the project (none), keychain (the suffixed item Claude Code-credentials-<hash> exists and works from Terminal), prompt delivery method, Opus vs Fable.
Steps to reproduce
- Xcode 27.0 (27A266a) with Claude Agent signed in via Claude account.
- Let Xcode use claude 2.1.280.
- Open any project, new Claude Agent conversation, send "Say hello".
Expected: reply. Actual: thinking indicator forever; agent process exits 1 within 50 ms of the first stdin write.
Suggestion
Whatever makes 2.1.280 exit here, please also make the SDK/stream-json entry point write its --debug-file (or a stderr line that Xcode can show) before exiting, so this is diagnosable.
What Should Happen?
See "What's Wrong?
Error Messages/Logs
Steps to Reproduce
See "What's Wrong?
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Opus 5.0
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
See "What's Wrong?
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗