[BUG] Orphaned plugin hooks persist after plugin removal - cannot delete via /hooks UI

Resolved 💬 4 comments Opened Jan 30, 2026 by jimmc414 Closed Feb 28, 2026

[BUG] Orphaned plugin hooks persist after plugin removal - cannot delete via /hooks UI

Description

Stale [Plugin] hooks persist in the /hooks menu and continue to fire on every tool call, even though no plugins are installed. The hooks cannot be deleted through the /hooks UI and survive cache clearing.

Steps to Reproduce

  1. Have previously installed a plugin that registered PostToolUse hooks (possibly hookify or similar)
  2. Uninstall the plugin or remove the marketplace
  3. Verify no plugins are installed: claude plugin list shows "No plugins installed"
  4. Verify no marketplaces configured: claude plugin marketplace list shows "No marketplaces configured"
  5. Run /hooks command - stale [Plugin] hooks still appear
  6. Use any tool that matches the hook (Glob, Grep, Read) - hook fires successfully

Expected Behavior

  • Plugin hooks should be removed when the plugin is uninstalled
  • If hooks somehow persist, they should be deletable via /hooks UI
  • /hooks should not show [Plugin] entries when no plugins are installed

Actual Behavior

  • /hooks shows 3 [Plugin] matchers under PostToolUse:

```
PostToolUse - Tool Matchers
...
❯ 1. + Add new matcher…

  1. [Plugin] Glob 1 hook
  2. [Plugin] Grep 1 hook
  3. [Plugin] Read 1 hook

```

  • Hooks fire on every matching tool call:

``
● Read(~/.claude/settings.json)
⎿ Read 58 lines
⎿ PostToolUse:Callback hook succeeded: Success
``

  • Cannot delete via /hooks UI - no delete option available for [Plugin] hooks
  • Hooks appear in ALL projects (global, not project-specific)

Debug Log Evidence

Debug logs show the hooks are found but their source is unclear:

[DEBUG] Found 0 plugins (0 enabled, 0 disabled)
[DEBUG] Registered 0 hooks from 0 plugins
[DEBUG] installed_plugins.json doesn't exist, returning empty V2 object
...
[DEBUG] Getting matching hook commands for PostToolUse with query: Read
[DEBUG] Found 3 hook matchers in settings
[DEBUG] Matched 1 unique hooks for query "Read" (1 before deduplication)

Note: "Found 0 plugins" and "Registered 0 hooks from 0 plugins" but "Found 3 hook matchers in settings"

Attempted Fixes (None Worked)

  1. Cleared ~/.claude/statsig/
  2. Cleared ~/.cache/claude/
  3. Cleared ~/.cache/claude-cli-nodejs/
  4. Verified no plugin files exist:
  • No ~/.claude/plugins/marketplaces/ directory
  • No hooks.json files
  • No .claude-plugin directories
  1. Verified ~/.claude/settings.json has no hooks key
  2. Verified ~/.claude/settings.local.json has no hooks

Environment

  • Claude Code version: 2.1.25
  • Platform: WSL2 Ubuntu on Windows (Linux 5.15.167.4-microsoft-standard-WSL2)
  • Installation method: curl installer script
  • Shell: bash

CLI Verification

$ claude plugin list
No plugins installed. Use `claude plugin install` to install a plugin.

$ claude plugin marketplace list
No marketplaces configured

Related Issues

  • #17789 - Plugin cache updates leave stale paths in settings.json (similar root cause - plugin state not cleaned up)

Possible Root Cause

The hooks appear to have been registered by a previously-installed plugin (possibly hookify based on history) and stored in some internal state that:

  1. Is not in ~/.claude/settings.json or ~/.claude/settings.local.json
  2. Is not in ~/.claude/plugins/
  3. Survives cache clearing
  4. Is not accessible via the /hooks delete functionality

Suggested Fix

  1. Plugin uninstallation should explicitly remove all registered hooks
  2. /hooks UI should allow deletion of orphaned [Plugin] hooks
  3. Consider adding a claude hooks reset or claude plugin cleanup command for cases like this

View original on GitHub ↗

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