What problem does it solve?
This Skill provides a comprehensive guide and examples for creating type-safe Claude Code hooks using the cc-hooks-ts library. It helps you implement event-driven hooks (PreToolUse/PostToolUse/SessionStart, etc.) in TypeScript, enabling deterministic automation in Claude Code projects and reducing boilerplate across tool integrations.
Core Features & Use Cases
- Type-safe hook implementation: Use TypeScript to define hooks with compile-time safety.
- Event-driven automation: Hook into PostToolUse, PreToolUse, SessionStart, and more to automate checks, logging, and policy enforcement.
- Practical examples: Includes full code snippets showing installation, a basic hook, and real-world scenarios.
- Plugin.json integration: Learn how to wire hooks into Claude Code plugin.json.
Quick Start
Install: bun add cc-hooks-ts. Create a hook.ts that uses defineHook from "cc-hooks-ts" and run it with bun run -i --silent path-to-your-hook.ts.