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

# EditToolResponse

> Represents the response payload returned by the Claude Code Edit tool after performing             a string replacement in a file.

## Definition

**Assembly:** CloudNimble.ClaudeEssentials.dll

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

**Inheritance:** System.Object

## Syntax

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

## Summary

Represents the response payload returned by the Claude Code Edit tool after performing
a string replacement in a file.

## Remarks

The Edit tool performs exact string replacements in files. It requires that the target
file has been read at least once in the conversation before editing. This response is
received in the [EditPostToolUsePayload](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/EditPostToolUsePayload)
when the `tool_name` is "Edit".

The Edit tool will fail if the [EditToolInput.OldString](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/EditToolInput#oldstring) is not unique in
the file, unless [EditToolInput.ReplaceAll](/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/EditToolInput#replaceall) is set to `true`.

Example JSON payload:

```csharp theme={"dark"}
{
"filePath": "C:\\Projects\\MyApp\\Program.cs",
"oldString": "Console.WriteLine(\"Hello\");",
"newString": "Console.WriteLine(\"Hello, World!\");",
"originalFile": "using System;\n\nclass Program...",
"structuredPatch": [
{
"oldStart": 5,
"oldLines": 1,
"newStart": 5,
"newLines": 1,
"lines": ["-Console.WriteLine(\"Hello\");", "+Console.WriteLine(\"Hello, World!\");"]
}
],
"userModified": false,
"replaceAll": false
}
```

## Constructors

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

#### Syntax

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

### <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" /> FilePath

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

#### Syntax

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

#### Property Value

Type: `string`

#### Examples

```csharp theme={"dark"}
"C:\\Users\\Developer\\Projects\\MyApp\\src\\Program.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.

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

Gets or sets the new string that replaced the old string.

#### Syntax

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

#### Property Value

Type: `string`

#### Remarks

This is the replacement text that now appears in the file where
[EditToolResponse.OldString](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/EditToolResponse#oldstring) was previously located.

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

Gets or sets the original string that was searched for and replaced.

#### Syntax

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

#### Property Value

Type: `string`

#### Remarks

This is the exact string that was matched in the file. The Edit tool preserves
the exact indentation (tabs/spaces) from the original file content.

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

Gets or sets the complete original content of the file before the edit was applied.

#### Syntax

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

#### Property Value

Type: `string`

#### Remarks

This contains the full file content prior to the replacement, which can be useful
for implementing undo functionality, auditing changes, or verifying the context
of the edit.

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

Gets or sets a value indicating whether all occurrences of the old string
were replaced, or just the first occurrence.

#### Syntax

```csharp theme={"dark"}
public bool ReplaceAll { get; set; }
```

#### Property Value

Type: `bool`

#### Remarks

When `false` (the default), the Edit tool requires that [EditToolResponse.OldString](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/EditToolResponse#oldstring)
appears exactly once in the file, and only that single occurrence is replaced.

When `true`, all occurrences of [EditToolResponse.OldString](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/EditToolResponse#oldstring) in the file are
replaced with [EditToolResponse.NewString](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/EditToolResponse#newstring). This is useful for renaming variables
or updating repeated patterns throughout a file.

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

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

#### Syntax

```csharp theme={"dark"}
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

This contains a unified diff representation showing what changed between the
original and edited content. Each [StructuredPatchHunk](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/StructuredPatchHunk) represents
a contiguous block of changes.

When [EditToolResponse.ReplaceAll](/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/EditToolResponse#replaceall) is `true` and multiple replacements were made,
there may be multiple hunks in the patch, one for each replacement location.

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

Gets or sets a value indicating whether the file was modified by the user
since it was last read by Claude.

#### Syntax

```csharp theme={"dark"}
public bool UserModified { get; set; }
```

#### Property Value

Type: `bool`

#### Remarks

If `true`, Claude detected that the file content changed between when it
was read and when the edit was applied. This can happen if the user edits the
file externally while Claude is working.

This flag helps track potential merge conflicts or unexpected changes in the
editing workflow.

## 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?`
