Create a Hook Processor
Create a console app that reads JSON from stdin and writes the response to stdout:
Program.cs
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:
Common Patterns
Auto-approve safe tools
Auto-approve safe tools
Block dangerous commands
Block dangerous commands
Add context after tool execution
Add context after tool execution