仓库 →

Subagents

When a task splits cleanly — parallel edits, mechanical repetition, or read-only investigation — the main agent can hand subtasks to short-lived subagents through the task tool. Each subagent runs in its own isolated context; the main agent keeps the cross-file reasoning and owns the final result. The task tool is on by default.

Two kinds of subagent

TypeWhat it can do
exploreRead-only investigation — reads and searches the codebase to answer a “where / how” question, then returns findings. Cannot edit files.
workerExecutes a tightly-specified change. Reads freely, but its writes are confined to a declared scope.

How they run

Worker scope & safety

A worker subtask must declare a scope: a list of working-directory-relative globs it is allowed to write, e.g. ["src/auth/**", "Cargo.toml"]. This is enforced, not advisory:

Configuration

Tune the subagent pool in ~/.atomcode/config.toml:

[subagent]
max_concurrent = 3     # parallel subagents at once (min 1)
max_rounds     = 0     # per-subtask model-round cap (0 = unbounded)

Child rounds are unlimited by default; existing explicit positive budgets are preserved. Set [subagent] max_rounds = 0 or ATOMCODE_SUBAGENT_MAX_ROUNDS=0 to remove an old 200-round limit. Positive budgets allow at most one extra text-only closing request. Concurrency, cancellation and repetition guards remain independent. External Codex/Claude agents retain their own execution policies.

KeyDefaultMeaning
max_concurrent3How many subagents run in parallel
max_rounds0Model-round high-water mark per subtask; 0 = unbounded

Environment overrides: ATOMCODE_SUBAGENT_MAX_ROUNDS take precedence over the config values.

Custom team roles

The team (team) picks members by role. Besides the built-in roles you can define your own as Markdown files in either of:

The file name (without .md) is the role's name. A file named like a built-in role replaces it; when both directories have a file of the same name, the one in your home directory wins.

A role file is a header of fields between --- lines, then the role's instructions:

---
permission: explore      # required: explore (looks, changes nothing) | worker (may edit files and run commands)
difficulty: hard         # required: simple (the fast model) | hard (the strong one)
effort: high             # optional: low | medium | high | xhigh | max
model: glm-4.6           # optional: a model selection id, overriding difficulty
when: designing systems  # optional: one line on when to hand it work
tools: read_file, grep   # optional: limit its tools, chosen from what permission allows
---
You design. Read the existing code first, then propose a design and its trade-offs.
FieldRequiredValues
permissionyesexplore (read-only investigation) or worker (scoped writes)
difficultyyessimple (fast model) or hard (strong model)
effortnolow / medium / high / xhigh / max
modelnoA model selection id; without it, chosen by difficulty
whennoOne line on when to hand this role work
toolsnoComma-separated tool names, a subset of what permission allows

Two things to note:

A role file that does not parse is skipped and the session starts anyway. You are told once per session which file was skipped and everything that is missing or wrong in it; a file named like a built-in role leaves the built-in in use.

Turning it off

The task tool is enabled by default. To remove it entirely, set:

ATOMCODE_SUBAGENT=0 atomcode

Any of 0, false, or off disables it; unset (or any other value) leaves it on.