Plugin hooks fire twice: marketplace source + cache both loaded

Resolved 💬 7 comments Opened Feb 8, 2026 by pitimon Closed Apr 27, 2026

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

  1. Install a plugin that has hooks:

``bash
claude plugin marketplace add thedotmack
claude plugin install claude-mem@thedotmack
``

  1. Start a new Claude Code session
  1. 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)

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗