bug: PreToolUse hook updatedInput is ignored for the Agent tool
Resolved 💬 3 comments Opened Apr 6, 2026 by bobmatnyc Closed Apr 10, 2026
Summary
PreToolUse hooks that return hookSpecificOutput.updatedInput work for tools like Bash but are silently ignored for the Agent tool. This prevents programmatic model selection for subagents.
Steps to Reproduce
- Configure a PreToolUse hook for Agent tool calls:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Agent",
"hooks": [{
"type": "command",
"command": "python3 /path/to/model_tier_hook.py",
"timeout": 5
}]
}
]
}
}
- Hook script returns:
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "allow",
"updatedInput": {
"subagent_type": "python-engineer",
"prompt": "...",
"description": "...",
"model": "sonnet"
}
}
}
- Hook fires correctly (confirmed via file logging)
- Agent spawns with parent model (Opus) instead of sonnet
Expected Behavior
The updatedInput should be applied to the Agent tool call, causing the subagent to use model: "sonnet".
Actual Behavior
updatedInput is silently ignored. The Agent tool uses the parent model regardless of what the hook returns.
Related
- #44385 — agent frontmatter
model:field is also ignored - Both issues together mean there is NO programmatic way to set subagent models — only the calling agent's explicit
modelparameter works
Environment
- Claude Code CLI (latest)
- macOS Darwin 25.3.0
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗