> ## 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.

# StructuredPatchHunk

> Represents a single hunk (contiguous block of changes) in a unified diff patch.

## Definition

**Assembly:** CloudNimble.ClaudeEssentials.dll

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

**Inheritance:** System.Object

## Syntax

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

## Summary

Represents a single hunk (contiguous block of changes) in a unified diff patch.

## Remarks

A structured patch hunk follows the unified diff format, showing context lines
and changed lines together. Each hunk represents changes to a contiguous section
of the file.

The [StructuredPatchHunk.Lines](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/StructuredPatchHunk.md#lines) collection uses standard diff prefixes:

* `"-"` prefix indicates a line removed from the original
* `"+"` prefix indicates a line added in the new version
* `" "` (space) prefix indicates an unchanged context line
* `"\"` indicates metadata like "No newline at end of file"

Example hunk from an Edit operation:

```csharp theme={null}
{
  "oldStart": 10,
  "oldLines": 3,
  "newStart": 10,
  "newLines": 3,
  "lines": [
    " // Context line before",
    "-    var oldValue = 42;",
    "+    var newValue = 100;",
    " // Context line after"
  ]
}
```

## Constructors

### &#x20;.ctor

#### Syntax

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

### &#x20;.ctor Inherited

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

#### Syntax

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

## Properties

### &#x20;Lines

Gets or sets the collection of diff lines representing the changes in this hunk.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.List<string> Lines { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.List<string>`

#### Examples

```csharp theme={null}
[
  "-    oldCode();",
  "+    newCode();",
  "\\ No newline at end of file"
]
```

#### Remarks

Each line is prefixed with a character indicating its status:

* `"-"` - Line was removed from the original file
* `"+"` - Line was added in the new file
* `" "` - Line is unchanged (context)
* `"\"` - Metadata (e.g., "\ No newline at end of file")

### &#x20;NewLines

Gets or sets the number of lines in the new file for this hunk.

#### Syntax

```csharp theme={null}
public int NewLines { get; set; }
```

#### Property Value

Type: `int`

#### Remarks

This count includes both added lines (prefixed with `"+"`) and unchanged
context lines (prefixed with `" "`) in the new file.

### &#x20;NewStart

Gets or sets the starting line number in the new file where this hunk begins.

#### Syntax

```csharp theme={null}
public int NewStart { get; set; }
```

#### Property Value

Type: `int`

#### Remarks

Line numbers are 1-based. This indicates where in the modified file the changes
represented by this hunk are now located. This may differ from [StructuredPatchHunk.OldStart](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/StructuredPatchHunk.md#oldstart)
if previous hunks added or removed lines.

### &#x20;OldLines

Gets or sets the number of lines from the original file affected by this hunk.

#### Syntax

```csharp theme={null}
public int OldLines { get; set; }
```

#### Property Value

Type: `int`

#### Remarks

This count includes both removed lines (prefixed with `"-"`) and unchanged
context lines (prefixed with `" "`) from the original file.

### &#x20;OldStart

Gets or sets the starting line number in the original (old) file where this hunk begins.

#### Syntax

```csharp theme={null}
public int OldStart { get; set; }
```

#### Property Value

Type: `int`

#### Remarks

Line numbers are 1-based. This indicates where in the original file the changes
represented by this hunk were located.

## 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.