feat(hooks): bound 11 unlimited-timeout hooks with appropriate caps#638
Merged
Conversation
Add timeout values to every hook that previously had none, eliminating the class of indefinite session stall caused by hooks that hang on slow I/O, DB queries, or filesystem operations. Timeout strategy (graduated by hook criticality): - SessionStart sync (sync-to-user-claude.py): 20000ms — expensive file sync - SessionStart session-context.py: 5000ms — learning DB query - SessionStart cross-repo-agents.py: 3000ms — directory scan - PostToolUse posttool-lint-hint.py: 3000ms — lightweight file check - PostToolUse agent-grade-on-change.py: 5000ms — agent quality analysis - PostToolUse record-activation.py: 2000ms — stats write - PostToolUse posttool-session-reads.py: 2000ms — file tracking write - PostToolUse error-learner.py: 3000ms — DB write - PostToolUse record-waste.py: 2000ms — DB write - PreCompact precompact-archive.py: 5000ms — session archiving - Stop session-summary.py: 10000ms — summary generation Evidence: 15+ learning DB timeout entries at 0.70 confidence; "SessionStart: 5/8 hooks with timeout ≤3000ms" diagnostic entry.
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
.claude/settings.json: Added timeout to 11 hooks — graduated by hook criticality:sync-to-user-claude.py: 20000ms (expensive file sync: 119 skills + 45 agents)session-context.py: 5000ms (learning DB query)cross-repo-agents.py: 3000ms (directory scan)posttool-lint-hint.py: 3000ms (lightweight file check)agent-grade-on-change.py: 5000ms (agent quality analysis)record-activation.py: 2000ms (stats write)posttool-session-reads.py: 2000ms (file tracking write)error-learner.py: 3000ms (DB write)record-waste.py: 2000ms (DB write)precompact-archive.py: 5000ms (session archiving)session-summary.py: 10000ms (summary generation)Test Results
Evidence
15+ learning DB timeout entries at 0.70 confidence; "SessionStart: 5/8 hooks with timeout ≤3000ms" diagnostic entry.
Evolution Cycle
This PR was generated and validated by the toolkit-evolution skill (2026-05-11 nightly cycle).