Documentation
¶
Overview ¶
Package subagents lists the subagents of a Claude Code conversation: the transcripts Claude Code writes next to the conversation's own (<session>/subagents/agent-<id>.jsonl, with an agent-<id>.meta.json), each summed up the way the previous runtime's inspector showed it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var FileName = regexp.MustCompile(`^agent-[\w-]+\.jsonl$`)
FileName matches a subagent transcript's file name.
Functions ¶
Types ¶
type Lister ¶
type Lister struct {
// Now is the clock (tests freeze it); nil is the real one.
Now func() time.Time
// contains filtered or unexported fields
}
Lister lists subagents, keeping each settled summary until its transcript changes.
type Paths ¶
type Paths struct {
ClaudeProjects, CodexSessions string
}
Paths are where the agents keep their transcripts: only a jsonl under one of them may be read.
type Route ¶
type Route struct {
Lister *Lister
Paths Paths
// Authorized is the old API's own check (a page session or the cli-token), SessionOK the page session the handler
// asks for besides.
Authorized, SessionOK func(*http.Request) bool
}
Route answers GET <platform API>/subagents?jsonlPath=<transcript>: the subagents of a Claude conversation; a Codex one has none ({subagents: [], supported: false}).
func (*Route) AnswerTranscript ¶
AnswerTranscript answers GET <platform API>/subagents/<id>?jsonlPath=<transcript>: the entries of one subagent's transcript, flattened (every line of it is a sidechain, which the parser folds into one agent group).
type Summary ¶
type Summary struct {
ID string `json:"id"`
AgentType any `json:"agentType"`
Description any `json:"description"`
ToolUseID any `json:"toolUseId"`
Background bool `json:"background"`
Status string `json:"status"`
StartedAt any `json:"startedAt"`
UpdatedAt float64 `json:"updatedAt"`
ToolUses int `json:"toolUses"`
LastAction any `json:"lastAction"`
Prompt string `json:"prompt"`
Result any `json:"result"`
}
Summary is one subagent as the inspector lists it. The fields taken from the meta file keep the value found there.