Repository navigation
perf(agent-hooks): start one fewer process per Claude notify event and Codex hook event - #45301
Conversation
…d Codex hook event - Claude: an event that asked for no decision (every event but PreToolUse and a blocking PermissionRequest) discarded the reply but still captured it in a command-substitution subshell. It now posts the same request straight to /dev/null, the form non-deciding Claude-compatible scripts already use. - Codex: the payload capture subshell execs /bin/cat instead of forking it, the reader Claude's script has used since #38180. Same bytes; falls back to the old reader when /bin/cat is missing. An old-vs-new harness against a fake hook server gave identical requests, stdout, exit codes and spool files across 72 runs (local and posix scripts, 9 events, Orca up and down). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Cuts one process from most managed hook runs without changing anything Orca receives.
$( … )subshell. These events now send the same request straight to/dev/null. The scripts for Claude-compatible CLIs already post this way.execs/bin/catinstead of forking it. Claude's script has done this since perf(agent-hooks): start 7 processes per Claude hook event instead of 17 #38180. If/bin/catis missing, it falls back to the old reader.Evidence
pnpm check:changedpasses.claude-status-line-install.test.tsfails 2 Windows cases with the same "AppEnvironment not initialized" error atbb227ae04edwithout this change.Risk
Low. The Claude change only touches the path whose reply was already discarded, and it reuses that path's existing post form. The Codex change produces the same bytes, using the reader already shipped for Claude.
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com