DEV Community

Cover image for claude-code-hooks Is Now a Plugin (One Command Install)
Yurukusa
Yurukusa

Posted on • Edited on

claude-code-hooks Is Now a Plugin (One Command Install)

I've been running Claude Code autonomously for 140+ hours. The safety hooks that kept things from going sideways are now a proper Claude Code plugin.

Before:

mkdir -p ~/.claude/hooks
cp hooks/*.sh ~/.claude/hooks/
chmod +x ~/.claude/hooks/*.sh
# Now open settings.json and manually wire up 11 hooks...
# Replace /path/to/hooks/ with your actual path in 15 places...
Enter fullscreen mode Exit fullscreen mode

After:

/plugin install claude-code-hooks@yurukusa/claude-code-hooks
Enter fullscreen mode Exit fullscreen mode

That's it. All 11 hooks auto-configure. No path editing.

What Changed

Claude Code recently added a plugin system. Plugins package hooks, skills, and agents into a single installable unit. The ${CLAUDE_PLUGIN_ROOT} variable resolves paths automatically — the exact problem that tripped up most people trying to set up hooks manually.

I converted the existing claude-code-hooks repo. Same hooks, same templates, but now with:

  • Auto-configured paths — no manual settings.json editing
  • Two built-in skills:
    • /claude-code-hooks:setup — choose your hook profile (minimal / standard / autonomous)
    • /claude-code-hooks:diagnose — check which hooks are active and healthy

The 10 Hooks

Quick refresher on what you get:

Hook What it prevents
context-monitor Lost work when context hits 3% with no warning
syntax-check Syntax errors that compound for 10+ steps before detection
branch-guard Accidental force-push to main
error-gate Publishing broken code while errors are unresolved
activity-logger "What did Claude do in the last 2 hours?" having no answer
decision-warn Silent edits to sensitive paths
cdp-safety-check Raw WebSocket construction bypassing safety tools
proof-log-session Session ending with no record of what happened
no-ask-human Agent asking questions during unattended operation
session-start-marker Session duration calculation having no start time

Every hook exists because something went wrong without it.

How to Install

/plugin install claude-code-hooks@yurukusa/claude-code-hooks
Enter fullscreen mode Exit fullscreen mode

Then run /claude-code-hooks:setup to choose which hooks to enable.

Install directly from GitHub as shown above. The repo has everything the plugin system needs.

Still Free, Still MIT

The plugin is the same open-source hooks from the repo. If you want everything pre-configured with additional tools (watchdog, CLAUDE.md generator, risk-score) and a one-command install script, there's the Ops Kit ($19).


Running Claude Code autonomously? What safety measures do you have in place?

Top comments (0)