Skip to main content

Module model

Module model 

Source
Expand description

The data model shared by discovery, the TUI and the JSON output.

Structs§

Agent
A single row in the agent table.
CostBreakdown
USD by kind of token, accumulated message by message at each message’s own model price, so a session that changed model part way is still exact. The lines sum to Agent::cost_usd.
HostStats
McpServer
One MCP server an agent uses, seen from either side or both: the process table has the server’s pid, CPU and memory; the transcript has how often the agent called it. Claude Code names an MCP tool mcp__<server>__<tool>, which is where the server name and the call count come from.
OrphanOrigin
What the collector remembers about an orphaned MCP process: when it first saw it, and, if it watched the process lose its parent, which agent that was. Memory lasts for the run; a process that was already an orphan when agent-top started has no parent on record.
OrphanParent
The agent an orphan used to belong to.
ProcNode
One process, with its descendants.
RateLimit
What a harness reports about how close a session is to its rate limit. Only the harnesses that write it (Codex today) populate this; the rest leave it None. Read-only, like everything else: a number the harness already wrote.
RateWindow
One rolling usage window a harness reports against a rate limit: how much of it is spent and when it rolls over. Codex writes two, a short window and a long one, on every usage record.
Snapshot
Everything the UI needs for one frame.
TokenUsage
Token counts, split the way the Anthropic and OpenAI usage objects split them.
ToolSpan
One span of an agent trace: a tool call, an inference, or a turn.
Totals

Enums§

Activity
What the transcript says the agent was last doing. Harness-neutral.
AgentState
Coarse lifecycle state, in the htop sense.
Attribution
Harness
Which agent harness a process or transcript belongs to.
McpMatch
How an McpServer row was formed.
PriceSource
Where a model’s price came from. The built-in table carries list prices; a user’s file is whatever they chose to write, and the UI says which.
ProcKind
Role of a process inside an agent’s tree.
SpanKind
What a span measures. Tool calls came first and gave the type its name; the other two label the time between them.

Constants§

SNAPSHOT_SCHEMA_VERSION
Version of the --json document. Bumped when a field changes meaning or disappears; new fields alone do not bump it.