Skip to content

Commit c1e7e9b

Browse files
jwaldripclaude
andcommitted
feat(hooks): use han wrap-subagent-context for PreToolUse injection
- Add PreToolUse hook for Task|Skill using han hook wrap-subagent-context - Remove SubagentPrompt hook from han-plugin.yml (now handled by hooks.json) - Fix CLAUDE_LOCAL_PLUGIN_DIR -> CLAUDE_PLUGIN_ROOT - Fix timeouts from milliseconds to seconds Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3c89a32 commit c1e7e9b

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

.claude-plugin/hooks.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@
77
"hooks": [
88
{
99
"type": "command",
10-
"command": "bash \"${CLAUDE_LOCAL_PLUGIN_DIR}/hooks/redirect-plan-mode.sh\"",
11-
"timeout": 5000
10+
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/redirect-plan-mode.sh\"",
11+
"timeout": 5
12+
}
13+
]
14+
},
15+
{
16+
"matcher": "Task|Skill",
17+
"hooks": [
18+
{
19+
"type": "command",
20+
"command": "han hook wrap-subagent-context --context-command 'bash \"${CLAUDE_PLUGIN_ROOT}/hooks/subagent-context.sh\"'",
21+
"timeout": 30
1222
}
1323
]
1424
}

han-plugin.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,8 @@ hooks:
1212
event: SessionStart
1313
description: Inject AI-DLC iteration context (hat, intent, criteria, scratchpad)
1414

15-
# SubagentPrompt hook - provides AI-DLC context for subagent injection
16-
# Context is gathered by core's PreToolUse hook (han hook inject-subagent-context)
17-
# and injected into Task and Skill tool prompts automatically.
18-
#
19-
# Optional: Use tool_filter to limit which tools receive this context:
20-
# tool_filter: [Task] # Only inject for Task tool (subagents)
21-
# tool_filter: [Skill] # Only inject for Skill tool
22-
# tool_filter: [Task, Skill] # Both (default behavior if omitted)
23-
subagent-context:
24-
command: bash "${CLAUDE_PLUGIN_ROOT}/hooks/subagent-context.sh"
25-
event: SubagentPrompt
26-
description: Provide AI-DLC intent, hat, and workflow context for subagent injection
27-
# No tool_filter = applies to both Task and Skill
15+
# Subagent context injection is now handled by .claude-plugin/hooks.json
16+
# using han hook wrap-subagent-context for proper JSON output
2817

2918
iterate:
3019
command: bash "${CLAUDE_PLUGIN_ROOT}/hooks/enforce-iteration.sh"

0 commit comments

Comments
 (0)