pub struct SubagentResult {
pub status: Option<String>,
pub prompt: Option<String>,
pub agent_id: Option<String>,
pub agent_type: Option<String>,
pub content: Vec<ContentBlock>,
pub resolved_model: Option<String>,
pub total_duration_ms: Option<u64>,
pub total_tokens: Option<u64>,
pub total_tool_use_count: Option<u64>,
pub usage: Option<UsageInfo>,
pub tool_stats: Option<SubagentToolStats>,
}Expand description
Token, timing, and tool-use accounting for a completed subagent (Task) run.
The Claude CLI echoes this object in the tool_use_result of a Task tool’s
result message. It is the typed source of truth for subagent token
attribution: the per-run total_tokens,
total_duration_ms, and
total_tool_use_count correspond to the
subagent_tokens / duration_ms / tool_uses line items the CLI renders in
its human-readable <usage> block, and usage carries the
full per-model token breakdown for the run.
Fields§
§status: Option<String>Completion status of the subagent run (e.g. "completed").
prompt: Option<String>The prompt the subagent was launched with.
agent_id: Option<String>Stable identifier of the spawned subagent.
agent_type: Option<String>Subagent type that ran (e.g. general-purpose, Explore).
content: Vec<ContentBlock>Final content blocks the subagent returned.
resolved_model: Option<String>Model the subagent actually resolved to (e.g. claude-sonnet-4-6).
total_duration_ms: Option<u64>Wall-clock duration of the subagent run, in milliseconds.
total_tokens: Option<u64>Total tokens consumed by the subagent — the subagent_tokens rollup line.
total_tool_use_count: Option<u64>Number of tool invocations the subagent made.
usage: Option<UsageInfo>Detailed token / cache usage for the subagent run.
tool_stats: Option<SubagentToolStats>Per-category tool-use counts, present for some agent types (e.g. Explore).
Trait Implementations§
Source§impl Clone for SubagentResult
impl Clone for SubagentResult
Source§fn clone(&self) -> SubagentResult
fn clone(&self) -> SubagentResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more