[BUG] Marketplace plugins with hooks cause "No such file or directory" errors for non-installed plugins
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?
When a marketplace lists multiple plugins but only some are installed, Claude Code attempts to execute stop hooks for all plugins in the marketplace — including those that are not installed and not enabled. This causes a recurring error after every agent output.
## Actual Behavior
Every stop hook cycle produces this error:
⏺ Ran 4 stop hooks
⎿ Stop hook error: Failed with non-blocking status code:
/bin/sh: /Users//.claude/plugins/cache///2.0.0/hooks/stop-hook.sh:
No such file or directory
The error appears after every agent output in all chat
sessions, making it very noisy.
## Relevant Files
~/.claude/plugins/installed_plugins.json— only lists
spark@mulkatz, NOT anvil@mulkatz
~/.claude/settings.jsonenabledPlugins— only has
"spark@mulkatz": true
- `~/.claude/plugins/marketplaces/mulkatz/.claude-plugin/marketplace.j
son — lists both anvil and spark`
~/.claude/plugins/cache/mulkatz/— only containsspark/, no
anvil/ directory
Analysis
Claude Code appears to resolve all plugins from registered
marketplaces and construct expected cache paths for hooks, regardless
of installation state. It then tries to execute hooks at paths like
cache/<marketplace>/<plugin>/<version>/hooks/stop-hook.sh even when
that directory was never created.
The fix should gate hook execution on the plugin being present in
installed_plugins.json (or at minimum, check that the hook file
exists before attempting to execute it).
What Should Happen?
Hooks should only run for plugins that are both installed (present in installed_plugins.json) and enabled (present in enabledPlugins). Non-installed marketplace plugins should be treated as available-for-discovery only.
Error Messages/Logs
⏺ Ran 4 stop hooks
⎿ Stop hook error: Failed with non-blocking status code:
/bin/sh: /Users//.claude/plugins/cache///2.0.0/hooks/stop-hook.sh:
No such file or directory
Steps to Reproduce
- Register a custom marketplace that lists 2+ plugins (e.g.,
anvil
and spark)
- Install only one of the plugins (e.g.,
spark) - Ensure only the installed plugin is in
enabledPluginsin
settings.json
- Use Claude Code normally
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.47 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗