Claude Hooks banner
johnlindquist johnlindquist

Claude Hooks

Git community intermediate

Description

[](https://npmjs.org/package/claude-hooks) [](https://github.com/johnlindquist/claude-hooks/blob/main/LICENSE) [](https://github.com/johnlindquist/claude-hooks/actions/workflows/test.yml)

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

claude-hooks

[](https://npmjs.org/package/claude-hooks) [](https://github.com/johnlindquist/claude-hooks/blob/main/LICENSE) [](https://github.com/johnlindquist/claude-hooks/actions/workflows/test.yml)

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

npx claude-hooks

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)

npx claude-hooks

Global Installation

npm install -g claude-hooks
claude-hooks

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

.claude/
├── settings.json
└── hooks/
    ├── index.ts
    ├── lib.ts
    └── session.ts

...