Documentation
¶
Overview ¶
Package workflows reads the dynamic workflows of a Claude Code conversation: a script the agent hands to its Workflow tool, which runs in the background and starts many subagents phase by phase. Claude Code keeps a run beside the conversation's own transcript:
<session>/workflows/scripts/<name>-<run>.js the script; its `meta` names the workflow and its phases <session>/subagents/workflows/<run>/journal.jsonl one line per agent started, returned or failed <session>/subagents/workflows/<run>/agent-<id>.jsonl and agent-<id>.meta.json, the agent's own transcript <session>/workflows/<run>.json the run's final state, written once it is over
The journal is read as it grows; the agents' files are read when they change.
Index ¶
Constants ¶
const ( Running = "running" Done = "done" Failed = "failed" Stopped = "stopped" )
States of a workflow's agent.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
ID string
Label string
Phase string // the title of the phase it was started in
Model string
State string
StartedAt float64
EndedAt float64
Last string // its last step, one line
Result string // the first words of what it returned
}
Agent is one agent a workflow started. Times are epoch milliseconds, 0 when unknown.
type Launch ¶
type Launch struct {
TaskID, RunID, Summary string
}
Launch is what the Workflow tool's result says of the run it started.
func ParseLaunch ¶
ParseLaunch reads a Workflow tool result; ok is false when it started no run in the background.
type Phase ¶
Phase is a stage of the workflow, as its script names it, with the agents started in it so far.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader keeps one cursor per run.