Skip to main content

claude_code_rs/types/
agents.rs

1use serde::{Deserialize, Serialize};
2
3/// Definition of a sub-agent that Claude can delegate to.
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct AgentDefinition {
6    /// Unique name for this agent.
7    pub name: String,
8
9    /// Description of what this agent does.
10    pub description: String,
11
12    /// System prompt for the agent.
13    #[serde(default, skip_serializing_if = "Option::is_none")]
14    pub system_prompt: Option<String>,
15
16    /// Tools allowed for this agent.
17    #[serde(default, skip_serializing_if = "Vec::is_empty")]
18    pub allowed_tools: Vec<String>,
19
20    /// Model to use for this agent (overrides default).
21    #[serde(default, skip_serializing_if = "Option::is_none")]
22    pub model: Option<String>,
23}