[BUG] [Cowork / Plugins] hooks.json silencieusement ignoré en mode Cowork
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Bonjour,
J'ai identifié et documenté en détail un comportement non documenté de Claude Desktop en mode Cowork : les hooks définis dans hooks/hooks.json d'un plugin sont chargés mais jamais invoqués au runtime, alors qu'ils fonctionnent correctement sous Claude Code CLI.
Le rapport complet (matrice de tests, environnement MSIX Windows, logs, reproduction minimale) est en pièce jointe : cowork-hooks-repro.md.
Demandes :
- Clarifier officiellement si les hooks plugin sont censés fonctionner en Cowork.
- Si non, le documenter dans la doc SDK plugin (qui laisse entendre la parité avec Claude Code).
- Si oui, corriger le silent failure — au minimum logger un warning quand un
hooks.jsonest chargé mais non exécutable par le runtime. - À terme, exposer une surface observabilité équivalente (post-tool callback, session-start callback) pour permettre aux plugins de type budget-tracker d'être déterministes sans workaround.
Workaround en place de mon côté : logging orchestrateur via budget.py log-total appelé après chaque Agent(), en parsant la balise <usage>total_tokens</usage> retournée par Cowork. Fonctionnel mais fragile (dépend de la discipline de l'orchestrateur à chaque tour).
Merci pour votre temps.
Sébastien (geekfamilycorp@gmail.com)
What Should Happen?
Plugin hooks declared in hooks/hooks.json (PreToolUse, PostToolUse, SessionStart) should execute at runtime in Cowork mode with the same behavior as under Claude Code CLI — each matching tool call should invoke the configured command with the tool payload on stdin.
At minimum, if Cowork parity is not planned, Claude Desktop should emit a visible warning when loading a plugin's hooks.json to signal the runtime will not invoke them. Today it is a silent failure — the plugin loads, skills and MCPs work, but hooks never fire and no log entry mentions them.
Error Messages/Logs
Steps to Reproduce
- Install Claude Desktop on Windows 11 (MSIX package
Claude_pzs8sxrjxfjjc) and enable Cowork mode.
- Create a minimal local plugin with this structure:
my-plugin/
├── .claude-plugin/
│ └── plugin.json (metadata only — name, version, description)
├── hooks/
│ └── hooks.json
└── scripts/
└── trace.cmd
hooks/hooks.jsoncontent (UTF-8 without BOM):
{
"hooks": {
"PostToolUse": [
{
"matcher": ".*",
"hooks": [
{"type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/scripts/trace.cmd"}
]
}
]
}
}
scripts/trace.cmdcontent (just appends a timestamp to prove it ran):
@echo off
echo [%date% %time%] hook fired >> "%~dp0..\hook-trace.log"
- Install the plugin in Cowork and restart Claude Desktop.
- Run any prompt that triggers a tool call (e.g. "list the files in my documents folder").
- Observe:
trace.cmdnever executeshook-trace.logis never created%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\logs\main.logcontains no hook-related entries (no registration, evaluation, invocation attempt or failure)
- For contrast: same plugin archive installed under Claude Code CLI → hooks fire normally and
trace.cmdruns on every tool call.
Verified across 8 combinations (PreToolUse / PostToolUse / SessionStart × matchers "Bash", "Task", "Agent|Task", ".*", plus .sh and .cmd wrappers). None fire. Full test matrix in attached cowork-hooks-repro.md.
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
claude cowork
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
N/A — bug is in Claude Desktop Cowork mode (MSIX package Claude_pzs8sxrjxfjjc), not Claude Code CLI. Filing here because plugins and hooks are shared infrastructure and I could not find a Cowork-specific issue tracker. Please reroute if needed.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗