Definition
Assembly: CloudNimble.ClaudeEssentials.dll Namespace: CloudNimble.ClaudeEssentials.Hooks.Tools.Responses Inheritance: System.ObjectSyntax
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 when thetool_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:
Constructors
.ctor
Syntax
.ctor Inherited
Inherited from
objectSyntax
Properties
Content
Gets or sets the content that was written to the file.Syntax
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.FilePath
Gets or sets the absolute path to the file that was written.Syntax
Property Value
Type:string
Examples
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.OriginalFile
Gets or sets the original file content before the write operation.Syntax
Property Value
Type:string?
Remarks
This isnull when creating a new file (WriteToolResponse.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.
StructuredPatch
Gets or sets the structured patch representing the changes made to the file.Syntax
Property Value
Type:System.Collections.Generic.List<CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.StructuredPatchHunk>
Remarks
For new files (WriteToolResponse.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 represents a contiguous block of changes.Type
Gets or sets the type of write operation that was performed.Syntax
Property Value
Type:string
Remarks
Known values include:Methods
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | - |
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?