Before you begin
Confirm the following in your Atomic session before coordinating multi-step work:- Both
codemodeandsubagentare active (run/toolsto check). - For parallel edits in the same repository, your repository is a Git checkout so writers can run in isolated worktrees.
Start in plain language
For one-off tasks, give Atomic three things in chat: your goal, how to verify the result, and any limits on edits, cost, or time. Atomic can answer directly, run checks in codemode, or delegate independent jobs to subagents. For example, send this prompt to split a documentation check across two read-only reviewers:Launch now, use the result later
Three pieces work together when Atomic orchestrates multi-step work:- Main session: Decides what to run next and verifies final results.
- Subagent: A separate background session assigned one focused job, such as checking Linux installation steps.
- Codemode: Short JavaScript steps that call Atomic tools. One step can launch background jobs, and a later step can act on their results. Run
/toolsifcodemodeorsubagentisn’t available.
agent: The role assigned to the job.state: Whether the job started (admitted), is waiting for a slot (queued), or was rejected (refused, with areason).taskId: The handle shown in/tasksand passed towait.childId: The persistent subagent session ID used to pause, stop, or resume the subagent, including after reopening the main session.intercomTarget: The exact address other sessions use to message this subagent over Intercom.
/tasks or the agent panel, and confirm that every required subagent settles and passes your checks.
Rules for scripted orchestration
Follow these rules when writing codemode orchestration snippets:-
Batch parallel launches explicitly. Atomic doesn’t merge separate
tools.subagent()calls inside one script. Passtasks: [...]to run jobs in parallel. -
Wait on an existing
taskIdinstead of relaunching. When a later step needs a result immediately, passaction: "wait"withid(codemode rejects the legacyrunIdalias).budgetMssets the wait window in milliseconds (default30000ms; both2000and"2000"wait up to two seconds). Use a// @optionscomment to set per-script codemode options such astimeout_ms: - Keep delegation one level deep. Only the main session launches subagents. If a subagent finds follow-up work, it reports back so the main session can launch the next batch.
-
Coordinate peers through Intercom groups. Pass
group: trueto give a batch its own shared Intercom group, or reuse a namedgroupacross launches. Address each peer by its exactintercomTarget, not itstaskId. Keep independent reviewers ungrouped until each reaches an independent verdict. -
Track long runs with progress files. Pass
progress: trueto give a long-running writer an isolatedprogress.mdoutside your checkout. Progress notes help with handoffs, not as proof that checks passed. -
Stop subagents explicitly. Ending a wait or hitting a script timeout leaves launched subagents running. To stop a subagent, call
quitwith itschildId(bothpauseandquitreportresult.status: "paused"on settled non-released waits):Replace the following:CHILD_ID: ThechildIdvalue returned at launch (for examplea1b2c3d4:0).
What survives interruption
Subagents are saved sessions; codemode scripts aren’t checkpointed programs. If Atomic closes or restarts mid-run, know what survives:- Running subagents relaunch automatically. Reopening the original main session relaunches subagents that were running. Paused and quit subagents stay awaiting manual resume in
/tasksor throughtools.subagent({ action: "resume", id: "<childId>" })unless you changeresumeInFlightin subagentconfig.json. - Forks and unsaved sessions don’t restore subagents. Forking a session (
/forkor--fork) never restores the original session’s subagents. Sessions started with--no-sessionaren’t saved, so their subagents can’t be restored after exit. - Codemode store values persist per branch on success. Save small handoff state—task IDs, round counts, and next checks—with the codemode store.
store()writes persist only when the script finishes without throwing or timing out, even though admitted subagents keep running. - Reconcile before relaunching. After a restart, run
await tools.subagent({ action: "status" })and matchchildrenagainst storedchildIdvalues before starting new work. Collect settled results, resume paused work that is still needed, and inspect/tasks, chat, and modified files before repeating side effects.
Troubleshoot orchestration
The following table lists common issues when coordinating multi-step work and how to resolve them:Choose a pattern
Pick a coordination pattern that matches your task, or ask/skill:workflow to draft a reusable skill or migrate an earlier workflow:
Classify-and-act
Triage input with a read-only subagent, validate the label, then dispatch the matching specialist.
Fan-out-and-synthesize
Split a broad review or investigation across parallel subagents and reconcile their evidence.
Adversarial verification
Ask a fresh read-only subagent to find a concrete failing input against a candidate fix.
Generate-and-filter
Gather candidate inputs or cases from fresh subagents and filter them with a deterministic check.
Tournament
Compare competing implementations in isolated named worktrees against shared fixtures.
Loop-until-done
Run verification checks in the main session between bounded repair rounds.
Stacked slices
Branch each dependent slice from the verified commit of the previous slice.
Skills as workflows
Save repeatable multi-step instructions as a skill, or migrate legacy workflow files.