Repository navigation
Description
What happened
When Claude Code shows a startup screen that the Host doesn't recognize, the send waits five minutes and then fails with:
executor failed: Claude interactive startup or Host MCP discovery did not finish within five minutes
The error doesn't say what Claude was showing. The Host reads Claude's PTY screen to drive startup (plugins/agent/native/src/executor/external/claude/input.rs). It answers the screens it knows: folder trust, text style, security notes, terminal setup and the bypass-permissions consent. It treats a final $ line as ready. Any other screen falls through to Startup::Wait until SETUP_TIMEOUT (300 s), and the timeout error is built without it. So neither the conversation nor the error shows what Claude was waiting for.
Claude Code adds and changes these screens between releases. A new one becomes a five-minute wait followed by an error with no cause. The message also names two possible causes, startup and Host MCP discovery, without saying which wait timed out.
I first ran into this with real Claude Code 2.1.308. An invocation failed after about 300 seconds, and Maka gave me no way to see what Claude was waiting for.
How to reproduce
This reproduces deterministically with a fake claude, so no real Claude Code is needed.
-
Save this script as
claude-stall.sh:#!/bin/sh printf 'Claude Code v9.9.9\n\n Before you continue, review the updated Consumer Terms.\n\n > 1. Accept and continue\n 2. Exit\n\n Enter to confirm\n' exec sleep 3600
-
Configure it as the Claude runtime in the Agent configuration:
"external": { "runtimes": { "claude": true }, "commands": { "claude": { "executable": "/bin/sh", "args": ["/path/to/claude-stall.sh"], "env": { "CLAUDE_CONFIG_DIR": "/tmp/claude-home" } } } }
-
Send a message with "Claude Code · native default".
I ran this in a real-Host terminal test on rust-preview 09ca38c23. Admission returned started, and the conversation stayed busy for 300.6 s. Afterwards the transcript showed only the error above. The fake process was cleaned up.
Expected
The failure says what Claude was showing and which wait timed out.
Possible directions
- Keep a bounded tail of the last screen, for example the last 20 non-empty lines, and include it in the startup timeout error. Split the message so a startup timeout and an MCP discovery timeout read differently. Claude's screen can show account details, so the tail may belong only in the conversation's error and not in Host logs.
- Fail sooner when an unrecognized screen stops changing, instead of waiting the full five minutes. This needs a threshold that doesn't cut off a slow startup that is still making progress.
- Show the external CLI's screen read-only while it starts. This is larger, and probably only worth it if 1 isn't enough.
@M4n5ter, would 1 alone be enough, or do you also want 2? I'd like to implement whichever you prefer.
Environment
- Maka version or commit:
rust-preview09ca38c23 - OS and version: macOS 27.0.1 (arm64)
- Surface: terminal workbench, driven by a real-Host integration test
Activity
YongGoose commentedon Nov 9, 2026
take
M4n5ter commentedon Nov 10, 2026
Thanks for investigating and reproducing this. Using a fake CLI to cover the unknown startup screen is fine.
I think we should start with option 1: distinguish a Claude startup timeout from an MCP discovery timeout, and include a bounded excerpt of recent terminal output in the error so users can see what happened. We don't currently have a reliable redaction approach, so I don't think we should make redaction a requirement here.
I would not fail early solely because an unknown screen has been unchanged for a while. Slow startup or network activity could look the same. We can revisit early detection once we have more real-world cases. Unknown screens should not be automatically accepted or dismissed.
YongGoose commentedon Nov 11, 2026
@M4n5ter, #6713 landed after your comment and removed the code this issue was about. Claude now runs as
claude --print --input-format stream-json --output-format stream-json, so there's no PTY startup screen to read, and the five-minute setup timeout and its message are gone for Claude. Option 1 can't be built as described.I re-ran the fake CLI on
rust-previewc8287d41b, in a full-access conversation, to see what happens now. The code involved is unchanged on5f96c05d8.error: unknown option '--replay-user-messages'to stderr and exits 1. The run moves to Waiting for you with anexternal_task_unobservableblocker. The history has only the user's message, and the stderr line isn't kept anywhere.admittedafter 90 s, with no timeout.The goal from your comment still applies, just in a different place: keep a bounded tail of Claude's stderr and attach it to the failure or blocker diagnostic. Should I retarget this issue to that, or close it while the durable execution follow-ups land?
M4n5ter commentedon Nov 12, 2026
Thanks for tracking this down. #6816 restored interactive Claude Code over PTY and split the startup and MCP discovery timeouts. The startup timeout now includes a bounded excerpt of recent terminal output. Could you rerun your original fake CLI repro on
rust-preview? If the error shows the startup screen, we can close this.YongGoose commentedon Nov 12, 2026
Thanks, @M4n5ter. I reran the original fake CLI repro on
rust-preview3a120616a, with the same script in a full-access conversation using "Claude Code · native default".The run failed after 300.6 s. The conversation's failure entry now shows both which wait timed out and what Claude was displaying:
The fake process was cleaned up within a second of the failure. This covers what the issue asked for, so I'm closing it.