Merged
Conversation
Claude Code now has separate Stop and SubagentStop events. Previously, Stop would trigger for both the main agent and subagents. This change ensures that when a Stop hook is defined, it is also registered for SubagentStop so the same validation logic triggers for both events. Changes: - generator.py: Duplicate Stop hooks to SubagentStop in skill templates - hooks_syncer.py: Duplicate Stop hooks to SubagentStop in global hooks - Add tests verifying SubagentStop hook registration
Move SubagentStop hook generation from generator.py to the Jinja template, ensuring consistent rendering for both quality_criteria and custom hooks. Template changes: - For quality_criteria: generate both Stop and SubagentStop hooks - For custom Stop hooks: generate both Stop and SubagentStop blocks New tests: - TestGeneratorTemplateOutput verifies template generates both events - TestSubagentStopEvent verifies rules trigger on SubagentStop events
Run deepwork install to regenerate all Claude Code skills with the new SubagentStop hook support. Skills now register hooks for both Stop and SubagentStop events so they trigger for both main agents and subagents. Also includes lint fixes for unused loop variables in tests.
The manual tests were failing because the rules queue (used to prevent infinite loops) was not being cleared between tests. Once a rule fires and is added to the queue with status=QUEUED, it won't fire again until the queue is cleared. This caused "should fire" tests to pass silently without actually verifying the hook behavior. Changes: - Updated run_not_fire_tests.md to clear queue after tests - Updated run_fire_tests.md to clear queue between each test - Updated job.yml quality criteria to include queue clearing - Bumped manual_tests version to 1.1.0
When a "should fire" test doesn't show visible blocking, the agent should now check the rules queue to determine if: - Hook fired but blocking wasn't visible (queue entry exists) - Hook did NOT fire at all (queue is empty) This helps diagnose platform limitations like Task tool sub-agents not triggering SubagentStop hooks.
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.
Claude Code now has separate Stop and SubagentStop events. Previously, Stop would trigger for both the main agent and subagents. This change ensures that when a Stop hook is defined, it is also registered for SubagentStop so the same validation logic triggers for both events.
Changes: