Claude Code hook
claude-code-hooks
Collection of safety, cost, observability and productivity hooks, also installable as a plugin marketplace.
Install
/plugin marketplace add karanb192/claude-code-hooksgit clone https://github.com/karanb192/claude-code-hooks.gitFrom the README
claude-code-hooks
🪝 Ready-to-use hooks for Claude Code, shipped as a 22-plugin installable marketplace: safety, automation, notifications, and more.
🌐 Live site & catalog
Claude Code and agents like it run shell commands, edit files, and install packages on their own. claude-code-hooks enforces least privilege on that autonomy at runtime: every tool call passes through a PreToolUse or PostToolUse hook that allows, denies, or modifies it, with the reason fed back to the agent. Hooks run outside the model as separate processes, so prompt injection can't talk its way past them. The safety set blocks .env and secret exfiltration, curl | sh, rm -rf, force pushes to main, and tampering with the hook config itself; the rest of the catalog handles automation and notifications. Every hook is mapped against the OWASP LLM Top 10 2026.
🎬 Quick Demo
Protecting Secrets
Blocking Dangerous Commands
A growing collection of tested, documented hooks. Every one installs as a one-command Claude Code plugin: run /plugin marketplace add karanb192/claude-code-hooks, then /plugin install @claude-code-hooks; see Install as a plugin for the 22-plugin catalog. Prefer to own the file? Every plugin's script also works standalone: copy plugins//.js and wire it into settings.json yourself (Quick Start).
📑 Table of Contents
- Hooks
- Install as a plugin
- Quick Start
- Safety Levels
- Testing
- Token Diet
- Configuration Reference
- Contributing
- License
🪝 Hooks
Every hook below is an installable plugin; each link goes to the plugin's directory, which holds the script, its tests, and a README. They're grouped by the event that fires them, because the event model is the thing worth learning.
Session Lifecycle
Runs at session boundaries: inject context at SessionStart and…How hooks work
- Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
- They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
- A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Details
- Repository
- karanb192/claude-code-hooks
- Type
- Hooks
- Website
- hooks.karanbansal.in
- Language
- JavaScript
- License
- MIT
- Last updated
- 2 November 2026
- Topics
- ai-toolsanthropicautomationclaudeclaude-codeclaude-code-hooksclaude-code-pluginclideveloper-toolshooksmarketplacenotifications
FAQ
What is claude-code-hooks?
Collection of safety, cost, observability and productivity hooks, also installable as a plugin marketplace. It is a hook for Claude Code, from karanb192/claude-code-hooks on GitHub.
How do I install claude-code-hooks?
Run /plugin marketplace add karanb192/claude-code-hooks inside Claude Code, then follow the setup in the README.
Is claude-code-hooks popular?
karanb192/claude-code-hooks has 572 GitHub stars and 49 forks, and is included in 2 curated Claude Code lists. It was last updated on 2 November 2026.
More hooks
Everything Claude Code Zh
2kxu-xiang/everything-claude-code-zh
everything-claude-code 中文翻译项目:完整的 Claude Code 配置集合(agents, skills, hooks, commands, rules, MCPs)。源自 Anthropic 黑客松获胜者的实战配置,助力中文工程师高效理解与使用 Claude Code。
Kubb
1.8kkubb-labs/kubb
Turn your API spec into type-safe code. Generate TypeScript types, API clients, hooks, validators and mocks from a spec such as OpenAPI.
CC Safety Net
1.9kkenryu42/cc-safety-net
Pre-execution guard hook that blocks dangerous git and filesystem commands issued by coding agents.
Medusa
1kPantheon-Security/medusa
AI-first security scanner. NEW in v2026.7: Claude Code compromise detection — vet .claude/ hooks, permissions & skills before you clone — plus an always-on AI attack-signature scanner and native Rust & PHP rules. Also: medusa scan --git to vet any repo, medusa secrets scan for leaked API keys. 40,000+ patterns, zero setup.
Claude Code Prompt Improver
2kseverity1/claude-code-prompt-improver
Intelligent prompt improver hook for Claude Code. Type vibes, ship precision.
Claude Code Voice Hooks
563shanraisshan/claude-code-hooks
Adds spoken voice feedback to each Claude Code hook event.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.