[BUG] Orphaned plugin hooks persist after plugin removal - cannot delete via /hooks UI
[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
- Have previously installed a plugin that registered PostToolUse hooks (possibly
hookifyor similar) - Uninstall the plugin or remove the marketplace
- Verify no plugins are installed:
claude plugin listshows "No plugins installed" - Verify no marketplaces configured:
claude plugin marketplace listshows "No marketplaces configured" - Run
/hookscommand - stale[Plugin]hooks still appear - 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
/hooksUI /hooksshould not show[Plugin]entries when no plugins are installed
Actual Behavior
/hooksshows 3[Plugin]matchers under PostToolUse:
```
PostToolUse - Tool Matchers
...
❯ 1. + Add new matcher…
- [Plugin] Glob 1 hook
- [Plugin] Grep 1 hook
- [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
/hooksUI - 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)
- Cleared
~/.claude/statsig/ - Cleared
~/.cache/claude/ - Cleared
~/.cache/claude-cli-nodejs/ - Verified no plugin files exist:
- No
~/.claude/plugins/marketplaces/directory - No
hooks.jsonfiles - No
.claude-plugindirectories
- Verified
~/.claude/settings.jsonhas nohookskey - Verified
~/.claude/settings.local.jsonhas 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:
- Is not in
~/.claude/settings.jsonor~/.claude/settings.local.json - Is not in
~/.claude/plugins/ - Survives cache clearing
- Is not accessible via the
/hooksdelete functionality
Suggested Fix
- Plugin uninstallation should explicitly remove all registered hooks
/hooksUI should allow deletion of orphaned[Plugin]hooks- Consider adding a
claude hooks resetorclaude plugin cleanupcommand for cases like this
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗