Plugin hooks fire twice: marketplace source + cache both loaded
Description
Plugin hooks fire twice for every event (SessionStart, UserPromptSubmit, PostToolUse, Stop) because Claude Code loads hooks from both the marketplace source directory and the installed cache directory.
Steps to Reproduce
- Install a plugin that has hooks:
``bash``
claude plugin marketplace add thedotmack
claude plugin install claude-mem@thedotmack
- Start a new Claude Code session
- Observe that
SessionStartandUserPromptSubmithook messages appear twice in system reminders
Root Cause
After installation, the same hooks.json exists in two locations:
~/.claude/plugins/marketplaces/thedotmack/plugin/hooks/hooks.json ← marketplace source
~/.claude/plugins/cache/thedotmack/claude-mem/9.0.17/hooks/hooks.json ← installed cache
Both files are identical. Claude Code loads hooks from both paths, causing every hook to execute twice.
Expected Behavior
Claude Code should load hooks only from the installed cache (cache/), not from the marketplace source directory (marketplaces/). The marketplace directory should only serve as a source for plugin install, not as an active hook source.
Workaround
Rename the hooks.json in the marketplace source:
mv ~/.claude/plugins/marketplaces/<marketplace>/plugin/hooks/hooks.json \
~/.claude/plugins/marketplaces/<marketplace>/plugin/hooks/hooks.json.bak
Note: This workaround is fragile — running marketplace add again will restore the file.
Environment
- Claude Code (latest as of 2026-02-08)
- macOS (Darwin 25.2.0)
- Affected plugin:
claude-mem@thedotmack(any plugin with hooks would be affected)
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗