Summary
Child of #3508 (Windows process-creation tax). This issue covers one hook: git worktree add nesting invariant in the source-control plugin.
Measured
|
|
| Plugin |
source-control |
| Hook |
git worktree add nesting invariant |
| Event(s) |
PreToolUse:Bash |
| Timeouts in window |
418 |
| Average duration |
26.0s |
| Worst observed |
115.3s |
| Configured timeout |
15 s |
Every recorded run exceeded the 15 s timeout, so this guard is killed before it renders a verdict. It currently costs wall-clock without providing protection on this platform.
Context from the parent
Process creation on the affected host costs 0.3-0.9 s per spawn (bash -c true = 661 ms, jq -n 1 = 908 ms, cmd.exe /c exit = 872 ms, against ~3-5 ms on a healthy host). User CPU time is ~1% of wall-clock, so the fix is reducing the number of process spawns, not optimizing script logic. See #3508 for the full measurement and environment detail.
Specific guidance
Second-highest offender. Only relevant to git worktree add invocations; currently evaluated on every Bash call. Matcher narrowing is the primary fix.
Acceptance criteria
Method
Counts from ~/.claude/projects/**/*.jsonl hook_cancelled attachments with timedOut: true, across 236 sessions, 2026-08-23 to 2026-08-31.
Summary
Child of #3508 (Windows process-creation tax). This issue covers one hook:
git worktree add nesting invariantin thesource-controlplugin.Measured
source-controlgit worktree add nesting invariantPreToolUse:BashEvery recorded run exceeded the 15 s timeout, so this guard is killed before it renders a verdict. It currently costs wall-clock without providing protection on this platform.
Context from the parent
Process creation on the affected host costs 0.3-0.9 s per spawn (
bash -c true= 661 ms,jq -n 1= 908 ms,cmd.exe /c exit= 872 ms, against ~3-5 ms on a healthy host). User CPU time is ~1% of wall-clock, so the fix is reducing the number of process spawns, not optimizing script logic. See #3508 for the full measurement and environment detail.Specific guidance
Second-highest offender. Only relevant to
git worktree addinvocations; currently evaluated on every Bash call. Matcher narrowing is the primary fix.Acceptance criteria
jq).grep/sed/cut/tr/basename/dirnameon the hot path are replaced with bash builtins.Method
Counts from
~/.claude/projects/**/*.jsonlhook_cancelledattachments withtimedOut: true, across 236 sessions, 2026-08-23 to 2026-08-31.