Skip to content

PostToolUse hook matcher "" fires on ALL tools (TaskUpdate, TaskCreate, etc.) causing false "hook error" display #229

@rexplx

Description

@rexplx

Bug

The context-mode plugin registers a PostToolUse hook in hooks/hooks.json with matcher: "" (empty string), which fires on every PostToolUse event — including TaskUpdate, TaskCreate, TaskGet, TaskList, and other internal tools that posttooluse.mjs was not designed to handle.

Symptom

Users see PostToolUse:TaskUpdate hook error on every TaskUpdate call, even when the hook exits 0.

This is consistent with known Claude Code bugs:

Suggested Fix

Narrow the PostToolUse matcher to exclude internal task management tools:

"PostToolUse": [
  {
    "matcher": "Bash|Read|Write|Edit|Grep|Agent|Task|mcp__plugin_context-mode",
    "hooks": [
      {
        "type": "command",
        "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/posttooluse.mjs"
      }
    ]
  }
]

Environment

  • context-mode: v1.0.75 (plugin install via Claude Code)
  • Claude Code: latest
  • macOS Darwin 25.5.0, arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions