Feature: SubagentStart hooks - support updatedPrompt for reliable rule injection
Resolved 💬 2 comments Opened Feb 7, 2026 by shuhei0866 Closed Feb 7, 2026
Summary
SubagentStart hooks should support updatedPrompt (prompt body modification) in addition to additionalContext.
Background
Analysis of 223 sessions and 287 Task tool invocations revealed that subagents frequently ignore CLAUDE.md rules (mandatory TDD, worktree-only editing, etc.).
We currently inject rules via additionalContext in SubagentStart hooks, but this has significant limitations:
- Lost during context compression:
additionalContextis not treated as part of the system prompt, so it becomes a compression target as conversations grow longer - Cannot integrate with the prompt body: Rules cannot be directly embedded into the prompt, causing subagents to "overlook" them
Current Workaround
{
"hookSpecificOutput": {
"additionalContext": "[Required Rules] Work within worktrees only..."
}
}
Proposal
{
"hookSpecificOutput": {
"updatedPrompt": "original prompt + injected rules"
}
}
Alternatively, guarantee that additionalContext is preserved during context compression (treated as system-level context).
Use Cases
- Injecting mandatory TDD rules (write tests before implementation)
- Injecting worktree-only editing rules (block edits in main worktree)
- Injecting review execution obligations on
release/*branches
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗