ClaudeEssentials
A lightweight, AOT-compatible .NET library for building Claude Code hook processors. Serialize and deserialize hook payloads with zero reflection overhead.Why ClaudeEssentials?
Design philosophy and what makes this library different
Quickstart
Get up and running in under 5 minutes
What Are Claude Code Hooks?
Claude Code hooks let you intercept and customize Claude’s behavior at key points during a session. ClaudeEssentials provides strongly-typed C# models for all hook events:| Hook | Purpose |
|---|---|
PreToolUse | Approve, deny, or modify tool calls before execution |
PostToolUse | Add context or take action after tools complete |
Stop | Enforce policies before Claude ends a session |
SessionStart | Inject project context when sessions begin |
Notification | React to permission prompts and other notifications |
Features
AOT Ready
Source-generated serialization with zero reflection
Strongly Typed
Full IntelliSense and compile-time safety
Lightweight
No dependencies beyond System.Text.Json