> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# WritePreToolUsePayload

> Represents the complete payload delivered to a PreToolUse hook when the Write tool is about to be invoked.

## Definition

**Assembly:** CloudNimble.ClaudeEssentials.dll

**Namespace:** CloudNimble.ClaudeEssentials.Hooks.Tools

**Inheritance:** CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput\<CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput>

## Syntax

```csharp theme={"dark"}
CloudNimble.ClaudeEssentials.Hooks.Tools.WritePreToolUsePayload
```

## Summary

Represents the complete payload delivered to a PreToolUse hook when the Write tool is about to be invoked.

## Remarks

This payload contains all context provided to your hook before Claude executes the Write tool,
including session information, the tool input parameters, and permission context. Use this
type for strongly-typed deserialization of PreToolUse hook payloads when `tool_name` is "Write".

The Write tool creates or overwrites files on the local filesystem. Your hook can inspect
the target path and content before the write occurs, potentially blocking sensitive operations.

\<strong>Terminology:\</strong>

## Examples

```csharp theme={"dark"}
var payload = JsonSerializer.Deserialize&lt;WritePreToolUsePayload&gt;(json);
Console.WriteLine($"Writing to: {payload.ToolInput.FilePath}");
```

## Constructors

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor

#### Syntax

```csharp theme={"dark"}
public WritePreToolUsePayload()
```

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput<CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput>`</Note>

#### Syntax

```csharp theme={"dark"}
public PreToolUseHookInput()
```

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase<CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput>`</Note>

#### Syntax

```csharp theme={"dark"}
protected ToolHookInputBase()
```

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase`</Note>

#### Syntax

```csharp theme={"dark"}
protected HookInputBase()
```

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> CurrentWorkingDirectory <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase`</Note>

Gets or sets the current working directory where Claude Code is running.

#### Syntax

```csharp theme={"dark"}
public string CurrentWorkingDirectory { get; set; }
```

#### Property Value

Type: `string`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> HookEventName <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase`</Note>

Gets or sets the name of the hook event that triggered this input.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.ClaudeEssentials.Hooks.HookEventName HookEventName { get; set; }
```

#### Property Value

Type: `CloudNimble.ClaudeEssentials.Hooks.HookEventName`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> PermissionMode <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase`</Note>

Gets or sets the permission mode under which Claude Code is operating.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.ClaudeEssentials.Hooks.PermissionMode PermissionMode { get; set; }
```

#### Property Value

Type: `CloudNimble.ClaudeEssentials.Hooks.PermissionMode`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> SessionId <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase`</Note>

Gets or sets the unique identifier for the current Claude Code session.

#### Syntax

```csharp theme={"dark"}
public string SessionId { get; set; }
```

#### Property Value

Type: `string`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToolInput <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase<CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput>`</Note>

Gets or sets the input parameters for the tool.
The schema depends on the specific tool being invoked.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput ToolInput { get; set; }
```

#### Property Value

Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput?`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToolName <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase<CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput>`</Note>

Gets or sets the name of the tool being invoked.
Common tool names include: Write, Edit, Bash, Read, Grep, Glob, Task, WebFetch, WebSearch.
MCP tools follow the pattern: mcp\_\_\<server>\_\_\<tool>.

#### Syntax

```csharp theme={"dark"}
public string ToolName { get; set; }
```

#### Property Value

Type: `string`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToolUseId <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.ToolHookInputBase<CloudNimble.ClaudeEssentials.Hooks.Tools.Inputs.WriteToolInput>`</Note>

Gets or sets the unique identifier for this specific tool use instance.
Typically follows the pattern: toolu\_01ABC123...

#### Syntax

```csharp theme={"dark"}
public string ToolUseId { get; set; }
```

#### Property Value

Type: `string`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> TranscriptPath <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.ClaudeEssentials.Hooks.Inputs.HookInputBase`</Note>

Gets or sets the file path to the transcript JSONL file for the current session.
This file contains the full conversation history.

#### Syntax

```csharp theme={"dark"}
public string TranscriptPath { get; set; }
```

#### Property Value

Type: `string`

## Methods

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name  | Type      | Description |
| ----- | --------- | ----------- |
| `obj` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetHashCode <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetType <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MemberwiseClone <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ReferenceEquals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`
