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

# WriteToolResponse

> Represents the response payload returned by the Claude Code Write tool after creating or overwriting a file.

## Definition

**Assembly:** CloudNimble.ClaudeEssentials.dll

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

**Inheritance:** System.Object

## Syntax

```csharp theme={null}
CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.WriteToolResponse
```

## Summary

Represents the response payload returned by the Claude Code Write tool after creating or overwriting a file.

## Remarks

The Write tool creates new files or overwrites existing files on the local filesystem.
This response is received in the [WritePostToolUsePayload](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/WritePostToolUsePayload.md)
when the `tool_name` is "Write".

Unlike the Edit tool which performs targeted string replacements, the Write tool completely
replaces the file content. Claude Code requires that an existing file be read first before
it can be overwritten, to prevent accidental data loss.

Example JSON payload for a new file:

```csharp theme={null}
{
  "type": "create",
  "filePath": "C:\\Projects\\MyApp\\NewFile.cs",
  "content": "using System;\n\nnamespace MyApp { }",
  "structuredPatch": [],
  "originalFile": null
}
```

## Constructors

### &#x20;.ctor

#### Syntax

```csharp theme={null}
public WriteToolResponse()
```

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public Object()
```

## Properties

### &#x20;Content

Gets or sets the content that was written to the file.

#### Syntax

```csharp theme={null}
public string Content { get; set; }
```

#### Property Value

Type: `string`

#### Remarks

This contains the complete content of the file after the write operation.
For new files, this is the entire file content. For overwrites, this is
the new content that replaced the original.

### &#x20;FilePath

Gets or sets the absolute path to the file that was written.

#### Syntax

```csharp theme={null}
public string FilePath { get; set; }
```

#### Property Value

Type: `string`

#### Examples

```csharp theme={null}
"C:\\Users\\Developer\\Projects\\MyApp\\src\\NewClass.cs"
```

#### Remarks

This is always an absolute path, regardless of whether the original request
used a relative or absolute path. On Windows, this will use backslash separators.

### &#x20;GitDiff

Gets or sets git diff information for this file change, when available.

#### Syntax

```csharp theme={null}
public CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.GitDiffInfo GitDiff { get; set; }
```

#### Property Value

Type: `CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.GitDiffInfo?`

#### Remarks

This is populated when the written file is in a git repository and git tracking
is available. It provides a summary of the changes as they would appear in `git diff`.

### &#x20;OriginalFile

Gets or sets the original file content before the write operation.

#### Syntax

```csharp theme={null}
public string OriginalFile { get; set; }
```

#### Property Value

Type: `string?`

#### Remarks

This is `null` when creating a new file ([WriteToolResponse.Type](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WriteToolResponse.md#type) = "create")
since there was no previous content.

For overwrites, this contains the complete original content of the file
before it was replaced, which can be useful for implementing undo functionality
or auditing changes.

### &#x20;StructuredPatch

Gets or sets the structured patch representing the changes made to the file.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.List<CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.StructuredPatchHunk> StructuredPatch { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.List<CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.StructuredPatchHunk>`

#### Remarks

For new files ([WriteToolResponse.Type](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/WriteToolResponse.md#type) = "create"), this will be an empty list since
there is no previous content to diff against.

For overwrites, this contains a unified diff representation showing what changed
between the original and new content. Each [StructuredPatchHunk](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/StructuredPatchHunk.md)
represents a contiguous block of changes.

### &#x20;Type

Gets or sets the type of write operation that was performed.

#### Syntax

```csharp theme={null}
public CloudNimble.ClaudeEssentials.Hooks.WriteOperationType Type { get; set; }
```

#### Property Value

Type: `CloudNimble.ClaudeEssentials.Hooks.WriteOperationType`

#### Remarks

See [WriteOperationType](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/WriteOperationType.md) for possible values.

## Methods

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Returns

Type: `int`

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Returns

Type: `System.Type`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Returns

Type: `object`

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Returns

Type: `string?`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.