perf(#317): collapse redundant existsSync+readFileSync in context-monitor hook (#400)

Per-PostToolUse hot path did stat-then-read ×3 (config.json, metrics bridge,
warn sentinel); collapsed to read-with-ENOENT-catch (fewer blocking syscalls,
no TOCTOU), behavior identical. Fixes #317.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-05-27 20:21:55 -04:00
committed by GitHub
parent 1868947088
commit ee820442e6
3 changed files with 311 additions and 23 deletions

View File

@@ -0,0 +1,5 @@
---
type: Fixed
pr: 317
---
context-monitor hook no longer performs a redundant stat syscall before each file read on the PostToolUse hot path