Commit graph

3 commits

Author SHA1 Message Date
Kevin Turcios
de6046df8d Replace Node.js SessionStart hook with bash (106ms → 5ms)
The codex session-lifecycle-hook.mjs SessionStart path only appends
two env vars to CLAUDE_ENV_FILE. Rewrite that as a bash script to
avoid ~100ms V8 startup overhead. SessionEnd stays in Node.js since
it needs async broker teardown and process tree management.
2026-04-21 05:07:03 -05:00
Kevin Turcios
42b855899f Reduce hook latency by consolidating subprocess calls
Collapse multiple jq/grep/sed invocations into single passes:
- post-compact-state-inject: 7 jq calls → 1 (-51%)
- session-start: 6 sed/grep → 1 sed pipeline (-37%)
- user-prompt-context-inject: 2 jq → 1 (-33%)
- pre-compact-state-save: 3 tail|grep → 1 awk (-42%)
- post-tool-benchmark-capture: 3 jq → 1 (-23%)
- stop-optimization-gate: 3 tail|grep → 1 awk
- pre-compact: fix macOS-incompatible sed newline escaping
2026-04-21 05:01:53 -05:00
Kevin Turcios
3b59d97647 squash 2026-04-13 14:12:17 -05:00