Bug Report
Version: v1.0.75
Summary
In hooks/hooks.json, the PreToolUse hook has a matcher "Task". Claude Code hook matchers use substring matching, so this catches all Task* tools — including TaskCreate, TaskUpdate, TaskList, TaskGet, TaskStop, TaskOutput (the todo/task management tools) — not just the intended Task subagent tool.
Reproduction
- Use Claude Code with context-mode enabled
- Claude attempts to call
TaskCreate or TaskUpdate to manage a todo list
- The
pretooluse.mjs routing logic fires and detects the task field in the input (via ["prompt", "request", ..., "task"] field detection)
- The context-mode routing block is appended to the task title/description, corrupting the entry
- The hook fails or the task tool receives malformed input → todo list gets stuck, "hook failed" message shown in terminal
Root Cause
routing.mjs line 286:
if (canonical === "Agent" || canonical === "Task") {
This was presumably intended to intercept a Task subagent tool, but in modern Claude Code the subagent spawning tool is called Agent. There is no standalone Task tool — only the Task* family of todo management tools (TaskCreate, TaskUpdate, etc.).
The "Task" substring matcher in hooks.json fires for all of these, and the routing logic then corrupts their inputs.
Fix
Remove the "Task" matcher from PreToolUse in hooks.json. The Agent matcher already covers subagent prompt injection.
- {
- "matcher": "Task",
- "hooks": [{ "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pretooluse.mjs" }]
- },
Also consider removing the canonical === "Task" branch in routing.mjs line 286 since it is now unreachable.
Workaround
Manually remove the "Task" matcher block from both:
hooks/hooks.json
.claude-plugin/hooks/hooks.json
in the plugin cache directory.
Bug Report
Version: v1.0.75
Summary
In
hooks/hooks.json, thePreToolUsehook has a matcher"Task". Claude Code hook matchers use substring matching, so this catches allTask*tools — includingTaskCreate,TaskUpdate,TaskList,TaskGet,TaskStop,TaskOutput(the todo/task management tools) — not just the intendedTasksubagent tool.Reproduction
TaskCreateorTaskUpdateto manage a todo listpretooluse.mjsrouting logic fires and detects thetaskfield in the input (via["prompt", "request", ..., "task"]field detection)Root Cause
routing.mjsline 286:This was presumably intended to intercept a
Tasksubagent tool, but in modern Claude Code the subagent spawning tool is calledAgent. There is no standaloneTasktool — only theTask*family of todo management tools (TaskCreate,TaskUpdate, etc.).The
"Task"substring matcher inhooks.jsonfires for all of these, and the routing logic then corrupts their inputs.Fix
Remove the
"Task"matcher fromPreToolUseinhooks.json. TheAgentmatcher already covers subagent prompt injection.Also consider removing the
canonical === "Task"branch inrouting.mjsline 286 since it is now unreachable.Workaround
Manually remove the
"Task"matcher block from both:hooks/hooks.json.claude-plugin/hooks/hooks.jsonin the plugin cache directory.