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:
claude plugin marketplace add thedotmack
claude plugin install claude-mem@thedotmack
-
Start a new Claude Code session
-
Observe that SessionStart and UserPromptSubmit hook 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)
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:
Start a new Claude Code session
Observe that
SessionStartandUserPromptSubmithook messages appear twice in system remindersRoot Cause
After installation, the same
hooks.jsonexists in two locations: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 forplugin install, not as an active hook source.Workaround
Rename the hooks.json in the marketplace source:
Note: This workaround is fragile — running
marketplace addagain will restore the file.Environment
claude-mem@thedotmack(any plugin with hooks would be affected)