Skip to main content

ClaudeEssentials

A lightweight, AOT-compatible .NET library for building Claude Code hook processors. Serialize and deserialize hook payloads with zero reflection overhead.

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:
HookPurpose
PreToolUseApprove, deny, or modify tool calls before execution
PostToolUseAdd context or take action after tools complete
StopEnforce policies before Claude ends a session
SessionStartInject project context when sessions begin
NotificationReact 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

Documentation