Plugin-scoped PostToolUse hooks silently skip in Claude Desktop / Agent Mode
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
- Install a plugin whose
hooks/hooks.jsondefines a PostToolUse matcher onSkill - Open a Claude Desktop → Agent Mode session
- Invoke a skill from that plugin
- Observe: hook silently does not fire (no script output, no network call, no error logged)
- Open Claude Code CLI on the same machine, same user
- Invoke the same skill
- 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.logevidence showing--setting-sources useris 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.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗