Documentation Index Fetch the complete documentation index at: https://easyaf.dev/llms.txt
Use this file to discover all available pages before exploring further.
Definition
Assembly: CloudNimble.ClaudeEssentials.dll
Namespace: CloudNimble.ClaudeEssentials.Hooks
Inheritance: System.Object
Syntax
CloudNimble . ClaudeEssentials . Hooks . ClaudeHooksSerializer
Summary
Provides static helper methods for serializing and deserializing Claude Code hook types.
All methods use the AOT-compatible ClaudeHooksJsonContext for serialization.
Usage
ClaudeHooksSerializer provides AOT-compatible static methods for JSON serialization using source-generated contexts.
// Read and deserialize from stdin
string json = Console . In . ReadToEnd ();
var preToolUse = ClaudeHooksSerializer . DeserializePreToolUseInput ( json );
var postToolUse = ClaudeHooksSerializer . DeserializePostToolUseInput ( json );
var stop = ClaudeHooksSerializer . DeserializeStopInput ( json );
var notification = ClaudeHooksSerializer . DeserializeNotificationInput ( json );
Serializing Output
// Create and serialize output
var output = new PreToolUseHookOutput < object > { Continue = true };
string json = ClaudeHooksSerializer . SerializePreToolUseOutput ( output );
Console . WriteLine ( json );
Using Custom Types
For strongly-typed tool inputs, create your own JsonSerializerContext:
[ JsonSerializable ( typeof ( PreToolUseHookInput < MyToolInput >))]
public partial class MyJsonContext : JsonSerializerContext { }
var input = ClaudeHooksSerializer . DeserializePreToolUseInput < MyToolInput >(
json , MyJsonContext . Default . PreToolUseHookInputMyToolInput );
Properties
DefaultOptions
Gets the default JsonSerializerOptions configured for Claude Code hooks.
This instance is configured with the ClaudeHooksJsonContext for AOT compatibility.
Syntax
public static System . Text . Json . JsonSerializerOptions DefaultOptions { get ; }
Property Value
Type: System.Text.Json.JsonSerializerOptions
Methods
Deserializes a JSON string to a NotificationHookInput .
Syntax
public static CloudNimble . ClaudeEssentials . Hooks . Inputs . NotificationHookInput DeserializeNotificationInput ( string json )
Parameters
Name Type Description jsonstringThe JSON string to deserialize.
Returns
Type: CloudNimble.ClaudeEssentials.Hooks.Inputs.NotificationHookInput?
The deserialized hook input, or null if deserialization fails.
Deserializes a JSON string to a PermissionRequestHookInput1` with dynamic tool input.
Syntax
public static CloudNimble . ClaudeEssentials . Hooks . Inputs . PermissionRequestHookInput < object > DeserializePermissionRequestInput ( string json )
Parameters
Name Type Description jsonstringThe JSON string to deserialize.
Returns
Type: CloudNimble.ClaudeEssentials.Hooks.Inputs.PermissionRequestHookInput<object>?
The deserialized hook input, or null if deserialization fails.
DeserializePostToolUseInput
Deserializes a JSON string to a PostToolUseHookInput2` with dynamic types.
Syntax
public static CloudNimble . ClaudeEssentials . Hooks . Inputs . PostToolUseHookInput < object , object > DeserializePostToolUseInput ( string json )
Parameters
Name Type Description jsonstringThe JSON string to deserialize.
Returns
Type: CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput<object, object>?
The deserialized hook input, or null if deserialization fails.
DeserializePostToolUseInput
Deserializes a JSON string to a PostToolUseHookInput2` with specific types.
Syntax
public static CloudNimble . ClaudeEssentials . Hooks . Inputs . PostToolUseHookInput < TToolInput , TToolResponse > DeserializePostToolUseInput < TToolInput , TToolResponse >( string json , System . Text . Json . Serialization . Metadata . JsonTypeInfo < CloudNimble . ClaudeEssentials . Hooks . Inputs . PostToolUseHookInput < TToolInput , TToolResponse >> typeInfo ) where TToolInput : class where TToolResponse : class
Parameters
Name Type Description jsonstringThe JSON string to deserialize. typeInfoSystem.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput<TToolInput, TToolResponse>>The JSON type info for the specific input type.
Returns
Type: CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput<TToolInput, TToolResponse>?
The deserialized hook input, or null if deserialization fails.
Type Parameters
TToolInput - The type of the tool input.
TToolResponse - The type of the tool response.
Deserializes a JSON string to a PreCompactHookInput .
Syntax
public static CloudNimble . ClaudeEssentials . Hooks . Inputs . PreCompactHookInput DeserializePreCompactInput ( string json )
Parameters
Name Type Description jsonstringThe JSON string to deserialize.
Returns
Type: CloudNimble.ClaudeEssentials.Hooks.Inputs.PreCompactHookInput?
The deserialized hook input, or null if deserialization fails.
Deserializes a JSON string to a PreToolUseHookInput1` with dynamic tool input.
Syntax
public static CloudNimble . ClaudeEssentials . Hooks . Inputs . PreToolUseHookInput < object > DeserializePreToolUseInput ( string json )
Parameters
Name Type Description jsonstringThe JSON string to deserialize.
Returns
Type: CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput<object>?
The deserialized hook input, or null if deserialization fails.
Deserializes a JSON string to a PreToolUseHookInput1` with a specific tool input type.
Syntax
public static CloudNimble . ClaudeEssentials . Hooks . Inputs . PreToolUseHookInput < TToolInput > DeserializePreToolUseInput < TToolInput >( string json , System . Text . Json . Serialization . Metadata . JsonTypeInfo < CloudNimble . ClaudeEssentials . Hooks . Inputs . PreToolUseHookInput < TToolInput >> typeInfo ) where TToolInput : class
Parameters
Name Type Description jsonstringThe JSON string to deserialize. typeInfoSystem.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput<TToolInput>>The JSON type info for the specific input type.
Returns
Type: CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput<TToolInput>?
The deserialized hook input, or null if deserialization fails.
Type Parameters
TToolInput - The type of the tool input.
Deserializes a JSON string to a SessionEndHookInput .
Syntax
public static CloudNimble . ClaudeEssentials . Hooks . Inputs . SessionEndHookInput DeserializeSessionEndInput ( string json )
Parameters
Name Type Description jsonstringThe JSON string to deserialize.
Returns
Type: CloudNimble.ClaudeEssentials.Hooks.Inputs.SessionEndHookInput?
The deserialized hook input, or null if deserialization fails.
Deserializes a JSON string to a SessionStartHookInput .
Syntax
public static CloudNimble . ClaudeEssentials . Hooks . Inputs . SessionStartHookInput DeserializeSessionStartInput ( string json )
Parameters
Name Type Description jsonstringThe JSON string to deserialize.
Returns
Type: CloudNimble.ClaudeEssentials.Hooks.Inputs.SessionStartHookInput?
The deserialized hook input, or null if deserialization fails.
Deserializes a JSON string to a StopHookInput .
Syntax
public static CloudNimble . ClaudeEssentials . Hooks . Inputs . StopHookInput DeserializeStopInput ( string json )
Parameters
Name Type Description jsonstringThe JSON string to deserialize.
Returns
Type: CloudNimble.ClaudeEssentials.Hooks.Inputs.StopHookInput?
The deserialized hook input, or null if deserialization fails.
Deserializes a JSON string to a SubagentStopHookInput .
Syntax
public static CloudNimble . ClaudeEssentials . Hooks . Inputs . SubagentStopHookInput DeserializeSubagentStopInput ( string json )
Parameters
Name Type Description jsonstringThe JSON string to deserialize.
Returns
Type: CloudNimble.ClaudeEssentials.Hooks.Inputs.SubagentStopHookInput?
The deserialized hook input, or null if deserialization fails.
Deserializes a JSON string to a UserPromptSubmitHookInput .
Syntax
public static CloudNimble . ClaudeEssentials . Hooks . Inputs . UserPromptSubmitHookInput DeserializeUserPromptSubmitInput ( string json )
Parameters
Name Type Description jsonstringThe JSON string to deserialize.
Returns
Type: CloudNimble.ClaudeEssentials.Hooks.Inputs.UserPromptSubmitHookInput?
The deserialized hook input, or null if deserialization fails.
SerializeNotificationOutput
Serializes a NotificationHookOutput to JSON.
Syntax
public static string SerializeNotificationOutput ( CloudNimble . ClaudeEssentials . Hooks . Outputs . NotificationHookOutput output )
Parameters
Name Type Description outputCloudNimble.ClaudeEssentials.Hooks.Outputs.NotificationHookOutputThe hook output to serialize.
Returns
Type: string
The JSON string representation.
SerializePermissionRequestOutput
Serializes a PermissionRequestHookOutput1` with dynamic tool input to JSON.
Syntax
public static string SerializePermissionRequestOutput ( CloudNimble . ClaudeEssentials . Hooks . Outputs . PermissionRequestHookOutput < object > output )
Parameters
Name Type Description outputCloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestHookOutput<object>The hook output to serialize.
Returns
Type: string
The JSON string representation.
SerializePostToolUseOutput
Serializes a PostToolUseHookOutput to JSON.
Syntax
public static string SerializePostToolUseOutput ( CloudNimble . ClaudeEssentials . Hooks . Outputs . PostToolUseHookOutput output )
Parameters
Name Type Description outputCloudNimble.ClaudeEssentials.Hooks.Outputs.PostToolUseHookOutputThe hook output to serialize.
Returns
Type: string
The JSON string representation.
SerializePreCompactOutput
Serializes a PreCompactHookOutput to JSON.
Syntax
public static string SerializePreCompactOutput ( CloudNimble . ClaudeEssentials . Hooks . Outputs . PreCompactHookOutput output )
Parameters
Name Type Description outputCloudNimble.ClaudeEssentials.Hooks.Outputs.PreCompactHookOutputThe hook output to serialize.
Returns
Type: string
The JSON string representation.
Serializes a PreToolUseHookOutput1` with dynamic tool input to JSON.
Syntax
public static string SerializePreToolUseOutput ( CloudNimble . ClaudeEssentials . Hooks . Outputs . PreToolUseHookOutput < object > output )
Parameters
Name Type Description outputCloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseHookOutput<object>The hook output to serialize.
Returns
Type: string
The JSON string representation.
Serializes a PreToolUseHookOutput1` with a specific tool input type to JSON.
Syntax
public static string SerializePreToolUseOutput < TToolInput >( CloudNimble . ClaudeEssentials . Hooks . Outputs . PreToolUseHookOutput < TToolInput > output , System . Text . Json . Serialization . Metadata . JsonTypeInfo < CloudNimble . ClaudeEssentials . Hooks . Outputs . PreToolUseHookOutput < TToolInput >> typeInfo ) where TToolInput : class
Parameters
Name Type Description outputCloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseHookOutput<TToolInput>The hook output to serialize. typeInfoSystem.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseHookOutput<TToolInput>>The JSON type info for the specific output type.
Returns
Type: string
The JSON string representation.
Type Parameters
TToolInput - The type of the tool input.
SerializeSessionEndOutput
Serializes a SessionEndHookOutput to JSON.
Syntax
public static string SerializeSessionEndOutput ( CloudNimble . ClaudeEssentials . Hooks . Outputs . SessionEndHookOutput output )
Parameters
Name Type Description outputCloudNimble.ClaudeEssentials.Hooks.Outputs.SessionEndHookOutputThe hook output to serialize.
Returns
Type: string
The JSON string representation.
SerializeSessionStartOutput
Serializes a SessionStartHookOutput to JSON.
Syntax
public static string SerializeSessionStartOutput ( CloudNimble . ClaudeEssentials . Hooks . Outputs . SessionStartHookOutput output )
Parameters
Name Type Description outputCloudNimble.ClaudeEssentials.Hooks.Outputs.SessionStartHookOutputThe hook output to serialize.
Returns
Type: string
The JSON string representation.
SerializeStopOutput
Serializes a StopHookOutput to JSON.
Syntax
public static string SerializeStopOutput ( CloudNimble . ClaudeEssentials . Hooks . Outputs . StopHookOutput output )
Parameters
Name Type Description outputCloudNimble.ClaudeEssentials.Hooks.Outputs.StopHookOutputThe hook output to serialize.
Returns
Type: string
The JSON string representation.
SerializeSubagentStopOutput
Serializes a SubagentStopHookOutput to JSON.
Syntax
public static string SerializeSubagentStopOutput ( CloudNimble . ClaudeEssentials . Hooks . Outputs . SubagentStopHookOutput output )
Parameters
Name Type Description outputCloudNimble.ClaudeEssentials.Hooks.Outputs.SubagentStopHookOutputThe hook output to serialize.
Returns
Type: string
The JSON string representation.
SerializeUserPromptSubmitOutput
Serializes a UserPromptSubmitHookOutput to JSON.
Syntax
public static string SerializeUserPromptSubmitOutput ( CloudNimble . ClaudeEssentials . Hooks . Outputs . UserPromptSubmitHookOutput output )
Parameters
Name Type Description outputCloudNimble.ClaudeEssentials.Hooks.Outputs.UserPromptSubmitHookOutputThe hook output to serialize.
Returns
Type: string
The JSON string representation.