Skip to content

Plugin hooks fire twice: marketplace source + cache both loaded #24115

@pitimon

Description

@pitimon

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:

    claude plugin marketplace add thedotmack
    claude plugin install claude-mem@thedotmack
  2. Start a new Claude Code session

  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions