Skip to content

Claude Code 2.1.329+: plannotator tool annotate/review never opens — tool.run no longer reaches the tool.* glob hook #3915

Done

Description

@thangnguyen-69

Summary

On Claude Code 2.1.329 and 2.1.330 (Team/Enterprise login, where cc-plugin-sec-default is seated), the plannotator tool's annotate / review / last actions fail every time:

plannotator registered the tool plannotator but no hook answered this call: add on("tool.run", { tool: "mcp__plannotator__plannotator" }, ($, e) => ({ result: ... })) to the plugin.

list and close still work, because they are answered at tool.call. Last good version: 2.1.328. Plugin version: 0.29.0. 0.29.2 doesn't seem to change this path.

This is a follow-up to #3578. The fix for that issue passes a held call on and opens it at tool.run, using the on('tool.*', RUN_MATCHER, …) hook in hooks/mod/register.ts.

Cause

Starting with 2.1.329, the engine no longer sends tool.run to a hook registered with the tool.* glob. The same hook still receives the tool's other events. Debug log (PLANNOTATOR_MOD_DEBUG=1), with a one-line trace added at the top of the tool.* hook:

mcp__plannotator__plannotator call: Claude Code's guard holds it until it is allowed; passed on, opened at tool.run
[tool.* probe] event=tool.call  tool=mcp__plannotator__plannotator
[tool.* probe] event=tool.check tool=mcp__plannotator__plannotator
(no tool.run event; the call falls through to the plugin-tools server's "no hook answered" fallback)

The matcher isn't the cause. Adding the literal 'mcp__plannotator__plannotator' to RUN_MATCHER.tool changes nothing: tool.call and tool.check already arrive.

Workaround (verified on 2.1.330)

Registering tool.run explicitly delivers the event, and the review opens:

  // hooks/mod/register.ts, after the existing on('tool.*', RUN_MATCHER, …) hook
  on('tool.run', RUN_MATCHER, async ($: Engine, e: any, next: Next) => {
    if (allowed && toolName && e.tool === toolName) return answerAtRun(await answerModTool($, e))
    return next(e)
  })

Trace with that hook in place: [tool.run probe] tool=mcp__plannotator__plannotator, then the annotate page opened.

On an engine before 2.1.326, a module that names tool.run fails to load, as the comment on the existing hook notes. So the upstream fix probably needs to register it only where the engine supports the event. The same change likely applies to the Bash take-over branch, which also opens at tool.run.

Environment

  • Claude Code 2.1.330 (also seen on 2.1.329; 2.1.328 works), Linux (WSL2)
  • plannotator plugin 0.29.0, interactive CLI session, auto mode / tool allowed via --allowedTools

Activity

  1. mgiammarco commented on Nov 28, 2026

    @mgiammarco

    Still reproducible with plugin 0.29.7 (updated today with plannotator update) on Claude Code 2.1.330, Team login, Linux (Ubuntu 24.04, not WSL).

    Steps: fresh interactive session (no -p), PLANNOTATOR_AGENT_TOOL=1, ask the model to call the plannotator tool with action: "annotate" on a markdown file. Result, word for word:

    plannotator registered the tool plannotator but no hook answered this call: add on("tool.run", { tool: "mcp__plannotator__plannotator" }, ($, e) => ({ result: ... })) to the plugin.
    

    followed by the notice plannotator: its classic.PermissionRequest hook was skipped. "cc-plugin-sec-default" runs first and sent the event on past it. The permission prompt for the tool is shown and answered "Yes" before the error.

    As the issue suggests, the Bash take-over branch is affected too: plannotator annotate <file> run through Bash is not taken over and just runs as a normal (blocking) command. That path works fine with --cloudflare-access --gate, so we use the CLI for now and keep agentTool off.

  2. backnotprop commented on Nov 29, 2026

    @backnotprop
    Owner

    Thanks for the trace. We understand it: from Claude Code 2.1.329, tool.run only reaches a hook registered by that exact name, and the mod registers tool.*.

    Proposed fix: register on('tool.run', …) by name. Confirmed on 2.1.327 and 2.1.330 in our engine harness.

    The catch, for everybody: Claude Code older than 2.1.326 does not know that event and refuses the whole mod when it sees it. We found no way for one mod to serve both (a second module, other globs and a version range were each ruled out). So after this fix the mod needs Claude Code 2.1.326 or later; on older versions the slash commands and the CLI are what remain.

    We are deciding whether to ship it that way. If that floor would hurt you, say so here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions