Claude Code hook
claude-hooks
TypeScript framework for writing typed Claude Code hooks with a generated starter setup.
Install
npx claude-hooksgit clone https://github.com/johnlindquist/claude-hooks.gitFrom the README
claude-hooks TypeScript-powered hook system for Claude Code - write hooks with full type safety and auto-completion Overview claude-hooks gives you a powerful, TypeScript-based way to customize Claude Code's behavior. Write hooks with full type safety, auto-completion, and access to strongly-typed payloads - all in familiar TypeScript syntax. No more guessing payload structures or dealing with untyped data! Requirements - Bun runtime (required for running hooks) - Node.js 18+ (for running the CLI) Quick Start This will: - Create .claude/settings.json with hook configuration - Generate .claude/hooks/index.ts with TypeScript handlers - Set up typed payload interfaces for all hook types - Create utilities for easy hook development Installation Using npx (Recommended) Global Installation What It Does The CLI sets up a complete TypeScript development environment for Claude hooks: 1. Full TypeScript Support - Write hooks with complete type safety and IntelliSense 2. Typed Payloads - Access strongly-typed payload data for all hook types (PreToolUse, PostToolUse, Notification, Stop) 3. Ready-to-Customize - Simple, clean TypeScript files ready for your custom logic 4. Generated Files: - .claude/settings.json - Hook configuration - .claude/hooks/index.ts - Your main hook handlers (edit this!) - .claude/hooks/lib.ts - Type definitions and utilities - .claude/hooks/session.ts - Optional session tracking utilities Generated Structure Session logs are saved to: /claude-hooks-sessions/ Customizing Hooks The real power comes from editing .claude/hooks/index.ts. You get full TypeScript support with typed payloads: The beauty is that you're writing regular TypeScript - use any npm packages, async/await, or patterns you're familiar with! Command…
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
- johnlindquist/claude-hooks
- Type
- Hooks
- Language
- TypeScript
- License
- MIT
- Last updated
- 8 August 2025
- Listed in
- awesome-claude-code (extra)
FAQ
What is claude-hooks?
TypeScript framework for writing typed Claude Code hooks with a generated starter setup. It is a hook for Claude Code, from johnlindquist/claude-hooks on GitHub.
How do I install claude-hooks?
Run npx claude-hooks, then follow the setup in the README.
Is claude-hooks popular?
johnlindquist/claude-hooks has 397 GitHub stars and 24 forks, and is included in 1 curated Claude Code list. It was last updated on 8 August 2025.
More hooks
Claude Code Config
1.1kjarrodwatts/claude-code-config
My personal Claude Code configuration - rules, hooks, agents, skills, and commands
Instagram Skills
728sergebulaev/instagram-skills
Instagram marketing skills for Claude Code and Codex: captions, carousels, hooks, hashtag strategy, and a weekly plan. Draft, humanize, and publish via Publora. MIT. Content engineering by Creative Content Crafts.
Claude Code Tamagotchi
435Ido-Levi/claude-code-tamagotchi
Virtual pet that watches Claude's actions through hooks and interrupts when it breaks your rules.
Lasso Claude Hooks
271lasso-security/claude-hooks
Security hooks from Lasso that scan tool output for prompt-injection attempts.
Claude Code Voice Hooks
563shanraisshan/claude-code-hooks
Adds spoken voice feedback to each Claude Code hook event.
nWave
631nWave-ai/nWave
AI agents that guide you from idea to working code, with you in control at every step.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.