Documentation
¶
Overview ¶
Package claudecode adapts the Claude Code CLI (`claude -p ... stream-json`) to the executor's canonical events (ADR-0006 Decision 3). Translate is a pure per-line function; the fixtures in the test pin every mapping.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// ConfigDir, when non-empty, launches claude under this
// CLAUDE_CONFIG_DIR, selecting which profile (account, settings,
// credentials) the run uses. Empty inherits the parent environment.
// The provider name stays "claude-code" either way (SCHEMA.md R3):
// the profile changes who is logged in, not which tool ran.
ConfigDir string
// ExtraArgs are appended to every launch, after the per-request flags.
ExtraArgs []string
}
func (*Adapter) Command ¶
Command builds the headless launch. stream-json requires --verbose in print mode, or the CLI refuses to emit the stream.
--resume continues the thread (ADR-0022 Decision 2). Measured on claude 2.1.210: the resumed run replays no earlier turn — only the new one streams — so a chat's later turns add nothing to the ledger twice.