refactor(hooks): narrow monitoring hook matchers to their signal domains (#640)#641
Merged
Merged
Conversation
Three PostToolUse hooks previously fired on Bash|Write|Edit|Agent but only produce signal on a subset of those events: - routing-gap-recorder: scans for GAP DETECTED banners from /do skill output → only meaningful after Skill invocations; moved to Skill|Agent - record-waste: estimates token waste from tool failures → Write/Edit rarely fail with measurable token waste; narrowed to Bash|Agent - completion-evidence-check: scans for completion language in output → Write/Edit outputs never contain "I've implemented" patterns; narrowed to Bash|Agent error-learner.py stays at Bash|Write|Edit|Agent — file system errors ARE worth learning from. Net result: 3 fewer hook fires per Write/Edit operation, which is the most frequent operation class in a session. Semantics now match intent. Evolution cycle 2026-05-12, STRONG consensus (3.0/3.0).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Three PostToolUse hooks were firing under
Bash|Write|Edit|Agentbut only produce signal on a subset of those events:routing-gap-recorder.pyBash|Write|Edit|AgentSkill|AgentGAP DETECTED:banners from/doskill output — only appears in Skill invocationsrecord-waste.pyBash|Write|Edit|AgentBash|Agentcompletion-evidence-check.pyBash|Write|Edit|AgentBash|Agenterror-learner.pystays atBash|Write|Edit|Agent— file system errors ARE worth learning from.Impact
3 fewer hook fires per Write/Edit operation — the most frequent operation class in a session. On a typical session with 100 Write/Edit calls, this eliminates 300 unnecessary Python process spawns.
Test Results
routing-gap-recorderabsent fromBash|Write|Edit|Agentrouting-gap-recorderpresent inSkill|Agentrecord-waste+completion-evidence-checkonly inBash|Agenterror-learnerremains atBash|Write|Edit|AgentEvolution Cycle
This PR was generated and validated by the toolkit-evolution skill (2026-05-12 nightly cycle). Critique was unanimous STRONG from Pragmatist, Purist, and User Advocate personas.
Retro Graduation
20 ungraduated entries graduated before merge: 12 → toolkit-evolution/SKILL.md, 5 → .claude/settings.json, 1 → joy-check/SKILL.md, 1 → posttooluse-joy-check-warn.py, 1 → golang-general-engineer.md.