claudecode

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 New

func New() *Adapter

func (*Adapter) Command

func (a *Adapter) Command(req executor.Request) (string, []string, []string)

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.

func (*Adapter) Name

func (a *Adapter) Name() string

func (*Adapter) Translate

func (a *Adapter) Translate(line []byte) ([]executor.Event, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL