Skip to content

Agents and automation

This chapter documents the agent/task automation layer: custom agents, background agents, task tool constants, subagent lifecycle hooks, slash-command automation, ultrareview, and auto-mode.

Read this chapter when the question is: how does Claude Code delegate work, run subagents, or automate runtime behavior?

Source-anchor policy

This page is a chapter guide. Linked implementation pages carry concrete cli.js anchors.

Semantic aliasMinified anchorScope
Agents/automation chapterN/A — navigation pageGroups custom agents, background agents, task tools, subagent hooks, slash commands, and automation commands.
Agent implementation pagesSee linked source-anchor tablesConcrete bundle anchors live in destination pages.

Automation map

flowchart TD
Root[Root command] --> AgentsCmd[agents command]
Root --> AgentsFlag[--agents JSON]
Runtime[Session runtime] --> TaskTools[TaskCreate / TaskGet / TaskList / TaskUpdate]
Runtime --> Slash[slash commands]
Runtime --> Hooks[Subagent and task hooks]
AgentsFlag --> Custom[Custom agents]
AgentsCmd --> Background[Background agents]
TaskTools --> Subagents[Subagents / tasks]
Slash --> Automation[command automation]

Primary reading order

OrderPageAutomation question answered
1Agents, tasks, and subagentsWhich command/flag/tool/hook surfaces define custom agents, tasks, background agents, and hosted review, and how do TaskCreate/TaskGet/TaskList/TaskUpdate, subagent hooks, cron scheduling, and ultrareview preflight work?
2Agent runtime, scheduling, and completionHow are agent families designed, how are tasks scheduled, how is completion detected, and how do timed/cron tasks work?
3Slash commands and automationWhich slash-command, hook, skill, and auto-mode surfaces automate behavior around the main session?
4Agent and automation architectureHow are custom agents, tasks, slash commands, auto-mode, and hosted review orchestrated over the same runtime without parallel loops?

Handoffs

Created and maintained by Yingting Huang.