Built-in agents
Subagents return results to the main agent rather than talking directly to the user. Roles with command execution can perform writes, subject to tool permissions.
The subagent tool
single, parallel, and chain
Authorize delegation in natural language:
Background tasks
The subagent tool acceptsrun_in_background. A background task returns a channel ID immediately and posts a notification with a summary, usage, and the sub-session path when it finishes. The Step Code process must remain running while tasks are active.
agent_send operates on background tasks by channel ID:
Background tasks are limited to 8 concurrent channels and stop automatically after 10 minutes idle. Only the 16 most recent finished tasks are kept; the sub-session paths of older tasks are in their completion notifications.
To run every subagent task in the foreground, set
[subagent] background = false in config.toml; see Configuration files.
Workflow and ultraloop
Workflow executes JavaScript orchestration in a sandbox VM without network or filesystem access. Primitives includephase(), parallel(), pipeline(), agent(), and iterate(). Run records are stored in .stepcode/workflows/runs/ and support resuming. Use /workflows to inspect saved workflows and recent runs.
ultraloop or ultracode, or enable session-level authorization with /ultraloop on and disable it with /ultraloop off. Single-message authorization does not carry forward and is not inferred from task size.
STEP_DISABLE_WORKFLOW=1 disables registration.
See Common use cases for examples of multi-agent tasks.
/ultracode [on|off|status|help] manages multi-agent collaboration, with /ultraloop as an alias; /workflows shows workflows and run records. The switch persists per session: restoring the same session restores its state, and a new session without saved state defaults to off.
Custom agents
Use Markdown frontmatter for metadata and the body for system instructions:tools accepts an array or comma-separated list. Include project roles explicitly with agentScope: "both" when calling the tool, and confirm when prompted.
See Agent Skills for defining specialized workflows.
See Plugins and packages for distributing agents through plugins.
Context isolation and safety
The sandbox VM restricts only the workflow orchestration script. Subtask processes remain subject to OS permissions.- Subagents have independent context and token usage; the main agent primarily receives summaries.
- Subagents may share the main agent’s working directory, so file changes affect the same working tree.
- Assign disjoint files for parallel writes, or explicitly arrange separate Git worktrees.
- Worktrees isolate working trees, not access to other directories, networks, or credentials.
- Review diffs and tests before integrating results. Do not clean up unmerged work blindly.

