Optionaloptions: BaseAdapterOptionsReadonlynameCLI name
Protected ReadonlyparserProtected ReadonlyloggerProtectedcapacityProtectedinitializedProtected OptionallastProtected OptionalcachedReadonlytransportTransport type
Protected ReadonlytransientTransient-error retry config. Override in subclass to enable.
Gets the capability profile for this CLI.
Gets Claude model information.
buildModelInfo matches cliModelName, cliAlias, and aliases[] —
a single call handles 'opus', 'sonnet', 'haiku', current model names,
and the legacy claude-opus-4 / claude-haiku-3 / etc. entries that
live in the registry's aliases since #2200 Child 1.
Truly unrecognized models fall through to conservative defaults (current Opus pricing).
ProtectedgetGets CLI command and arguments for execution. Uses stdin for the prompt to avoid argument escaping issues, especially important when using --add-dir.
ProtectedinitInitializes the capacity tracker. Called by subclasses after name is set.
Executes a task with error handling and retries.
Timeout priority (highest to lowest):
Optionaloptions: CliExecutionOptionsPerforms a health check.
Gets CLI version.
Gets current capacity status based on tracked usage. Uses usage-based tracking since CLI subprocess execution doesn't expose HTTP rate limit headers.
ProtectedrecordProtectedparseParses version from CLI output.
ProtectedcheckProtectedgetGets version status message.
ProtectedcreateCreates a CLI error.
Optionalcause: ErrorProtectednormalizeNormalizes CLI response to common format.
Optionalusage: CliTokenUsageOptionalextra: Partial<CliResponse>ProtecteddelayDelays for the specified milliseconds.
Executes a task via subprocess, with optional transient-error retry.
When transientRetry.enabled is true, transient errors (timeout,
rate_limit, connection, parse) are retried with exponential backoff
(500ms, 1000ms). Parse errors get max 1 retry (#1533); others get 2.
Initializes the adapter and capacity tracker.
Disposes the adapter (no-op for subprocess).
Claude CLI adapter using subprocess transport. Executes: claude -p --output-format json ""