Repository navigation
Description
Warning
Three claims in the original body are superseded. See the correction comments. Do not work from the original acceptance criteria — they conflict with the marketplace hook budget and with the child issues.
Superseded: the acceptance criteria
The original body proposed "median PreToolUse hook-stack wall-clock under 2 s" and "no hook exceeds 5 external process spawns", while every child issue says "no more than 2 spawns". Three different bars coexisted. The binding bar is docs/conventions/hook-budget/README.md (adopted #1809, surfaced via .claude/rules/hook-budget.md):
| Surface | Budget |
|---|---|
Per tool call (PreToolUse + PostToolUse, one matcher) |
<= 1 s typical, <= 2 s worst-case |
Per turn (Stop / notification-shaped) |
<= 500 ms |
Measured as parallel wall time, not the sum. Note the original "under 2 s per hook" let a single hook consume the entire worst-case budget for the whole set — with 8 guardrails hooks on the Bash matcher, all could "pass" while the set failed the convention several times over. The Stop-event children were 4x over the per-turn ceiling under the old criterion.
Use instead, for every child:
- Spawn count on the common path, reported before and after, measured by PATH shim (the drift-immune criterion).
- The hook's measured share, by the convention's method (
EPOCHREALTIMEaround direct invocation, >= 10 runs, concurrent launch), stated in the plugin README per hook-budget Rule 1. - The always-on set stays within <= 1 s typical / <= 2 s worst-case per tool call, or <= 500 ms per turn, reported alongside the spawn-cost baseline at measurement time.
Matcher-narrowing work should additionally cite docs/conventions/hook-precision/README.md, which owns what a hook fires on.
Superseded: "they serialize"
The original body said hooks "serialize" on one tool call. The convention states Claude Code runs matching hooks in parallel — "the wall is the max of the set under spawn contention, not the sum." The transcript evidence (up to 8 hooks timing out against one toolUseID) shows they contend, which is not the same as serializing. The corrected reading: parallel dispatch, with wall-clock set by the slowest hook plus contention among them. That is also why hook cost must never be presented additively.
Superseded: the flat spawn cost and the timeout
- Spawn cost is bimodal (180-2,841 ms, 15.7x spread, at 501 concurrent processes), not the flat 661/872/908 ms quoted in the body. Never quote a spawn figure without
concurrent_processes_at_sample. - "Against a 15 s timeout" is wrong as a universal. Actual configured timeouts: source-control 15 s, guardrails 60 s, context-guard 60 s, disk-hygiene Stop 20 s, claude-ops Stop 10 s, autonomy Stop 15 s.
Method pin (was missing)
Transcript counts: hook_cancelled attachment records with timedOut: true, reading durationMs / timeoutMs / hookName / command, across 236 session files under ~/.claude/projects/**/*.jsonl, 2026-08-23 to 2026-08-31.
The static call-site counts in the original body do not reproduce and should be treated as indicative only. An independent pass on shipped guardrails 0.29.24 yields, for block-dangerous-git.sh, 184 (with comments) / 163 (lines-with-match) / 44 (comment-stripped) — none equal to the published 127. The ordering holds under every method, so #3529's headline stands, but absolute counts need the exact command and version pinned before being quoted.
Prior art, and the delivery constraint
- guardrails: recover the PreToolUse spawn-reduction work from the closed #1385 #1403 / fix(guardrails): restore PreToolUse enforcement — guards were killed at their timeout #1385 (both closed) already contain
hook::jq_fields,strip_quoted_spans, a deferredgit rev-parseprobe, a 65-spawn-per-Bash-call census, and a 437 ms unit price — plus the reason fix(guardrails): restore PreToolUse enforcement — guards were killed at their timeout #1385 did not merge: four contract-test regressions, two failing open. hook-utils.shexists in 17 copies acrossplugins/*/hooks/, delivered byscripts/sync-hook-utils.sh. Changes go through that script with all copies verified identical.- Validate with
scripts/affected-tests.sh --run.
Original body — SUPERSEDED by the block above. Kept for the record; do not work from its numbers or checklists.
Summary
On a Windows host, the marketplace hook set blocks the agent loop for hours per day. Over a 9-day window on one machine: 1,778 hook timeouts totalling 74,123 s (20.6 hours) of blocked wall-clock, mean 41.7 s each against a 15 s timeout.
The scripts are not the problem. Process creation on this host costs 0.3-0.9 s per spawn. Every hook pays that toll once for its own shell and again for each external command it invokes.
This is the parent issue for the root cause. Per-hook children are listed at the bottom.
Measured: process spawn cost
bash -c true x10 -> 6.614 s real = 661 ms/spawn (user time 0.090 s TOTAL)
bash --noprofile --norc -c true x10 -> 2.775 s real = 277 ms/spawn
jq -n 1 x10 -> 9.083 s real = 908 ms/spawn
cmd.exe /c exit x10 -> 8.719 s real = 872 ms/spawn
Two things to read off this:
- User CPU time for 10 bash spawns is 0.090 s. ~99% of wall-clock is process-creation overhead, not script work. Optimizing script logic cannot fix this.
cmd.exeis as slow asbash. This is not MSYS/Git-Bashfork()emulation. It is native Windows process creation.
Healthy reference on Linux/macOS is ~3-5 ms/spawn. This host is ~150-200x slower.
Cost model for any hook: 0.66 s (its own bash) + N x 0.91 s (each jq). A hook making 5 jq calls costs ~5.2 s before executing a single line of its own logic.
Measured: fan-out per tool call
59 hook commands are registered across 16 events by 22 enabled plugins - 17 on PreToolUse, 22 on PostToolUse. They serialize:
hooks timing out on a single tool call:
1 hook -> 113 tool calls
2 hooks -> 327
3 hooks -> 146
4 hooks -> 30
5 hooks -> 34
6 hooks -> 15
7 hooks -> 12
8 hooks -> 3
Every Bash, PowerShell, and Edit call pays the whole stack.
Measured: worst offenders
hookName || command, by timeout count, from transcript hook_cancelled attachments with timedOut: true:
423x PreToolUse:Bash PR body / pr-issue-linkage gate avg 24.7s max 115.3s
418x PreToolUse:Bash git worktree add nesting invariant avg 26.0s max 115.3s
126x PreToolUse:Bash commit subject / PR title convention avg 70.5s max 162.8s
113x Stop unsurfaced hook failures avg 21.9s max 74.1s
82x PreToolUse:PowerShell hook-bypass attempts avg 75.1s max 134.1s
81x PreToolUse:PowerShell commit subject / PR title convention avg 81.8s max 146.5s
73x Stop lane-stop gate avg 27.6s max 66.8s
68x PreToolUse:PowerShell commit-message convention avg 78.0s max 134.1s
55x PreToolUse:PowerShell dangerous git commands avg 75.9s max 134.1s
52x Stop silent destructive-guard failures avg 31.8s max 57.9s
43x PreToolUse:PowerShell --no-verify bypass avg 76.1s max 134.1s
27x PreToolUse:Bash Windows drive-root /tmp writes avg 73.4s max 112.6s
10x PostToolBatch context-zone crossing avg 73.0s max 96.0s
Note every duration is 2-8x past the 15 s timeout. The guard is killed mid-run and never renders a verdict - the user pays 15-160 s for a check that does not complete. These guards are currently pure cost with zero protective value on this platform.
Static call-site counts (indicative, not runtime)
External-command call sites per script (jq|grep|sed|awk|date|git|python|realpath|dirname|basename|cut|tr). Many sit in branches, so this is an upper bound, not an executed-spawn count:
127 block-dangerous-git.sh
113 hook-utils.sh
110 block-noncanonical-commit.sh
52 block-hook-bypass.sh
38 stale-path-verify.sh
30 block-no-verify.sh
23 block-convention-violation.sh
22 skill-reference-verify.sh
22 cli-flag-verify.sh
21 hardcoded-path-check.sh
hook-utils.sh is sourced by every guardrails hook, so its 113 call sites are paid on every hook run that reaches them.
Environment / what is NOT the cause
- Windows 11 Pro 26200, AzureAD-joined. Claude Code 2.1.251 (native install). Git Bash (MSYS).
- Defender is not the cause.
WinDefendservice is Stopped (StartType Manual);Get-MpPreferenceandGet-MpComputerStatusboth fail with "Provider load failure". - No AppLocker policy.
AppInit_DLLsempty. Smart App Control off. - Prime suspect:
Win32_DeviceGuardreportsCodeIntegrityPolicyEnforcementStatus = 2(WDAC kernel-mode policy enforced) withVirtualizationBasedSecurityStatus = 2. A WDAC policy in enforcement mode validates code integrity on every process launch, which fits 300-900 ms spawns - especially for unsigned MSYS binaries that miss the signature cache. - Not yet checked:
fltmc filtersrequires elevation. Enumerating minifilter drivers is the remaining unknown.
Proposed work, in value order
1. Cut spawn COUNT, not script runtime. This is the whole game. Concretely:
- Collapse multi-
jqcall sites into a singlejqinvocation per hook (hook::jq_fieldsalready does this in places - apply it everywhere). - Replace
grep/sed/cut/tr/basename/dirnamesubprocess calls with bash builtins (parameter expansion,[[ =~ ]]). Each one removed saves ~0.9 s on this class of host. - Avoid sourcing the full
hook-utils.shwhen a hook needs two helpers.
2. Consolidate hooks per event. 17 PreToolUse commands is 17 shells. A single dispatcher process that runs the guards in-process and returns one verdict would cut PreToolUse cost by roughly 17x on the spawn axis alone.
3. Narrow matchers. Several guards fire on every Bash call but only care about git/gh invocations. A matcher that excludes non-git commands removes most of the fan-out for free.
4. Add a platform escape hatch. A documented switch to disable the shell-based guard set on Windows hosts where spawn cost is pathological, so the fleet degrades to "unprotected but usable" instead of "protected in theory, unusable in practice".
5. Raise or make configurable the 15 s hook timeout - secondary. Currently every one of these runs is killed, so the guard provides no protection while still costing the full wall-clock.
Out of scope for this repo
The 872 ms native process-creation cost is a machine/IT problem (likely the enforced WDAC policy). Worth pursuing in parallel with IT - a code-integrity exclusion for the toolchain would recover most of the 20.6 hours without any change here. This issue covers making the hook set resilient to slow hosts regardless.
Per-hook children
To be filed separately so a Windows host can work them independently:
-
source-control: pr-issue-linkage gate (423 timeouts - highest single offender) -
source-control: git worktree nesting invariant (418) -
guardrails:block-convention-violation.shcommit subject / PR title (207 across Bash + PowerShell) -
guardrails: Stop - unsurfaced hook failures (113) -
guardrails:block-hook-bypass.shperf (105) - correctness tracked separately in fix(guardrails): block-hook-bypass.sh fails CLOSED on a Windows stdin read stall, blocking valid tool calls with 'hook stdin is not valid JSON' #3507 -
guardrails:block-noncanonical-commit.sh(91) -
autonomy: Stop - lane-stop gate (73) -
guardrails:block-dangerous-git.sh(59) -
guardrails: Stop - silent destructive-guard failures (52) -
guardrails:block-windows-drive-tmp.sh(49) -
guardrails:block-no-verify.sh(44) -
guardrails:block-exported-msys-pathconv.sh(15) -
context-guard: PostToolBatch context-zone crossing (10) -
guardrails:secret-pattern-detection.sh/hardcoded-path-check.sh(PreToolUse:Edit, ~60 s each observed)
Acceptance criteria
- Median PreToolUse hook-stack wall-clock on a Windows host is under 2 s.
- No hook in the set exceeds 5 external process spawns on its common path.
- A documented way to disable the shell-guard set per-platform exists.
- Re-measuring the transcript corpus after the change shows a >90% reduction in
timedOut: truehook attachments.
Method
Counts derived from ~/.claude/projects/**/*.jsonl hook_cancelled attachment records (timedOut: true, durationMs, timeoutMs) across 236 sessions, 2026-08-23 to 2026-08-31. Spawn timings from time over 10 iterations each.
Activity
kyle-sexton commentedon Aug 31, 2026
Per-hook children filed:
Not filed here:
guardrails/block-dangerous-git.sh(59 timeouts, avg 75.9s, 127 external call sites) — already claimed by a separate in-flight session.Related correctness issue: #3507 (block-hook-bypass.sh fails CLOSED on Windows stdin stall).
kyle-sexton commentedon Aug 31, 2026
Correction on the suspected cause — WDAC is weaker evidence than the issue body implies.
The body names an enforced WDAC policy as the "prime suspect". My own measurement argues against it being the mechanism:
cmd.exe /c exitwas spawned 10 times — the same binary each time — and every spawn cost ~872 ms flat. If per-process code-integrity validation were the cause, a signature cache should make spawns 2-10 substantially cheaper than spawn 1. Flat cost across identical repeated spawns points away from one-time-per-binary validation and toward something sitting in the per-creation path itself: a filesystem minifilter, an ETW consumer, or a process-creation callback.CodeIntegrityPolicyEnforcementStatus = 2is a real observation and worth reporting to IT, but it should not be presented as the identified cause.Corrected status: root cause unidentified. What is established:
cmd.exeis equally slow).WinDefendis Stopped; the WMI provider fails to load).Discriminating next test:
fltmc filtersunder elevation, to enumerate minifilter drivers. That was not possible in the diagnosing session (access denied without admin).None of this changes the remediation. The 1,778 timeouts / 20.6 hours are measured, and reducing process-spawn count per hook is the correct fix on any host where spawn cost is high — whatever is ultimately making it high here.
kyle-sexton commentedon Aug 31, 2026
Second correction: the diagnosis is CONTENTION, not WDAC. Measured by
/claude-ops:audit-performance.I re-ran this through the purpose-built engine (
claude-ops:audit-performance, which takes a load-labelled no-op spawn baseline). It reaches a better-supported verdict than the hand-rolled numbers in the issue body, and it invalidates the framing of my first correction as well.Spawn cost is BIMODAL, not a flat floor
A 15.7x spread across identical no-op spawns, sampled at 501 concurrent processes on the machine. Per the engine's own reading guidance,
bimodal-spawn-latencyis the contention diagnosis rather than a hint toward one.min_msof 180 ms shows the machine is capable of far better when uncontended.This corroborates independent measurement from a parallel session working the disk-hygiene guard, which saw bare
bash -c trueat 1825 ms and 283 ms within the same hour at ~10% CPU — roughly 6x drift.Consequences for this issue, and they are significant:
concurrent_processes_at_sample.CodeIntegrityPolicyEnforcementStatus = 2) but is now the weaker of two explanations. Note also thatWinDefendbeing Stopped with a provider load failure is consistent with a third-party EDR having displaced Defender, not with no scanner running — so scanning is not ruled out, and WDAC and a filter driver are not mutually exclusive.fltmc filtersunder elevation is still the discriminating test.New evidence the issue body did not have
Per-turn hooks — the bucket nobody looks at. The engine separates them:
39 hooks fire per tool call. The 7 per-turn hooks (
autonomy,claude-ops,codex,context-guard,disk-hygiene,security-guidance) are what make a long conversation degrade, and none of the children above cover that axis.Subagent fan-out multiplies all of it.
Depth 5 (above the documented default of 3) against 12 concurrent subagents per session, with every subagent carrying the same 39-hook per-tool-call fan-out as its parent. Seven sessions were active in the last hour. That is the mechanism by which a modest-looking configuration licenses a very large process population.
(Trap worth recording: these are read through a truthiness test on the raw string, and
"0"is truthy. Setting one to 0 is a silent no-op; only removing the variable disables it.)Statusline is an additional
bashspawn on a 60 s refresh:bash "C:/Users/KyleSexton/.claude/statusline/entrypoint.sh".Cleared by measurement (recording the negatives, so nobody re-derives them):
sweep_health.findings: [],tree_census.walk_seconds: 2.858. Healthy.latestchannel.slow_version_probe: false, probe took 0.086 s.claude.exeand 2 node/bun. The contention is coming from elsewhere on the machine.Reusable optimization pattern, from a completed fix
A parallel session took the disk-hygiene guard launcher from 4 process spawns per warm invocation to 1 and measured it with an interleaved A/B (24 pairs, arms alternating within one run so the drift hits both equally):
The
AFTER min = 124 msis the important line: with spawn count minimised, the hook lands in ~124 ms when the machine is briefly uncontended. The remaining wall-clock is almost entirely the one irreducible interpreter spawn.The 3 spawns removed were:
dirname, asedread of a 3,500-line file, and a whole extra Python interpreter launched only to evaluate asys.version_info >= MIN_PYTHONpredicate. None of that work was slow in itself — it was 3 process creations.Three non-obvious traps, all of which cost that session a round and none of which are visible in the script text:
x="$(f)"is a spawn. Command substitution forks a subshell, and on MSYS a subshell is a real process creation. A "builtins-only" helper that returns its answer on stdout still costs a full process. Hot-path helpers must assign to a global instead. This likely invalidates "already builtins" assumptions across several of the children.${var: -N}returns the EMPTY string when the string is shorter than N. It silently collapsed a per-plugin cache key into one shared file.os._exit/ hard exits skip stdio flushing. A hook that buffers its decision and then hard-exits loses the decision, and the harness sees no output — which for aPreToolUsegate is a fail-OPEN. That is a correctness bug, not a perf one, and worth checking in any hook that exits non-cooperatively.Caching pattern that produced the 4->1: cache the expensive resolution rather than making it fast. Key on
$PATHverbatim plus the resolved binary's identity; validate with[[ -x ]],[[ -s ]]and[[ ! "$bin" -nt "$cachefile" ]](all builtin, and-ntcatches an in-place upgrade); add a TTL; publish with temp-file +mv -ffor concurrent writers; and make every miss fall back to full resolution, never to "no result".Acceptance criterion correction
"A single run completes in under 2 s on a Windows host" is barely compatible with "no more than 2 external process spawns" — at 0.66-0.91 s per spawn, 2 spawns is already 1.3-1.8 s before any work, and under contention it is far worse. Restate as: "under 2 s at a measured spawn cost of X ms, with X reported alongside." Otherwise a pass on a healthy box becomes a fail on a contended one and the criterion loses meaning. The spawn-count criterion is the one that should gate review.
This tax causes INCORRECT DENIALS, not just slow ones
Reframing the severity. The disk-hygiene guard's watchdog fired twice in a parallel session and denied two ordinary read-only
grepcommands withinternal deadline of 10s exceeded. Both succeeded on identical retry.That is the important consequence and the issue body understates it: a timing-derived guard failure is not merely latency, it is a non-deterministic false denial of legitimate work. Combined with the fail-closed stdin path in #3507, the pattern is that this hook set converts host contention into arbitrary, unreproducible blocks. A guard that denies correct commands under load is worse than no guard, because the operator cannot distinguish it from a real policy decision.
Related, filed separately
disk-hygiene:_engine_gate_relevantsamefile-scans every token of every command rather than only separator-carrying words, contradicting both its docstring and its inline comment. A dead drive letter or disconnected UNC path in an unrelated command blocks for as long as the OS takes to fail. A concrete instance of "the work inside a spawn can also be unbounded" — spawn count remains the dominant term, but not the only one.guardrails: hooks exit 1 with no diagnostic when they abort. Flagged in the wild forcli-flag-verify.shandblock-windows-drive-tmp.sh, neither of which contains an explicitexit 1and neither of which usesset -e. Not reproducible on demand, so filed as a robustness gap: there is noERR/EXITtrap, so any abort betweensource hook-utils.shand the finalexit 0exits silently — and for aPreToolUseguard, exit 1 is non-blocking, so it enforced nothing and told nobody. The process-creation tax documented here is the plausible trigger.The suggested fix for #3528 is a shared trap helper in
hook-utils.shrather than per-hook edits, since one change covers all 17 PreToolUse and 22 PostToolUse registrations. Ifhook-utils.shis being touched for the spawn reductions anyway, both should land together.kyle-sexton commentedon Aug 31, 2026
Child list amendments:
guardrails/block-dangerous-git.sh(127 call sites, the most in the set). It was originally left unfiled on a mistaken assumption that a parallel session owned it; that session has confirmed it does not. Now owned.disk-hygiene— it was misattributed to guardrails on filing. It isdisk-hygiene/skills/clean/scripts/guard_launch_monitor.pyviahooks/run-python-hook.sh, and a fix is already in flight onperf/disk-hygiene-guard-hook-spawns.disk-hygieneandguardrailsrespectively; both are cross-referenced in the correction comment above.Full child set is now #3509-#3521, #3529, plus #3527/#3528, with #3507 tracking the fail-closed correctness bug.
perf(claude-ops): fleet-state.sh in three jq passes, 12 process creat…
feat(claude-ops): audit-performance kernel_objects census, the host-l…
kyle-sexton commentedon Sep 5, 2026
Finding from shard #3520 that changes the diagnosis for the remaining shards
Posted by the autonomous worker lane (
vm-worker-202609050257) after landing draft PR #3779 for #3520. Recording it here because it affects how the other twelve shards should be approached, not just this one.The stated cause was not the cause here
This campaign attributes the tax to per-field
jqforks. Inzone-crossing-inject.shthat was already fixed — the hook batched both envelope fields into a singlejq. The real cost was redirection placement.Bash elides the extra fork inside
$(...)and execs in the substitution's own subshell only when the command carries no redirection of its own. A2>/dev/null, a<<<, or a pipeline written inside the substitution defeats that optimization and forks twice for one program. Measured on this host:$(jq . f)$(jq . f 2>/dev/null)$(printf … | jq …){ V=$(jq . f); } 2>/dev/nullHoisting the redirects onto enclosing groups took this hook from 8 process creations to 3, with
execveunchanged at 4 — same programs, same inputs. That invariance is the evidence it is a latency fix rather than work removed.The existing budget test was measuring the wrong thing
This is the part worth propagating. The plugin's xtrace-based budget test read "2 processes" while the kernel was making 8, and passed. A fork that never execs never reaches a command position, so an xtrace command-position count is blind to exactly the fork this campaign is about.
Any shard validated against a command-position budget may be reporting a saving it did not make, or missing a cost it still has. The replacement in #3779 pins creations by
strace -f -e trace=clone,clone3,fork,vfork,execveat exactly 3 and launches at exactly 4, and was verified non-vacuous by mutation: moving one redirect back inside its substitution takes the count to 4 and fails the test, while the old command-position budget passed silently on the same mutation.Recommendation for the remaining shards: check redirection placement before assuming
jqbatching is the fix, and measure with a trace-based creation count rather than a command-position count.One saving deliberately declined
A further process was available by handing stdin straight to
jqinstead of keeping thepayload.shdrain loop. That was not taken: the loop carries a documented boundedread -t 5that caps a stalled pipe, which is the exact timeout symptom this campaign exists to fix. Trading it for one fork would have reintroduced the failure mode.Not yet confirmed on the target platform
Wall-clock is not measurable on this Linux runner (~1 ms/spawn) against the Windows tax this campaign documents (180-2,841 ms/spawn, median 1,108 ms). At that median, 5 fewer creations is roughly 5.5 s per fire, but that projection needs confirming on a real Windows host before the acceptance criterion is signed off. No timing figure was invented.
Generated by Claude Code
docs(context-guard): correct the spawn-reduction claims
kyle-sexton commentedon Sep 6, 2026
Campaign-wide finding: no test guards the dimension this campaign is about
Posted by the autonomous worker lane (
vm-worker-202609050257) after a measured verification pass over #3513, #3514, #3517, #3518 and #3519. Recording here because two of these affect every shard.1. The guardrails budget test pins
execveonly, not forksrun-guards.test.sh:168-215counts with PATH shims and asserts onexecve. The fork dimension is unguarded. That is the same blind spot #3779 found in the xtrace command-position budget, which read 2 while the kernel made 8: a fork that never execs is invisible to both methods.Since this campaign is about process creations, not program launches, every shard validated against either method may be reporting a saving it did not make or missing a cost it still has. A
strace -f -e trace=clone,clone3,fork,vfork,execvebudget is the only method that has held up.2. Credit for the recent wins is misattributed
The measured record across the eight-guard Bash matcher, benign call: 16 execve / 65 creations before #3781, now 3 execve / 36 creations, with batch p50 going 97 → 78 → 67 → 49 ms across #3781, #3788 and #3820.
But per-shard, #3788 is repeatedly credited for work it did not do:
ps-command.shparse (78→67 ms). The 2gitexecs and 5 forks were removed by273c20fe(perf(guardrails): drop leftover git probes on a benign Bash call #3820).dirname; perf(hooks): cut leftover Bash parse and dirname tax on the hot path #3788 moved a$(cd … && pwd)that never forks, because Claude Code always setsCLAUDE_PLUGIN_ROOT.Anyone sizing remaining work off "#3788 fixed it" should re-derive.
Per-shard verdicts, measured
:159unconditional file-scopeSUBJECT=$(…),:478$(strip_literals), and fourdone < <(printf …)process substitutions. Keep open.OSTYPEgate precedesbuffer_stdin), 2 on the msys Bash lane3. The largest remaining fleet win is in the fenced file
Of the 36 creations in a benign eight-guard batch, 8 come from the absence of a
hook::buffer_stdin_to <var>form inlib/hook-utils.sh. That is one change in one shared file worth more than several remaining shards combined — but it is the file unmerged PRs #3740 and #3838 own, so no shard can take it.The in-process batching claim does hold up:
run-guards.shcallshook::buffer_stdinonce and primes jq once for the whole batch, so no individual guard contributes a jq spawn.Generated by Claude Code
kyle-sexton commentedon Sep 6, 2026
This was generated by AI during triage.
Cross-reference: #3623 is the program created to solve this, and it has landed
This issue is the original problem statement. #3623 ("Hook performance program: measure and cut every runtime-cost surface on the Windows host") is the execution vehicle that was opened against it, and as of 2026-09-03 every one of its eight phases is checked with Phase 8 merged as #3679.
The mapping onto this issue's own proposed-work list is direct:
ifgates, matcher scoping, explicit timeouts)#3623's outcome comment carries the after-column measured on the same host class: PostToolUse:Write 13,225 to 1,949 ms, PostToolUse:Edit 17,192 to 3,048 ms, PostToolBatch 1,254 to 282 ms, UserPromptSubmit 975 to 297 ms, PreToolUse:Bash 2,475 to 1,599 ms.
What is still open here, and why this should not be closed on that basis:
timedOut: trueattachments was the criterion that closes the loop from the 1,778-timeout evidence, and no such re-measurement appears in either thread. That is the open work item here, and it is now a measurement task rather than a planning one.Recommendation: link #3623 as the executing program and re-scope this issue to the re-measurement plus the two untaken items, rather than closing or consolidating. A human should decide whether the residual justifies keeping
priority: critical. Nothing was closed, relabeled, or edited by this pass.Also cross-linked: #3505 (skill-listing aggregate) shares the hook-budget and context-budget territory but is a distinct surface; #3623's Phase 6 touched it and left it substantially open.
Generated by Claude Code
perf(autonomy): cut lane-stop-gate process creations on every Stop
fix(guardrails): every hook says so when it could not run (#3528) (#3895
5 remaining items
perf(guardrails): drop the forks that never exec in block-noncanonica…
perf(autonomy): cut lane-stop-gate process creations on every Stop (#…
perf(claude-ops): halve hook-failure-audit spawns by moving redirects…
perf(context-guard): cut the zone-crossing fire from 8 process creati…
perf(guardrails): block-hook-bypass drops six forks that never exec (#…
perf(claude-ops): halve hook-failure-audit spawns by moving redirects…
perf(guardrails): hoist three convention-gate redirects off their sub…
perf(claude-ops): halve hook-failure-audit spawns by moving redirects…
perf(guardrails): drop the forks that never exec in block-dangerous-g…
fix(hook-utils): a hook payload cut short at EOF is a loud allow; a s…
kyle-sexton commentedon Sep 27, 2026
This was generated by AI during attend-queue.
Closing (operator-approved, 2026-09-27): #3623 (all 8 phases) is the program that fixed the Windows process-creation tax and 1,778 timeouts, and #3685 (the residual dispatcher budget miss) closed COMPLETED on 2026-09-23. The remaining timeout re-measure is optional and can be filed separately if still wanted.
docs(claude-ops): compose /doctor after audit-performance capture (#3533