Documentation
¶
Overview ¶
Package claude is the Claude Code adapter: it starts sessions with claude -p and streamed JSON output, optionally under an id assigned by whoever starts them (--session-id, so the session keeps its log) or continuing one (--resume <id>, which works with -p, as claude --help shows, in the same directory the session ran in), and reads the result, the tokens and what the session cost from the stream. It warns when ANTHROPIC_API_KEY would take over the login, and names it when claude reports an invalid key. Its sessions' logs are read by claudelog.
Index ¶
Constants ¶
const Name = "claude-code"
Name is the agent's name as Physa records it.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Adapter ¶
type Adapter struct {
// Command is the claude command to run; empty means "claude" on PATH.
Command string
// Getenv reads the environment sessions inherit; nil means os.Getenv.
Getenv func(string) string
}
Adapter runs sessions with the Claude Code command.
func (*Adapter) Start ¶
Start runs claude -p in s.Dir with the prompt on stdin. An assigned session id that is not a UUID, and a resume without one, are refused before anything runs.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package claudelog is the Claude Code adapter's reader of session logs: it finds a session's transcript under Claude Code's config directory and returns what learning needs from it and its subagents, redacted, never writing anything there.
|
Package claudelog is the Claude Code adapter's reader of session logs: it finds a session's transcript under Claude Code's config directory and returns what learning needs from it and its subagents, redacted, never writing anything there. |