Expand description
The data model shared by discovery, the TUI and the JSON output.
Structs§
- Agent
- A single row in the agent table.
- Cost
Breakdown - 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. - Host
Stats - 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. - Orphan
Origin - 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.
- Orphan
Parent - The agent an orphan used to belong to.
- Proc
Node - One process, with its descendants.
- Rate
Limit - 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. - Rate
Window - 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.
- Token
Usage - Token counts, split the way the Anthropic and OpenAI usage objects split them.
- Tool
Span - 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.
- Agent
State - Coarse lifecycle state, in the htop sense.
- Attribution
- Harness
- Which agent harness a process or transcript belongs to.
- McpMatch
- How an
McpServerrow was formed. - Price
Source - 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.
- Proc
Kind - Role of a process inside an agent’s tree.
- Span
Kind - 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
--jsondocument. Bumped when a field changes meaning or disappears; new fields alone do not bump it.