You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: Claude Code hooks are written with an args array that Claude Code ignores, so a bare conhost.exe runs on every tool call #15797
On Windows, Orca writes Claude Code hook entries containing an args array. Claude Code's hook schema has no args field — it executes command only. The effective command is therefore a bare C:\WINDOWS\System32\conhost.exe, which spawns a console host, emits terminal control sequences, and never invokes claude-hook.cmd.
Environment
Orca 1.4.185 (publisher: stablyai)
Claude Code 2.1.229 (winget install)
Windows 11 Pro 26200
VS Code integrated terminal (also reproduced in a standalone terminal; not visible in JetBrains' terminal, which does not apply the sequences)
The intent is clearly correct — run the .cmd inside a headless conhost so no console window flashes. The problem is only that Claude Code takes a single command string, not command + args.
Impact
With args dropped, each hook run executes a bare conhost.exe, which writes this to the terminal:
ESC[2J + ESC[H clear the screen and home the cursor — on every tool call. In VS Code's integrated terminal this visibly wipes output mid-session (the reported symptom was "text keeps disappearing").
ESC[?9001h then ESC[?9001l toggles win32-input-mode on and back off, which can desync keyboard handling from what the TUI expects.
ESC]0;… retitles the terminal tab to conhost.exe.
The hook exits 0, so Claude Code records it as a successful run and nothing is logged as an error.
Orca's agent-hook integration never runs at all — claude-hook.cmd is never invoked, so no hook events reach the local endpoint.
Measured over ~29 days of local session transcripts: 899 recorded hook runs, 800+ of them in the ~44 hours after install (206 PreToolUse + 201 PostToolUse for the Bash tool alone).
Suggested fix
Collapse the invocation into a single command string and drop args:
It would also help to re-read ~/.claude/settings.json after writing and assert that no args key survives in the entries Orca owns.
Not affected
claude-hook.cmd, codex-hook.cmd and claude-statusline.cmd themselves are fine. The statusline integration works correctly — only the hook-entry shape is wrong.
The Codex integration is unaffected: ~/.codex/config.toml contains no Orca hook wiring.
Additional detail that narrows the repro: no project or agent session inside Orca is needed — installing and launching Orca once is sufficient.
On this machine the hooks were written on first launch, before Orca was ever used for anything: at that point ~/.orca/ contained nothing but agent-hooks/ (no sessions, no worktrees, no project state), and %APPDATA%/Orca held only empty Electron cache directories.
Repro steps
Windows 11, Claude Code installed (~/.claude/settings.json exists)
Install Orca 1.4.185 and launch it once — do not open a project or start any agent
Inspect ~/.claude/settings.json → 11 hook entries appear, each command: conhost.exe plus an args array that Claude Code's hook schema doesn't recognize
Outside Orca (e.g. VS Code integrated terminal), start a Claude Code session and let it run any tool
Observed: on every tool call the screen is cleared (ESC[2J + ESC[H) and the tab is retitled to conhost.exe; claude-hook.cmd never runs
Expected: outside Orca the hook should be a silent no-op (the env-var guards in claude-hook.cmd are designed for exactly that); inside Orca it should report the event via claude-hook.cmd
Timeline from this machine: Orca installed 2026-08-19; first launch 2026-08-20 19:22 local — agent-hooks/ and the 11 hook entries appeared at that minute, and the first corrupted hook run shows in Claude Code transcripts one minute later.
Version-pinned this against the release tags by reading src/main/claude/hook-settings.ts at each:
v1.4.185 / v1.4.186 — getWindowsManagedLifecycleHook is exactly the decompiled builder: {command: <System32>\conhost.exe, args: ["--headless", <System32>\cmd.exe, "/d", "/c", %USERPROFILE%\.orca�gent-hooks\<script>]}, gated on the (mis)assumption that Claude's exec form supports args (supportsExecHookArgs). So the reported shape is what 1.4.185 ships.
v1.4.187 / main — the builder is reworked to a single self-contained command (an encoded PowerShell launcher whose comment states the reason verbatim: "some Claude-compatible consumers ignore args, so the invocation must be self-contained"), with conhost gone from the file entirely. A scan of the current hook installers finds no writer that emits an args key anymore.
Self-healing on upgrade: the install sweep's managed-command matcher (hookHasManagedCommand) also scans args entries for the agent-hooks/<script>.cmd needle, so the legacy conhost entries are recognized as managed and replaced by the new single-string command on the first launch of a current build — no manual settings.json surgery needed.
So: fixed in 1.4.187; anyone on 185/186 should update and relaunch once with any Claude worktree active. If args-shaped Orca entries reappear on 1.4.187+, that would be a regression worth a fresh report.
Thanks @yzxcj797 for the detailed version-pinned diff — really helpful.
Confirming empirically: updated this machine from 1.4.185 to 1.4.187 (release asset, sha256-verified) and relaunched once. ~/.claude/settings.json now gets a single self-contained command string per hook (no args key, no bare conhost.exe). Decoded the payload — it runs claude-hook.cmd if present, otherwise drains stdin and prints {} as a clean no-op, so no more screen-clearing outside Orca either. Self-heal worked as described, no manual settings.json editing needed.
Marking this resolved on my end. Will reopen with a fresh report if args-shaped entries ever reappear on 1.4.187+.
Thank you — this is an unusually precise report, and the diagnosis is exactly right.
Already fixed on main, ahead of your build. The {command, args} shape you decompiled from 1.4.185's app.asar was replaced in #14818/#14815. Windows hooks are now written as a single command string with no args key:
src/main/agent-hooks/windows-powershell-hook-launcher.ts. Switches are -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden, and the payload is -EncodedCommand UTF-16LE base64 — so nothing has to survive cmd.exe or MSYS rewriting, and there is no args array for a consumer to drop. Hidden PowerShell replaced conhost specifically because, unlike conhost, it relays hook output and exit status (#14818).
Two things your report adds that the fix did not have, and which I have kept:
The failure was silent in both directions — no console flash to notice, and the hook never ran, so hook-dependent features simply did nothing. Worth remembering as a shape: a launcher whose arguments a consumer may drop degrades to "runs the launcher bare", which is rarely harmless.
installer-utils.ts still understands the legacy args shape (hookHasManagedCommand) so an upgrade can recognise and clean up the 11 entries 1.4.185 wrote into your ~/.claude/settings.json. That matters — without it those stale entries would keep firing after the upgrade. Confirmed present on main.
Closing as fixed. If a build after 1.4.185 still writes args for you, please reopen with the settings.json block — that would mean the cleanup path is missing a case.
Related: #15767 reports the same root cause via Cursor's hook import.
Same bug hit me — and your diagnosis is correct. Claude Code's hook schema has no args; it runs command verbatim, so Orca's conhost.exe + args: [--headless,…] becomes a bare conhost that spawns a console and never calls claude-hook.cmd. That's root-caused in Orca's Windows hook builder, not your setup.
The frustrating part is deleting those 11 entries by hand doesn't last — Orca re-installs them every time it starts, so the windows come straight back.
What actually ended it for me was letting Coffee CLI clean the residue on launch: it drops only the Orca-written hook entries from ~/.claude/settings.json (yours stay intact) and skips while Orca is running so it doesn't fight Orca. After that the bare-conhost-per-tool-call stopped for good.
One honest caveat: it won't restore hooks Orca already deleted, and if Orca stays running it won't touch anything while active. But for this exact args-swallowing pollution it's a real cure, not a workaround. https://github.com/edison7009/Coffee-CLI/releases/tag/v3.3.8
Activity
maytayci commentedon Aug 21, 2026
Additional detail that narrows the repro: no project or agent session inside Orca is needed — installing and launching Orca once is sufficient.
On this machine the hooks were written on first launch, before Orca was ever used for anything: at that point
~/.orca/contained nothing butagent-hooks/(no sessions, no worktrees, no project state), and%APPDATA%/Orcaheld only empty Electron cache directories.Repro steps
~/.claude/settings.jsonexists)~/.claude/settings.json→ 11 hook entries appear, eachcommand: conhost.exeplus anargsarray that Claude Code's hook schema doesn't recognizeESC[2J+ESC[H) and the tab is retitled toconhost.exe;claude-hook.cmdnever runsclaude-hook.cmdare designed for exactly that); inside Orca it should report the event viaclaude-hook.cmdTimeline from this machine: Orca installed 2026-08-19; first launch 2026-08-20 19:22 local —
agent-hooks/and the 11 hook entries appeared at that minute, and the first corrupted hook run shows in Claude Code transcripts one minute later.yzxcj797 commentedon Aug 21, 2026
Version-pinned this against the release tags by reading
src/main/claude/hook-settings.tsat each:getWindowsManagedLifecycleHookis exactly the decompiled builder:{command: <System32>\conhost.exe, args: ["--headless", <System32>\cmd.exe, "/d", "/c", %USERPROFILE%\.orca�gent-hooks\<script>]}, gated on the (mis)assumption that Claude's exec form supportsargs(supportsExecHookArgs). So the reported shape is what 1.4.185 ships.command(an encoded PowerShell launcher whose comment states the reason verbatim: "some Claude-compatible consumers ignoreargs, so the invocation must be self-contained"), withconhostgone from the file entirely. A scan of the current hook installers finds no writer that emits anargskey anymore.Self-healing on upgrade: the install sweep's managed-command matcher (
hookHasManagedCommand) also scansargsentries for theagent-hooks/<script>.cmdneedle, so the legacy conhost entries are recognized as managed and replaced by the new single-string command on the first launch of a current build — no manual settings.json surgery needed.So: fixed in 1.4.187; anyone on 185/186 should update and relaunch once with any Claude worktree active. If args-shaped Orca entries reappear on 1.4.187+, that would be a regression worth a fresh report.
maytayci commentedon Aug 21, 2026
Thanks @yzxcj797 for the detailed version-pinned diff — really helpful.
Confirming empirically: updated this machine from 1.4.185 to 1.4.187 (release asset, sha256-verified) and relaunched once.
~/.claude/settings.jsonnow gets a single self-containedcommandstring per hook (noargskey, no bareconhost.exe). Decoded the payload — it runsclaude-hook.cmdif present, otherwise drains stdin and prints{}as a clean no-op, so no more screen-clearing outside Orca either. Self-heal worked as described, no manual settings.json editing needed.Marking this resolved on my end. Will reopen with a fresh report if args-shaped entries ever reappear on 1.4.187+.
nwparker commentedon Aug 22, 2026
Thank you — this is an unusually precise report, and the diagnosis is exactly right.
Already fixed on
main, ahead of your build. The{command, args}shape you decompiled from 1.4.185'sapp.asarwas replaced in #14818/#14815. Windows hooks are now written as a singlecommandstring with noargskey:src/main/agent-hooks/windows-powershell-hook-launcher.ts. Switches are-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden, and the payload is-EncodedCommandUTF-16LE base64 — so nothing has to survive cmd.exe or MSYS rewriting, and there is noargsarray for a consumer to drop. Hidden PowerShell replaced conhost specifically because, unlike conhost, it relays hook output and exit status (#14818).Two things your report adds that the fix did not have, and which I have kept:
installer-utils.tsstill understands the legacyargsshape (hookHasManagedCommand) so an upgrade can recognise and clean up the 11 entries 1.4.185 wrote into your~/.claude/settings.json. That matters — without it those stale entries would keep firing after the upgrade. Confirmed present onmain.Closing as fixed. If a build after 1.4.185 still writes
argsfor you, please reopen with thesettings.jsonblock — that would mean the cleanup path is missing a case.Related: #15767 reports the same root cause via Cursor's hook import.
nwparker commentedon Aug 22, 2026
Fixed on main by #14818/#14815: Windows hooks are now a single command string via hidden PowerShell -EncodedCommand, with no args array.
amomurawskiio425-cloud commentedon Aug 23, 2026
Same bug hit me — and your diagnosis is correct. Claude Code's hook schema has no
args; it runscommandverbatim, so Orca'sconhost.exe+args: [--headless,…]becomes a bare conhost that spawns a console and never callsclaude-hook.cmd. That's root-caused in Orca's Windows hook builder, not your setup.The frustrating part is deleting those 11 entries by hand doesn't last — Orca re-installs them every time it starts, so the windows come straight back.
What actually ended it for me was letting Coffee CLI clean the residue on launch: it drops only the Orca-written hook entries from
~/.claude/settings.json(yours stay intact) and skips while Orca is running so it doesn't fight Orca. After that the bare-conhost-per-tool-call stopped for good.One honest caveat: it won't restore hooks Orca already deleted, and if Orca stays running it won't touch anything while active. But for this exact
args-swallowing pollution it's a real cure, not a workaround. https://github.com/edison7009/Coffee-CLI/releases/tag/v3.3.8