Browse the full directory of Claude Code plugins — commands, agents, skills, MCP servers, and more.
Browse plugins →How Claude Code hooks intercept lifecycle events, and which plugins use them for TDD enforcement, memory persistence, and token optimization.
Hooks let Claude Code plugins intercept lifecycle events — moments like pre-commit, session start, or tool invocation — and run custom logic before or after they happen. Across the Claude Plugins Directory, there are currently 6,926 hooks registered, making them the fifth most common component type behind skills (176,226), commands (59,776), agents (48,602), and MCP servers (7,288).
That count understates their impact. Hooks operate at the system level rather than the user-interaction level. While a skill teaches Claude a new capability or a command gives users a new slash command, a hook changes how Claude Code behaves during its own lifecycle. A single well-placed hook can enforce TDD before every commit, compress memory after every session, or intercept tool calls for auditing.
You can browse all available hooks on the hooks page.
Claude Code hooks are shell commands that execute at specific points in Claude Code's lifecycle. They're defined in your settings files (.claude/settings.json or ~/.claude/settings.json) under the hooks key, and they fire on events like:
Each hook receives context about the event as JSON on stdin and can return structured responses on stdout. For example, a PreToolUse hook on the Write tool can inspect the file path and content before it's written, and either approve, modify, or reject the operation.
What makes hooks distinct from other component types is their implicit activation. Skills need to be invoked and commands need to be typed, but hooks run automatically whenever their trigger event occurs. This makes them powerful for enforcing invariants and workflow policies across every Claude Code session.
Among the 32,970 active plugins in the directory, several high-adoption plugins use hooks as a core part of their architecture. Here's how they put hooks to work.
Superpowers (183,238 stars, 1,815 installs in the last 7 days) ships skills and hooks that enforce strict TDD cycles, generate multi-step implementation plans, manage isolated git worktrees, and verify tests, builds, and lints before commits or PRs. The hooks are what make this enforcement automatic — rather than relying on developers to remember to run checks, superpowers hooks into pre-commit events to ensure builds pass before code lands.
Caveman (51,378 stars, 917 installs in the last 7 days) takes a different approach. Its hooks switch Claude Code sessions into "caveman mode" for up to 75% token reduction via terse, accurate responses across lite, full, and ultra levels. The plugin combines agents, skills, and hooks to auto-generate conventional commits, compress docs and todos, and produce real token usage stats. By hooking into the response lifecycle, caveman intercepts and reformats output before it reaches the user.
Everything Claude Code (176,491 stars, 420 installs in the last 7 days) is one of the most component-rich plugins in the directory, shipping commands, agents, skills, hooks, and MCP servers. Its hooks help orchestrate autonomous multi-agent coding workflows, enforce TDD, and automate deployments and testing across JS/TS/Python/Rust/mobile stacks.
Claude-Mem (74,218 stars) uses hooks alongside skills and MCP servers to persist compressed memory of Claude Code sessions, codebase reads, Git actions, and PR progress across interactions. The hooks fire at session boundaries to capture and compress context, making it available for priming new sessions, generating phased plans, and running architecture audits.
Mem0 (55,259 stars) takes a similar approach to persistent memory but with a different architecture. Its hooks integrate with the Mem0 platform to retrieve relevant past decisions, strategies, and session states when starting new tasks. The combination of skills, hooks, and MCP tools enables semantic search across long-term memories using Python and TypeScript SDKs.
Agent-Skills (37,379 stars) equips AI coding agents with production engineering skills spanning the full development lifecycle. Its hooks complement commands, agents, and skills to automate CI/CD pipelines, execute ship checklists, and perform multi-axis code reviews covering performance and security. The plugin refines ideas to specs, implements via TDD slices, and uses hooks to verify each stage.
GitNexus (37,352 stars) indexes Git repositories into knowledge graphs for code intelligence workflows. Its hooks work alongside skills and MCP servers to trace execution flows for debugging, analyze the blast radius of code changes or PRs, explore architectures and symbols, and safely refactor with impact previews.
Retros is an early-stage plugin (0 stars) with a minimal footprint — just commands and hooks. It's worth noting as an example of how hooks can serve as the backbone of a focused, lightweight plugin without requiring skills, agents, or MCP servers.
Looking across these plugins, several hook patterns emerge that are worth adopting in your own work.
Pre-commit verification. Superpowers and everything-claude-code both use hooks to verify builds and tests before commits land. This is arguably the highest-value hook pattern: it prevents broken code from being committed without requiring the developer to remember to run checks manually. If you're building a plugin for a team, this pattern alone justifies adopting hooks.
Session memory persistence. Both claude-mem and mem0 hook into session boundaries to capture and persist context. If your plugin needs to maintain state across Claude Code sessions, hooks on the Stop event give you a reliable trigger point for serialization. The two plugins show contrasting approaches — claude-mem compresses into local knowledge graphs, while mem0 syncs to an external platform — so the pattern adapts to different infrastructure preferences.
Token optimization. Caveman demonstrates that hooks can intercept and transform Claude's output to reduce token consumption. This is particularly relevant for teams managing API costs — a well-placed hook can compress responses without sacrificing accuracy. The 75% token reduction that caveman claims comes from intercepting at the response level, not from changing the underlying model behavior.
Lifecycle orchestration. Plugins like everything-claude-code and agent-skills use hooks to coordinate multi-step workflows. By hooking into SubagentStop events, they can chain operations — running tests after code generation, triggering deployments after successful builds, or executing review checklists after PR creation.
Lightweight enforcement. Retros shows that a plugin doesn't need dozens of components to be useful. A focused pair of commands and hooks can enforce a single workflow policy effectively. If you have one lifecycle event you want to intercept, hooks are the right component type.
The hooks page on the Claude Plugins Directory lists all 6,926 available hooks across 32,970 plugins. If you're evaluating which hook-based plugins to install, consider what lifecycle events matter most to your workflow:
The full plugin directory indexes 32,970 plugins across 299,629 components from 14,103 authors. Hooks represent a small but critical slice of that ecosystem — the component type that turns passive plugins into active workflow enforcement.
Enforce strict TDD cycles, generate detailed multi-step implementation plans, execute them in batches or via parallel subagents, manage isolated git worktrees for features, perform root-cause debugging and technical code reviews, verify tests/builds/lints before commits or PRs, all within Claude Code sessions.
Switch Claude Code sessions to caveman mode for 75% token reduction via terse, accurate responses across lite/full/ultra levels. Delegate to subagents for code location, surgical 1-2 file edits, and focused diff/PR reviews. Auto-generate conventional commits, terse review comments, and real token stats; compress docs and todos.
Supercharge Claude Code with 300+ agents, skills, commands, and hooks to orchestrate autonomous multi-agent coding workflows, enforce TDD, conduct security audits, generate production code across JS/TS/Python/Rust/mobile stacks, optimize performance, and automate deployments/testing.
Persist compressed memory of Claude Code sessions, codebase reads, Git actions, and PR progress across interactions. Query historical knowledge for priming new sessions, generating phased plans, structural searches, architecture audits, timeline reports, and automating merges or semantic releases.
Add persistent memory to Claude Code tasks and AI apps via Mem0: retrieve relevant past decisions, strategies, and session states on new tasks; store user data for personalization; enable semantic search across long-term memories using Python/TS SDKs, hooks, and MCP tools.
Equip AI coding agents with production engineering skills to handle full dev lifecycles: refine ideas to specs, implement via TDD slices, run tests/debug, perform multi-axis code reviews, optimize perf/security, automate CI/CD, and execute ship checklists.
Index Git repositories into knowledge graphs to enable code intelligence workflows: trace execution flows for debugging bugs and errors, analyze blast radius and risks of code changes or PRs, explore architectures and symbols, safely refactor with impact previews, and generate LLM wikis.
Auto-captures a retrospective at the end of every substantive Claude Code session via a Stop hook that spawns a fork-resumed `claude -p` subprocess. The fork inherits the parent's full transcript so retros have real subjective signal. Provides /retro for scrum-style review of accumulated retros, surfacing patterns and proposing structural follow-ups (CLAUDE.md edits, memory entries, skill changes, tooling unblocks). Retros are stored at ~/.claude/retros/.