claude_code.ClaudeCodeClient

A harness client: the authenticated Claude Code CLI as an `ai.Client`. The transport is a local process, not HTTP; the output contract travels natively via --json-schema; BAML tools ride the `outcome` envelope.

Reference version

Signature

class claude_code.ClaudeCodeClient

A harness client: the authenticated Claude Code CLI as an ai.Client. The transport is a local process, not HTTP; the output contract travels natively via --json-schema; BAML tools ride the outcome envelope.

Source:<builtin>/claude_code/cli.bamlbytes 2232704

Fields

executable

string

model

string

cwd

string | null

timeout_ms

int

permission_mode

string

harness_tools

string[]

mcp_servers

map<string, baml.json.json>

capture_wire

bool

Static methods

function

new

(
model: string = …,
executable: string = …,
cwd: string | null = …,
timeout_ms: int = …,
permission_mode: string = …,
harness_tools: string[] = …,
mcp_servers: map<string, baml.json.json> | null = …,
capture_wire: bool = …
) -> claude_code.ClaudeCodeClient

Creates a client. Construction reads no environment variable, so declaring one is always safe; credentials and endpoints resolve when a request is built.

Implementations

ai.Client for claude_code.ClaudeCodeClient

Instance methods

function

id

(self) -> string
function

invoke

(
self,
input: ai.ModelTurnInput
) -> ai.ModelTurn throws baml.errors.Timeout | baml.errors.UnknownError | reflect.errors.CompilationError | ai.errors.Failure
function

render

(self, input: ai.ModelTurnInput) -> baml.http.Request throws ai.errors.PreviewUnsupported

Claude Code is a process-backed client rather than an HTTP client; there is no wire Request to preview. Keep this explicit so adding render to ai.Client cannot accidentally invoke the CLI.

Source:<builtin>/claude_code/cli.bamlbytes 18742702