agents
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AgentDefinition clawd_code_sdk.models.agents User-facing agent definition configuration. |
||
| AgentInfo clawd_code_sdk.models.agents Information about an available subagent that can be invoked via the Agent tool. |
||
| AgentWireDefinition clawd_code_sdk.models.agents Wire-format agent definition matching the CLI control protocol. |
||
| ToolsPreset clawd_code_sdk.models.agents Tools preset configuration. |
🛈 DocStrings¶
Agent definitions and preset configurations.
AgentDefinition
¶
Bases: ClaudeCodeBaseModel
User-facing agent definition configuration.
Accepts ergonomic Python inputs (e.g. dict-style mcp_servers)
and converts to the wire format via to_wire().
Source code in src/clawd_code_sdk/models/agents.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | |
auto_compact_window
class-attribute
instance-attribute
¶
Token count at which this agent compacts its own conversation as a subagent.
Only lowers the inherited window. No effect on the main session agent.
background
class-attribute
instance-attribute
¶
Whether this agent runs in the background.
critical_system_reminder_experimental
class-attribute
instance-attribute
¶
critical_system_reminder_experimental: str | None = Field(
default=None, title="Critical System Reminder", alias="criticalSystemReminder_EXPERIMENTAL"
)
Critical system reminder message to display to the user.
description
class-attribute
instance-attribute
¶
A brief description of the agent's purpose.
disallowed_tools
class-attribute
instance-attribute
¶
disallowed_tools: list[ToolName | str] | None = Field(
default=None, title="Disallowed Tools", examples=["Bash"]
)
Tools this agent is not allowed to use.
effort
class-attribute
instance-attribute
¶
effort: ReasoningEffort | int | None = Field(
default=None, title="Reasoning effort", examples=["high"]
)
Effort level for thinking depth.
hooks
class-attribute
instance-attribute
¶
hooks: AgentHooksConfig | None = Field(default=None, title='Agent Hooks')
Hook configurations for this agent.
initial_prompt
class-attribute
instance-attribute
¶
Auto-submitted as the first user turn when this agent is the main thread agent.
Slash commands are processed. Prepended to any user-provided prompt.
isolation
class-attribute
instance-attribute
¶
isolation: Literal["worktree"] | None = Field(
default=None, title="Isolation Mode", examples=["worktree"]
)
Isolation mode. "worktree" runs the agent in a separate git worktree.
max_turns
class-attribute
instance-attribute
¶
Maximum number of agentic turns (API round-trips) before stopping.
mcp_servers
class-attribute
instance-attribute
¶
MCP servers for this agent.
Maps server names to configs. Use None as the value to reference
a server already configured in settings::
memory
class-attribute
instance-attribute
¶
memory: SettingSource | None = Field(
default=None, title="Agent Memory", examples=["user", "project"]
)
Persistent cross-session memory scope for this agent.
model
class-attribute
instance-attribute
¶
model: ModelName | Literal["inherit"] | str | None = Field(
default=None, title="Agent Model", examples=["sonnet"]
)
The model to use for this agent.
observer
class-attribute
instance-attribute
¶
Agent type(s) (comma-separated, max 4) auto-spawned as background observers.
observer_message
class-attribute
instance-attribute
¶
Supplemental postamble appended to each activity digest sent to the observer.
omit_claude_md
class-attribute
instance-attribute
¶
Run without user/project/local CLAUDE.md files when running as a subagent.
permission_mode
class-attribute
instance-attribute
¶
permission_mode: PermissionMode | None = Field(
default=None, title="Permission Mode", examples=["bypassPermissions"]
)
Permission mode for this agent.
prompt
class-attribute
instance-attribute
¶
The prompt to use for this agent.
skills
class-attribute
instance-attribute
¶
Skills this agent has.
tools
class-attribute
instance-attribute
¶
The tools this agent has access to.
to_wire
¶
Serialize to the wire-format dict for the CLI control protocol.
Converts dict-style mcp_servers to the array format the CLI expects:
{"git": config} -> [{"git": config}]
Returns a camelCase dict with None values excluded.
Source code in src/clawd_code_sdk/models/agents.py
to_wire_model
¶
to_wire_model() -> AgentWireDefinition
Serialize to the wire-format dict for the CLI control protocol.
Converts dict-style mcp_servers to the array format the CLI expects:
{"git": config} -> [{"git": config}]
Returns a camelCase dict with None values excluded.
Source code in src/clawd_code_sdk/models/agents.py
AgentInfo
¶
Bases: ClaudeCodeBaseModel
Information about an available subagent that can be invoked via the Agent tool.
Source code in src/clawd_code_sdk/models/agents.py
model
class-attribute
instance-attribute
¶
Model alias this agent uses. If omitted, inherits the parent's model.
AgentWireDefinition
¶
Bases: ClaudeCodeBaseModel
Wire-format agent definition matching the CLI control protocol.
This is the strict camelCase representation sent over the wire in the initialize request.
The CLI's public Zod schema (sdk.d.ts) only defines::
description, prompt, tools, disallowedTools, model, mcpServers,
criticalSystemReminder_EXPERIMENTAL, skills, maxTurns
However, the CLI's internal parse schema (Rff / parseAgentFromJson)
also accepts these additional fields, which are fully functional::
memory, background, hooks, effort, permissionMode, isolation