Skip to main content
1

Install the Package

Add ClaudeEssentials to your project:
For AOT publishing, ensure your project targets .NET 8+ and has PublishAot enabled.
2

Create a Hook Processor

Create a console app that reads JSON from stdin and writes the response to stdout:
Program.cs
3

Configure Claude Code

Add your hook to Claude Code’s settings.json:
settings.json
For production, publish your app as a native executable for faster startup:
4

Test It Out

Start a Claude Code session. Your hook will now intercept tool calls and apply your custom logic.
You’re ready to customize Claude’s behavior with strongly-typed C# code!

Common Patterns

Next Steps

API Reference

Explore all available types and methods

Hook Inputs

Learn about input models for each hook type