Skip to content
3 min read · 530 words

Interface: WrapperRunCommand

Defined in: src/batteries/llm/claude_code_cli/wire.ts:56

The one command adapter.ts sends per dispatch iteration, immediately after the wrapper's ready event arrives. Exactly one run command is accepted per wrapper process lifetime — the wrapper is spawned fresh per dispatch iteration, so there is no multi-run session.

Properties

PropertyTypeDescriptionDefined in
addDir?string[]Additional directories to allow tool access to, forwarded to --add-dir.src/batteries/llm/claude_code_cli/wire.ts:68
allowedToolsstring[]The exact MCP-bridged tool names the grandchild is allowed to call, ALREADY filtered by the adapter to exclude disallowedTools. Always sent, never omitted at this layer — the wrapper itself decides whether to emit --allowedTools (omitted entirely when this array is empty, since the flag is variadic and a bare --allowedTools with nothing after it would swallow the next argv token).src/batteries/llm/claude_code_cli/wire.ts:76
appendSystemPrompt?stringForwarded verbatim to --append-system-prompt, when set.src/batteries/llm/claude_code_cli/wire.ts:62
auth?WrapperAuthExplicit auth credential(s) for the grandchild's environment.src/batteries/llm/claude_code_cli/wire.ts:84
bridgedToolsWrapperBridgedTool[]The JSON-Schema-rendered subset of ctx.tools.visible() the wrapper exposes over MCP, already pre-filtered to exclude disallowedTools.src/batteries/llm/claude_code_cli/wire.ts:104
claudeBinstringPath to the claude binary to spawn.src/batteries/llm/claude_code_cli/wire.ts:94
cwd?stringWorking directory for the grandchild, forwarded to --cwd-equivalent spawn option.src/batteries/llm/claude_code_cli/wire.ts:66
disableErrorReporting?booleanMapped to DISABLE_ERROR_REPORTING on the grandchild's env, never a CLI flag.src/batteries/llm/claude_code_cli/wire.ts:88
disableNonessentialTraffic?booleanMapped to CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC on the grandchild's env, never a CLI flag.src/batteries/llm/claude_code_cli/wire.ts:90
disableTelemetry?booleanMapped to DISABLE_TELEMETRY on the grandchild's env, never a CLI flag.src/batteries/llm/claude_code_cli/wire.ts:86
extraArgs?ClaudeCodeCliExtraArg[]Pre-validated additional argv entries, appended after every constructed flag and before the -- prompt separator.src/batteries/llm/claude_code_cli/wire.ts:106
fallbackModel?string[]Forwarded to --fallback-model as one comma-joined value, never as separate argv tokens.src/batteries/llm/claude_code_cli/wire.ts:82
forwardSubagentText?booleanForwarded to --forward-subagent-text when true.src/batteries/llm/claude_code_cli/wire.ts:96
maxBudgetUsd?numberForwarded to --max-budget-usd.src/batteries/llm/claude_code_cli/wire.ts:80
maxTurns?numberIncluded only if a prior capability probe confirmed the running CLI supports --max-turns.src/batteries/llm/claude_code_cli/wire.ts:78
mcpToolIdleTimeoutMs?numberMapped to CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT on the grandchild's env, never a CLI flag.src/batteries/llm/claude_code_cli/wire.ts:92
model?stringThe model identifier, forwarded to --model.src/batteries/llm/claude_code_cli/wire.ts:64
promptstringThe fully-rendered history, as one -p positional prompt string.src/batteries/llm/claude_code_cli/wire.ts:60
type"run"Discriminant for the WrapperCommand union.src/batteries/llm/claude_code_cli/wire.ts:58
unsupportedResultMediaPolicystringGoverns how the adapter rendered an ADK tool-result's unsupported Media kind (or oversized inline SpooledArtifact) into the outbound WrapperToolCallResponseCommand — informational only, since the adapter has already applied the policy before this command is sent.src/batteries/llm/claude_code_cli/wire.ts:102