Description
What happened?
On Windows, every Claude Code session launched from Orca shows this error on every prompt submit (100% reproducible):
UserPromptSubmit hook timed out after 10s — output discarded. Raise the hook's "timeout" to allow more time.
It is not specific to UserPromptSubmit: every hook event Orca registers (PreToolUse, PostToolUse, Stop, SubagentStart/Stop, …) blocks for the full 10 s timeout before the harness gives up. Each timed-out invocation also leaves an orphaned conhost.exe → cmd.exe → curl.exe process chain behind that never exits, so they accumulate over time.
Environment
- OS: Windows 11 Pro (10.0.22621)
- Orca: 1.4.182 (desktop app)
- Agent: Claude Code CLI 2.1.233
Root cause analysis
Orca writes hooks into ~/.claude/settings.json like this:
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "C:\WINDOWS\System32\conhost.exe",
"args": ["--headless", "C:\WINDOWS\System32\cmd.exe", "/d", "/c",
"%USERPROFILE%\.orca\agent-hooks\claude-hook.cmd"],
"timeout": 10
}
]
}
]claude-hook.cmd ends with:
"%SystemRoot%\System32\curl.exe" -sS -X POST "http://127.0.0.1:%ORCA_AGENT_HOOK_PORT%/hook/claude" ... --data-urlencode "payload@-" >nul 2>&1payload@- makes curl read the hook JSON payload from stdin.
Claude Code 2.1.233 does honor the args array (exec form): the full chain runs, claude-hook.cmd executes, and the curl POST completes — I can see its response bytes arrive on stdout. The problem is that the conhost.exe process never exits afterward, so the hook runner waits for process exit until the 10 s timeout fires — every time.
Minimal Node reproduction:
const { spawn } = require('child_process');
const p = spawn('C:\WINDOWS\System32\conhost.exe',
['--headless', 'C:\WINDOWS\System32\cmd.exe', '/d', '/c',
'%USERPROFILE%\.orca\agent-hooks\claude-hook.cmd'],
{ stdio: ['pipe', 'pipe', 'pipe'] });
p.stdin.write(JSON.stringify({ hook_event_name: 'UserPromptSubmit', prompt: 'x' }));
p.stdin.end();
p.on('close', () => console.log('exited'));
setTimeout(() => { console.log('still running after 10s'); p.kill(); }, 10000);Measured results (same batch file, stdin written then closed, exactly like the hook runner does):
| spawn target | result |
|---|---|
conhost.exe --headless cmd.exe /d /c claude-hook.cmd |
never exits (killed after 8 s in the test; curl had already completed) |
cmd.exe /d /c claude-hook.cmd directly |
exits in ~50 ms, exit code 0 |
Running the same conhost-wrapped chain from a bash/MSYS shell exits in ~70 ms, which is why the bug only manifests when Claude Code (Node) spawns it.
Relation to existing issues
- Windows: Claude Code hooks written with an
argsarray runconhost.exebare and strand a visible console per hook event #14808 (closed) / Windows: agent hooks strand a visible console per event — two causes, one per installer #14815 (open): older Claude Code builds ignoreargs, so bareconhost.exestrands a visible console per event. Hereargsis honored, the chain runs headless and completes — the failure is purely that the conhost process never terminates: no visible window at all, but a deterministic 10 s block per hook event plus a leaked process chain per invocation. - Windows: managed Claude hooks flash a console window on every prompt and tool call (fixable with Claude Code
type: "http"hooks) #12925 (closed) noted Claude Codetype: "http"hooks as a fix vector for the Windows hook problems.
Impact
- Every prompt submit and every tool call in every Claude Code terminal started by Orca on Windows pays a 10 s stall plus the timeout error, and that one status report to the Orca app is lost.
- Orphaned
conhost/cmd/curlchains accumulate until manually killed.
Workaround I'm currently using
Rewrite the hook entries in ~/.claude/settings.json to spawn cmd.exe directly (no conhost wrapper):
{
"type": "command",
"command": "C:\WINDOWS\System32\cmd.exe",
"args": ["/d", "/c", "%USERPROFILE%\.orca\agent-hooks\claude-hook.cmd"],
"timeout": 10
}With this, hooks complete in <100 ms and the timeouts disappear (until Orca rewrites the file on a future update).
Suggested fix
Either spawn cmd.exe directly instead of wrapping it in conhost.exe --headless (verified working; no visible window — no conhost wrapper is needed), or register the hooks as type: "http" entries posting to the same loopback endpoint, eliminating the per-event process spawn entirely.
Activity
p0rygon commentedon Aug 16, 2026
Hit this today independently (Orca 1.4.183, Windows 10.0.22631, Claude Code) and isolated it with a controlled repro — I think the root cause here is the same one already diagnosed in #13285, and that report explains this issue's symptom more precisely than "conhost never exits."
conhost.exe does exit fine once its child actually finishes. The reason it looks like conhost is the one hanging is that
claude-hook.cmd'scurl ... --data-urlencode "payload@-"is blocked reading stdin, and since curl's stdin here is backed by conhost's ConPTY (not a plain pipe), it never sees EOF on its own — a ConPTY doesn't signal EOF just because nothing is being written, it behaves like a real terminal that could always get more input later.--connect-timeout/--max-timeonly bound the network transfer; they don't cover curl reading/assembling the request body from stdin before it opens the connection. So curl blocks indefinitely, and conhost (and the whole chain) just never terminates because its child is still alive, not because conhost itself is broken.Isolated with
System.Diagnostics.Process, mirroring the exact invocation:conhost.exe --headless→cmd.exe /d /c claude-hook.cmd(as shipped)204from the local hook server<nulappended, conhost wrapper still in place204confirmed from the local hook serverThat third row is the useful one: you don't need to drop the
conhost.exewrapper to fix this (which would reintroduce the visible-console-flash problem from #14815) — just give curl's stdin something that actually EOFs. Adding<nulto the curl line inclaude-hook.cmd(right before>nul 2>&1) fixed it here without touching thecommand/argsshape insettings.jsonat all:This also confirms something #13285 flagged but I hadn't seen directly verified: before this fix, the POST to Orca's local server wasn't just slow, it was never arriving at all — the pane-status report was being silently dropped every single time, on top of the 10s stall.
#13285's fix list (esp. options 1 and 2 — lower the timeout and/or bound the stdin read) still seems like the right long-term fix since
<nulis a one-line patch to a file Orca regenerates on update. Given this issue reproduces the same failure mode on a newer Claude Code build after #13285 was closed, it might be worth treating this as a reopen/regression of that one rather than tracking them separately — happy to attach the raw repro script if useful.OrcaWin commentedon Aug 16, 2026
Related: #14815 covers the same Windows
conhost+argshook install from the "visible/stranded console" side. This report is the Claude Code 2.1.233 path whereargsis honored andconhostnever exits (10s timeout + leaked process chain). Leaving both open.AmethystLiang commentedon Aug 16, 2026
thanks for reporting. looking into it
freddycadima513-svg commentedon Aug 17, 2026
Confirming on Orca 1.4.183 (Windows 11 10.0.22631, Claude Code CLI current): still 100% reproducible,
UserPromptSubmit hook timed out after 10s — output discardedon every prompt submit, matching @p0rygon's ConPTY-stdin-never-EOFs diagnosis (directcmd.exe /d /c claude-hook.cmdwith a real pipe completes in ~30–50 ms here).One aspect worth calling out explicitly, because it makes the user-side workaround in the OP unstable by design — from the 1.4.183 bundle:
getStatus()decides "installed" by exactcommand+argsequality with the conhost template (qu(e,t){return e.command===t.command&&JSON.stringify(e.args??[])===JSON.stringify(t.args??[])}). The working direct-cmd.exeform is therefore classified as not installed.install()then strips every hook entry whose command/args referenceagent-hooks/claude-hook(any variant, backslash-normalized,-EncodedCommanddecoded too) and re-appends the conhost template withtimeout: 10.So on every Orca start, a user-repaired
settings.jsonis reverted to the hanging conhost form. And because Claude Code snapshots hook config at session start (file edits mid-session don't take effect), any CC session launched between an Orca restart and the next manual re-fix stalls 10 s on every prompt and tool call for its entire lifetime — which is how this presents to end users: "the fix keeps coming back undone."Suggested minimal change while the proper fix (drop the conhost wrapper, or
type: "http"hooks) is decided: makegetStatus()/install()accept the directcmd.exe /d /c …claude-hook.cmdform as a valid managed install instead of reverting it, so users who've applied the known-good workaround stop getting re-broken on every app start.p0rygon commentedon Aug 20, 2026
Quick follow-up on the local
<nulworkaround from my comment above: it's confirmed to break on every point release since. On this machine,claude-hook.cmdwas regenerated (patch lost, back to the unbounded--data-urlencode "payload@-") on:both same-day, each restoring the original 10s stall until I reapplied
<nuland re-verified with the same repro (conhost wrapper intact, ~100-200ms,204from the local hook server both times).So this isn't an occasional regeneration — it looks like installing any new build rewrites this file unconditionally, which means any file-level patch (mine, or anyone else's) is a maintenance treadmill rather than a fix, and most users hitting this won't notice/reapply it, so the 10s-per-hook-event stall is presumably still live for them right now on current builds. Given how cheap the actual fix is (one flag on one line, or dropping the conhost wrapper as suggested above), it'd be good to get this landed in the installer/generated script rather than left as a local workaround.
brennanb2025 commentedon Aug 20, 2026
Thanks for the unusually good diagnostic work here — @Miscf's minimal repro, @p0rygon's ConPTY-stdin analysis, and @freddycadima513-svg's read of the installer's exact-match
getStatus()between them pinned this down faster than we would have.This is fixed on
mainby #14825, which drops theconhost.exe+argsshape entirely and installs a single self-contained command instead:No
argsfield for a consumer to honor-or-ignore, no ConPTY re-host, and-WindowStyle Hiddenkeeps the console suppressed — so it fixes this without reintroducing the visible-console problem from #14815. #15403 added a regression test that asserts the payload actually arrives, rather than asserting installer intent, which is what let all three defects through previously.That fix landed after the current release was cut, which is why it is not in 1.4.185. It is now queued as a cherry-pick and should ship within 48 hours. Until then the
settings.jsonworkarounds in this thread remain the right stopgap — and yes, they will keep getting reverted on each update until the build carrying #14825 lands.One extra data point from reproducing this on Windows 11 build 26200, worth recording because it changes what to look for: there the conhost form does not stall at all. It exits 0 in ~41 ms having never executed
claude-hook.cmd. Measured over 10 spawns against an instrumented copy of the hook script:powershell -WindowStyle Hidden -EncodedCommand(the fix)conhost --headless cmd /d /c(1.4.185)cmd.exe /d /c(the workaround here)So the 10 s timeout you see on 22621/22631 and the silent nothing on 26200 are the same defect with different surface behavior — and @p0rygon's point that the status POST was never arriving at all, not merely arriving late, holds on both. On newer Windows there is no error message at all, which is why some users will have been losing agent status without ever seeing a hook warning.
amomurawskiio425-cloud commentedon Aug 23, 2026
Your 100% reproducible 10s timeout per event + the leaked conhost/cmd/curl chain is exactly the failure mode I had. Each timed-out hook leaves an orphaned process chain because the curl under
conhost --headlessis blocked reading stdin that never gets EOF, so the harness gives up at 10s while the chain never exits.The giveaway: Orca writes
command: conhost.exe+args:[…], but the hook schema only executescommand, so--headlessnever applies and the wrapper misbehaves. It's an Orca-side bug, which is why it follows you across every event.Manual removal doesn't stick because Orca reinscribes all 11 events on next launch. The only thing that made my machine stable was cleaning the residue automatically — Coffee CLI strips exactly the Orca entries on startup, keeps my own hooks, and sits out while Orca's alive. No more 10s timeouts or process pile-up after that.
Honest note: it can't recover hooks/configs Orca already destroyed, and it's a no-op if Orca's currently running. But the config-pollution half is actually fixed, not patched over. https://github.com/edison7009/Coffee-CLI/releases/tag/v3.3.8