Plugin-scoped PostToolUse hooks silently skip in Claude Desktop / Agent Mode

Resolved 💬 3 comments Opened Apr 22, 2026 by figgsoftware Closed May 27, 2026

Preflight Checklist

  • [x] Searched existing issues
  • [x] Single bug report
  • [x] Using latest version

Summary

PostToolUse hooks defined in a plugin's hooks/hooks.json fire correctly in Claude Code CLI but silently do not fire in Claude Desktop / Agent Mode sessions, even though:

  • The plugin is installed and up-to-date on both surfaces
  • Skills from the same plugin execute correctly in Desktop
  • MCP servers from the same plugin work in Desktop
  • The hook command executes fine when run manually

Likely the same root cause documented in #27398 (closed as duplicate of #16288): the Cowork VM spawns the CLI with --setting-sources user, which excludes plugin-scope hook discovery.

Environment

  • OS: Windows 11
  • Claude Desktop: 1.1.4088
  • Claude Code CLI: 2.1.92
  • Plugin installed via admin console (enterprise distribution, "Installed by default")

Plugin structure

my-plugin/
├── .claude-plugin/plugin.json
├── hooks/
│   ├── hooks.json
│   └── log_event.py
└── skills/...

hooks/hooks.json:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Skill",
        "hooks": [
          {
            "type": "command",
            "command": "python \"${CLAUDE_PLUGIN_ROOT}/hooks/log_event.py\"",
            "timeout": 15,
            "async": true
          }
        ]
      }
    ]
  }
}

Steps to reproduce

  1. Install a plugin whose hooks/hooks.json defines a PostToolUse matcher on Skill
  2. Open a Claude Desktop → Agent Mode session
  3. Invoke a skill from that plugin
  4. Observe: hook silently does not fire (no script output, no network call, no error logged)
  5. Open Claude Code CLI on the same machine, same user
  6. Invoke the same skill
  7. Observe: hook fires correctly on every invocation

Expected

Plugin-defined hooks/hooks.json hooks should fire on both surfaces, identically to how they behave in CLI.

Actual

  • ✅ CLI: hook fires consistently
  • ❌ Desktop / Agent Mode: hook silently skipped

Evidence

Over a 14-day observation window using an external logging endpoint, the same user on the same Windows laptop produced captured events only from CLI sessions. Multiple Agent Mode invocations during the same window produced zero events. Skills and MCP servers work correctly in both surfaces; only the hook is invisible to Desktop.

Impact

This blocks any plugin-based telemetry, workflow automation, session logging, or side-effect tracking. For organizations distributing plugins via admin console Installed by default, the usable audience for any hook-based feature collapses to CLI power users only - typically a small minority of a broader team deployment.

Related

  • #16288 (canonical, open)
  • #27398 (closed as duplicate; includes cowork_vm_node.log evidence showing --setting-sources user is the spawn flag)
  • #18547 (related, VSCode extension, different root cause)

Workaround

Placing hooks in ~/.claude/settings.json is not viable for plugin-based distribution - it defeats the admin console's automatic rollout and requires per-user manual setup.

Ask

Please prioritize fixing plugin-scope hook discovery in Desktop / Agent Mode. Without this, plugin extensibility in the Desktop app is limited to skills and MCP servers; hooks are effectively unavailable.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗