Subagents
Atomic bundles@bastani/subagents, an extension for running focused child agents with their own context. Use it when a task benefits from isolation, parallel investigation, background execution, or a specialist pass for locating code, analyzing behavior, researching references, debugging, or simplifying code.
You do not need to install anything separately when you use @bastani/atomic.
Start with natural language
Ask Atomic to coordinate subagents in plain language:subagent tool, which specialist fits each part, and whether the work should run as a single child, parallel group, chain, foreground run, or background run.
Bundled agents
Atomic currently bundles these agents from@bastani/subagents:
| Agent | Use it for | Edit files? |
|---|---|---|
codebase-locator | Find relevant files, directories, tests, configs, and docs for a topic. | No |
codebase-analyzer | Explain how specific code works and trace data flow with file references. | No |
codebase-pattern-finder | Find similar implementations, conventions, and test examples to model after. | No |
codebase-research-locator | Locate prior research/ and specs/ documents related to the task. | No |
codebase-research-analyzer | Extract decisions, constraints, and still-relevant conclusions from prior local docs. | No |
codebase-online-researcher | Research official docs, ecosystem behavior, and open-source source references online. | Can write research notes |
debugger | Reproduce, diagnose, and fix failures or unexpected behavior. | Yes |
code-simplifier | Clean up recently changed code while preserving behavior. | Yes |
debugger and code-simplifier can edit files, so run them with an explicit scope and validation target.
Review compositions
Atomic does not bundle a single generic review agent. Instead, compose specialists with distinct angles and let the parent session synthesize their findings before applying any fix. Common review angles:| Angle | Specialist pattern |
|---|---|
| Current behavior and regressions | codebase-analyzer inspects the changed flow and cites file/line evidence. |
| Failure modes | debugger runs in inspect-only mode to reproduce or reason about likely failures without editing. |
| Fit with project conventions | codebase-pattern-finder compares the patch with existing local examples. |
| Prior decisions | codebase-research-locator finds relevant docs, then codebase-research-analyzer extracts applicable constraints. |
| External API or library conformance | codebase-online-researcher checks authoritative sources and version-specific behavior. |
/parallel-review, /review-loop, /parallel-research, /parallel-context-build, /parallel-handoff-plan, and /parallel-cleanup. Treat them as reusable compositions, not as separate bundled agent names.
Background work and control
Foreground subagents stream progress in the conversation. Background subagents keep working after control returns to you and report completion later. Natural-language examples:interrupt when you want a resumable stop. Use resume to send a follow-up to a reachable async child, or to revive a completed child from its saved session when the run has enough metadata. Use doctor for read-only setup diagnostics.
Background runs are detached. If Atomic has no useful independent work while a background subagent runs, it should end the turn instead of polling in a loop; the run will notify the originating session when it completes.
Context and execution modes
Subagents can run with fresh or forked context:context: "fresh"starts a separate child with only the task and selected agent context.context: "fork"creates a real branched child session from the parent session leaf. It fails fast if the parent session cannot be forked; it does not silently downgrade to fresh context.
worktree: true can give each child an isolated git worktree so concurrent edits do not clobber each other.
Nested and fanout boundaries
Child-safety boundaries are enforced by the bundled subagent extension:- Normal child sessions do not receive the
subagenttool or the parent-only subagents skill. - Child context is filtered to remove parent orchestration artifacts, old control/status messages, and prior parent
subagenttool calls/results. - Non-fanout children are instructed that they are not the parent orchestrator and must not propose or run subagents.
- Nested fanout is available only for explicitly authorized agents whose resolved tools include
subagent. Authorized fanout children receive narrower instructions that limit delegation to the assigned fanout.
Custom agents
Custom agents are Markdown files with YAML frontmatter and a system prompt body. Common locations are:| Scope | Path |
|---|---|
| User | ~/.atomic/agent/agents/**/*.md |
| Project | .atomic/agents/**/*.md |
completionGuard: false sparingly. It opts a user-authored agent out of automatic completion-guard reminders and is intended for read-only agents whose prompt already prevents premature completion. Do not use it to bypass required implementation or validation work.
Fallback models
Agents can define orderedfallbackModels for retryable provider or model failures such as rate limits, quota/auth problems, unavailable models, network timeouts, or 5xx errors. Atomic tries the requested primary model first, then configured fallbacks, and finally appends the current user-selected model as the last fallback candidate when available.
Fallbacks do not retry ordinary task failures, validation failures, tool failures, cancellations, or workflow-code errors. Because a fallback may send the same prompt and context to a different provider, choose models that match your cost, privacy, and data-handling requirements.
Each candidate can also carry its own reasoning effort — see Reasoning levels.
Reasoning levels
Set the reasoning (thinking) effort for each model candidate with amodel_name:thinking_effort suffix on model and on every fallbackModels entry. Valid efforts are off, minimal, low, medium, high, and xhigh — the same shorthand used by atomic --model sonnet:high.
thinking field. The separate thinking: frontmatter field is deprecated. It still works as a default for any candidate that has no suffix, and a suffix always wins, but new agents should encode the effort directly on model and fallbackModels:
fallbackThinkingLevels exists only as an optional compatibility helper: it is aligned by index to fallbackModels and supplies a fallback candidate’s effort only when that fallback entry has no suffix. Prefer suffixed model strings instead. Attempt metadata reports the resolved model and the effective reasoning effort used for each attempt.