Skip to main content

Definition

Assembly: CloudNimble.ClaudeEssentials.dll Namespace: CloudNimble.ClaudeEssentials.Hooks.Tools.Responses Inheritance: System.Object

Syntax

Summary

Represents the response payload returned by the Claude Code Bash tool after executing a shell command.

Remarks

The Bash tool executes shell commands in a persistent shell session. This response is received in the BashPostToolUsePayload when the tool_name is “Bash”. Commands have a default timeout of 120 seconds (2 minutes), which can be extended up to 600 seconds (10 minutes) using the BashToolInput.Timeout parameter. If a command exceeds its timeout, it will be interrupted and BashToolResponse.Interrupted will be true. Output exceeding 30,000 characters is automatically truncated by Claude Code. Example JSON payload:

Constructors

.ctor

Syntax

.ctor Inherited

Inherited from object

Syntax

Properties

BackgroundCwdHint

Gets or sets the model-facing note that the session working directory was not changed by a backgrounded command.

Syntax

Property Value

Type: string?

BackgroundedByUser

Gets or sets a value indicating whether the user manually backgrounded the command.

Syntax

Property Value

Type: System.Nullable<bool>?

BackgroundEndsWithFinalResponse

Gets or sets a value indicating whether this backgrounded command is terminated at its caller’s final response.

Syntax

Property Value

Type: System.Nullable<bool>?

BackgroundTaskId

Gets or sets the ID of the background task if the command is running in the background.

Syntax

Property Value

Type: string?

BackgroundWakesOwner

Gets or sets a value indicating whether the subagent that owns this backgrounded command parks for its end and is woken by it.

Syntax

Property Value

Type: System.Nullable<bool>?

DangerouslyDisableSandbox

Gets or sets a value indicating whether sandbox mode was overridden.

Syntax

Property Value

Type: System.Nullable<bool>?

GhRateLimitHint

Gets or sets the model-facing reminder appended when a gh command reports a GitHub API rate-limit error.

Syntax

Property Value

Type: string?

GitOperation

Gets or sets the structured classification of git and GitHub operations detected in this command.

Syntax

Property Value

Type: CloudNimble.ClaudeEssentials.Hooks.Tools.Responses.GitOperationInfo?

Interrupted

Gets or sets a value indicating whether the command was interrupted before completion.

Syntax

Property Value

Type: bool

Remarks

When true, the command did not complete normally. This typically occurs when:
  • The command exceeded its timeout (default 120 seconds, max 600 seconds)
  • The user manually cancelled the operation
  • The command was killed by the system
When a command is interrupted, BashToolResponse.Stdout and BashToolResponse.Stderr will contain whatever output was captured before the interruption occurred.

IsImage

Gets or sets a value indicating whether the output contains image data.

Syntax

Property Value

Type: System.Nullable<bool>?

Remarks

When true, the command produced image output that Claude can interpret visually. This is used for commands that generate images or graphical output. Claude is a multimodal LLM and can process image data directly. When this is true, the BashToolResponse.Stdout may contain base64-encoded image data or be empty while the image is presented to Claude separately.

NoOutputExpected

Gets or sets a value indicating whether the command is expected to produce no output on success.

Syntax

Property Value

Type: System.Nullable<bool>?

PersistedOutputPath

Gets or sets the path to the persisted full output, set when the output is too large for inline.

Syntax

Property Value

Type: string?

PersistedOutputSize

Gets or sets the total size of the output in bytes, set when the output is too large for inline.

Syntax

Property Value

Type: System.Nullable<long>?

RawOutputPath

Gets or sets the path to the raw output file for large MCP tool outputs.

Syntax

Property Value

Type: string?

ReturnCodeInterpretation

Gets or sets the semantic interpretation for non-error exit codes with special meaning.

Syntax

Property Value

Type: string?

StaleReadFileStateHint

Gets or sets a model-facing note listing readFileState entries whose modification time changed during the execution of this command.

Syntax

Property Value

Type: string?

Remarks

Claude Code tracks the modification time of files it has previously read. When a Bash command matches the harness’s WRITE_COMMAND_MARKERS heuristic (for example, commands that write, move, or generate files), the harness checks whether any tracked files had their mtime bumped while the command was running and surfaces that information here. This hint exists so the model can re-read stale files before acting on cached content; it is null when the heuristic did not fire or no tracked files were touched.

Stderr

Gets or sets the standard error (stderr) output from the executed command.

Syntax

Property Value

Type: string

Remarks

This contains all text written to stderr by the command. Many commands write warnings, progress information, or diagnostic messages to stderr even when successful. An empty BashToolResponse.Stderr does not necessarily indicate success, and a non-empty BashToolResponse.Stderr does not necessarily indicate failure. Check the actual content and context to determine the command’s success.

Stdout

Gets or sets the standard output (stdout) from the executed command.

Syntax

Property Value

Type: string

Remarks

This contains all text written to stdout by the command. On Windows, line endings will typically be CRLF (\r\n), while on Unix-like systems they will be LF (\n). If the output exceeds 30,000 characters, it will be truncated by Claude Code. For commands that produce binary output (like image generation), this may be empty and BashToolResponse.IsImage will be true.

StructuredContent

Gets or sets the structured content blocks.

Syntax

Property Value

Type: System.Collections.Generic.List<System.Text.Json.JsonElement?>?

TimedOutAfterMs

Gets or sets the timeout value in milliseconds, set when the command hit its timeout and was auto-backgrounded.

Syntax

Property Value

Type: System.Nullable<long>?

Methods

Equals Inherited Virtual

Inherited from object

Syntax

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?