Claude-hooks TypeScript 由 Claude 代码驱动的钩子系统 - 使用完整类型安全性和自动完成功能编写钩子 概览 Claude-hooks g…
Claude-hooks TypeScript 由 Claude 代码驱动的钩子系统 - 使用完整类型安全性和自动完成功能编写钩子 概览 Claude-hooks g…
TypeScript-powered hook system for Claude Code - write hooks with full type safety and auto-completion
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!
npx claude-hooksThis will:
.claude/settings.json with hook configuration.claude/hooks/index.ts with TypeScript handlersnpx claude-hooksnpm install -g claude-hooks
claude-hooksThe CLI sets up a complete TypeScript development environment for Claude hooks:
.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.claude/
├── settings.json
└── hooks/
├── index.ts
├── lib.ts
└── session.tsSession logs are saved to: /claude-hooks-sessions/
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!
claude-hooks init [OPTIONS]
OPTIONS:
-f, --force Overwrite existing hooks
-h, --help Show helpcurl -fsSL https://bun.sh/install | bashMIT
暂无开放 Issues,或尚未同步最近议题。