# Interface ClaudeCliResponse

Claude CLI response structure. (Source: CLI testing 2026-01-04)

interface ClaudeCliResponse {
type: "result";
subtype?: "error" | "success";
is_error: boolean;
duration_ms?: number;
result: string;
session_id?: string;
total_cost_usd?: number;
usage?: {
input_tokens: number;
output_tokens: number;
cache_creation_input_tokens?: number;
cache_read_input_tokens?: number;
};
modelUsage?: Record<
string,
{
inputTokens: number;
outputTokens: number;
cacheReadInputTokens?: number;
cacheCreationInputTokens?: number;
costUSD?: number;
contextWindow?: number;
},
>;
}

- Defined in packages/nexus-agents/src/cli-adapters/parsers/claude-parser.ts:21

##### Index

### Properties

type
subtype?
is_error
duration_ms?
result
session_id?
total_cost_usd?
usage?
modelUsage?

## Properties

### `Readonly` type

type: "result"

- Defined in packages/nexus-agents/src/cli-adapters/parsers/claude-parser.ts:22

### `Optional` `Readonly` subtype

subtype?: "error" | "success"

- Defined in packages/nexus-agents/src/cli-adapters/parsers/claude-parser.ts:23

### `Readonly` is_error

is_error: boolean

- Defined in packages/nexus-agents/src/cli-adapters/parsers/claude-parser.ts:24

### `Optional` `Readonly` duration_ms

duration_ms?: number

- Defined in packages/nexus-agents/src/cli-adapters/parsers/claude-parser.ts:25

### `Readonly` result

result: string

- Defined in packages/nexus-agents/src/cli-adapters/parsers/claude-parser.ts:26

### `Optional` `Readonly` session_id

session_id?: string

- Defined in packages/nexus-agents/src/cli-adapters/parsers/claude-parser.ts:27

### `Optional` `Readonly` total_cost_usd

total_cost_usd?: number

- Defined in packages/nexus-agents/src/cli-adapters/parsers/claude-parser.ts:28

### `Optional` `Readonly` usage

usage?: {
input_tokens: number;
output_tokens: number;
cache_creation_input_tokens?: number;
cache_read_input_tokens?: number;
}

- Defined in packages/nexus-agents/src/cli-adapters/parsers/claude-parser.ts:29

### `Optional` `Readonly` modelUsage

modelUsage?: Record<
string,
{
inputTokens: number;
outputTokens: number;
cacheReadInputTokens?: number;
cacheCreationInputTokens?: number;
costUSD?: number;
contextWindow?: number;
},
>

- Defined in packages/nexus-agents/src/cli-adapters/parsers/claude-parser.ts:35