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

# GrepToolResponse

> Represents the response payload returned by the Claude Code Grep tool after searching for content within files.

## Definition

**Assembly:** CloudNimble.ClaudeEssentials.dll

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

**Inheritance:** System.Object

## Syntax

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

## Summary

Represents the response payload returned by the Claude Code Grep tool after searching
for content within files.

## Remarks

The Grep tool is built on ripgrep and provides powerful content search capabilities
with full regex support. This response is received in the
[GrepPostToolUsePayload](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/GrepPostToolUsePayload.md) when the
`tool_name` is "Grep".

The response structure varies based on the [GrepToolInput.OutputMode](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/GrepToolInput.md#outputmode):

* `"files_with_matches"` (default) - Returns only file paths containing matches
* `"content"` - Returns matching lines with context
* `"count"` - Returns match counts per file

Example JSON payload (files\_with\_matches mode):

```csharp theme={null}
{
  "mode": "files_with_matches",
  "filenames": [
    "C:\\Projects\\MyApp\\src\\Program.cs",
    "C:\\Projects\\MyApp\\src\\Utilities.cs"
  ],
  "numFiles": 2
}
```

## Constructors

### &#x20;.ctor

#### Syntax

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

### &#x20;.ctor Inherited

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

#### Syntax

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

## Properties

### &#x20;AppliedLimit

Gets or sets the head\_limit that was applied to the results.

#### Syntax

```csharp theme={null}
public System.Nullable<int> AppliedLimit { get; set; }
```

#### Property Value

Type: `System.Nullable<int>?`

### &#x20;AppliedOffset

Gets or sets the offset that was applied to the results.

#### Syntax

```csharp theme={null}
public System.Nullable<int> AppliedOffset { get; set; }
```

#### Property Value

Type: `System.Nullable<int>?`

### &#x20;Content

Gets or sets the matching content with line numbers and optional context.

#### Syntax

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

#### Property Value

Type: `string?`

#### Examples

```csharp theme={null}
"C:\\Projects\\MyApp\\src\\Program.cs:10:    public static void Main(string[] args)\nC:\\Projects\\MyApp\\src\\Program.cs:15:    static void Helper()"
```

#### Remarks

This property is populated when [GrepToolResponse.Mode](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GrepToolResponse.md#mode) is `"content"`.
It contains the actual matching lines from the files, formatted with line numbers.

The format includes the file path, line number, and matching content.
Additional context lines can be included using the `-A`, `-B`, or `-C`
parameters in [GrepToolInput](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/GrepToolInput.md).

### &#x20;Counts

Gets or sets the match counts per file.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.Dictionary<string, int> Counts { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.Dictionary<string, int>?`

#### Examples

```csharp theme={null}
{
  "C:\\Projects\\MyApp\\src\\Program.cs": 5,
  "C:\\Projects\\MyApp\\src\\Utilities.cs": 2
}
```

#### Remarks

This property is populated when [GrepToolResponse.Mode](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GrepToolResponse.md#mode) is `"count"`.
The dictionary keys are absolute file paths, and the values are the number
of matches found in each file.

This is useful for understanding the distribution of matches across files
before deciding which files to read or edit.

### &#x20;Filenames

Gets or sets the list of file paths containing matches.

#### Syntax

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

#### Property Value

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

#### Remarks

This property is populated when [GrepToolResponse.Mode](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GrepToolResponse.md#mode) is `"files_with_matches"`.
It contains the absolute paths to all files where the search pattern was found.

Files are listed in the order they were found. Use the
[GrepToolInput.HeadLimit](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Inputs/GrepToolInput.md#headlimit) parameter to limit the number of results.

### &#x20;Mode

Gets or sets the output mode that was used for the search.

#### Syntax

```csharp theme={null}
public CloudNimble.ClaudeEssentials.Hooks.GrepOutputMode Mode { get; set; }
```

#### Property Value

Type: `CloudNimble.ClaudeEssentials.Hooks.GrepOutputMode?`

#### Remarks

This indicates which output format was requested and determines which properties
contain the results:

* `"files_with_matches"` - Results are in [GrepToolResponse.Filenames](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GrepToolResponse.md#filenames)
* `"content"` - Results are in [GrepToolResponse.Content](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GrepToolResponse.md#content)
* `"count"` - Results are in [GrepToolResponse.Counts](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GrepToolResponse.md#counts)

### &#x20;NumFiles

Gets or sets the number of files that contained matches.

#### Syntax

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

#### Property Value

Type: `int`

#### Remarks

This represents the count of unique files where the pattern was found.
When [GrepToolResponse.Mode](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GrepToolResponse.md#mode) is `"files_with_matches"`, this equals the
length of [GrepToolResponse.Filenames](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GrepToolResponse.md#filenames).

### &#x20;NumLines

Gets or sets the number of lines in the content output.

#### Syntax

```csharp theme={null}
public System.Nullable<int> NumLines { get; set; }
```

#### Property Value

Type: `System.Nullable<int>?`

#### Remarks

This property is populated when [GrepToolResponse.Mode](https://ai.easyaf.dev/claudeessentials/api-reference/CloudNimble/ClaudeEssentials/Hooks/Tools/Responses/GrepToolResponse.md#mode) is `"content"`.

### &#x20;NumMatches

Gets or sets the total number of pattern matches found.

#### Syntax

```csharp theme={null}
public System.Nullable<int> NumMatches { get; set; }
```

#### Property Value

Type: `System.Nullable<int>?`

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