@bastani/atomic 0.10.14 → 0.10.15-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +1 -1
  3. package/dist/_shared/dist-KOELCESV.js +2 -2
  4. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  5. package/dist/_shared/lib-4PES5P4V.js +2 -2
  6. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
  7. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
  8. package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
  9. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  10. package/dist/_shared/runtime-O4KCSG4C.js +2 -2
  11. package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
  12. package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
  13. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  14. package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
  15. package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
  16. package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
  17. package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
  18. package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
  19. package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
  20. package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
  21. package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
  22. package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
  23. package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
  24. package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
  25. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  26. package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
  27. package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
  28. package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
  29. package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
  30. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  31. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  32. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  33. package/dist/builtin/intercom/package.json +1 -1
  34. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  35. package/dist/builtin/mcp/package.json +1 -1
  36. package/dist/builtin/subagents/package.json +1 -1
  37. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  38. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  39. package/dist/builtin/web-access/package.json +1 -1
  40. package/dist/cli/auth-cli.code.js +1 -1
  41. package/dist/cli/auth-cli.impl.js +3 -3
  42. package/dist/cli/auth-cli.js +3 -3
  43. package/dist/cli/blueprint-command.impl.js +3 -3
  44. package/dist/cli/blueprint-command.js +3 -3
  45. package/dist/cli/intercom-command.code.js +3 -3
  46. package/dist/cli/intercom-command.impl.js +3 -3
  47. package/dist/cli/intercom-command.js +3 -3
  48. package/dist/cli/list-models.impl.js +3 -3
  49. package/dist/cli/list-models.js +3 -3
  50. package/dist/cli/session-picker.code.js +1 -1
  51. package/dist/cli/session-picker.impl.js +3 -3
  52. package/dist/cli/session-picker.js +3 -3
  53. package/dist/cli/startup-ui.code.js +1 -1
  54. package/dist/cli/startup-ui.impl.js +3 -3
  55. package/dist/cli/startup-ui.js +3 -3
  56. package/dist/cli/storage-command.impl.js +3 -3
  57. package/dist/cli/storage-command.js +3 -3
  58. package/dist/cli/storage-search-session.code.js +1 -1
  59. package/dist/cli/storage-search-session.impl.js +3 -3
  60. package/dist/cli/storage-search-session.js +3 -3
  61. package/dist/cli/team-command.code.js +1 -1
  62. package/dist/cli/team-command.impl.js +3 -3
  63. package/dist/cli/team-command.js +3 -3
  64. package/dist/cli.js +2 -2
  65. package/dist/core/compaction/compactor.d.ts +0 -8
  66. package/dist/core/debug.impl.js +3 -3
  67. package/dist/core/debug.js +3 -3
  68. package/dist/core/export-html/card-projection.impl.js +3 -3
  69. package/dist/core/export-html/card-projection.js +3 -3
  70. package/dist/core/export-html/index.code.js +2 -2
  71. package/dist/core/export-html/index.impl.js +3 -3
  72. package/dist/core/export-html/index.js +3 -3
  73. package/dist/core/export-html/json-spans.impl.js +3 -3
  74. package/dist/core/export-html/json-spans.js +3 -3
  75. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  76. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  77. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  78. package/dist/core/export-html/tool-renderer.js +3 -3
  79. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  80. package/dist/core/extensions/jiti-loader.js +3 -3
  81. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  82. package/dist/core/extensions/jiti-static-loader.js +3 -3
  83. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  84. package/dist/core/extensions/loader-host-modules.js +3 -3
  85. package/dist/core/intercom-broker-control-host.code.js +1 -1
  86. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  87. package/dist/core/intercom-broker-control-host.js +3 -3
  88. package/dist/core/intercom-broker-control.code.js +2 -2
  89. package/dist/core/intercom-broker-control.impl.js +3 -3
  90. package/dist/core/intercom-broker-control.js +3 -3
  91. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  92. package/dist/core/package-manager-storage-adapters.js +3 -3
  93. package/dist/core/sdk.code.js +1 -1
  94. package/dist/core/sdk.impl.js +3 -3
  95. package/dist/core/sdk.js +3 -3
  96. package/dist/core/session-manager-core.js +3 -3
  97. package/dist/core/session-manager-list.impl.js +3 -3
  98. package/dist/core/session-manager-list.js +3 -3
  99. package/dist/core/session-manager.impl.js +3 -3
  100. package/dist/core/session-manager.js +3 -3
  101. package/dist/core/session-storage.impl.js +3 -3
  102. package/dist/core/session-storage.js +3 -3
  103. package/dist/core/storage/index.js +2 -2
  104. package/dist/core/storage/node-sqlite-thread.js +2 -2
  105. package/dist/core/storage/node-sqlite.js +2 -2
  106. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  107. package/dist/core/storage/offline-snapshot-file.js +3 -3
  108. package/dist/core/storage/provider.js +2 -2
  109. package/dist/core/storage/selection.js +2 -2
  110. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  111. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  112. package/dist/core/storage/session/branch-fork-source.js +3 -3
  113. package/dist/core/storage/session/card-view.impl.js +3 -3
  114. package/dist/core/storage/session/card-view.js +3 -3
  115. package/dist/core/storage/session/child-reader.code.js +2 -2
  116. package/dist/core/storage/session/child-reader.impl.js +3 -3
  117. package/dist/core/storage/session/child-reader.js +3 -3
  118. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  119. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  120. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  121. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  122. package/dist/core/storage/session/expanded-child-details.js +3 -3
  123. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  124. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  125. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  126. package/dist/core/storage/session/fork-row-index.js +3 -3
  127. package/dist/core/storage/session/fork-staging.code.js +1 -1
  128. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  129. package/dist/core/storage/session/fork-staging.js +3 -3
  130. package/dist/core/storage/session/fork-window.code.js +2 -2
  131. package/dist/core/storage/session/fork-window.impl.js +3 -3
  132. package/dist/core/storage/session/fork-window.js +3 -3
  133. package/dist/core/storage/session/history-pages.impl.js +3 -3
  134. package/dist/core/storage/session/history-pages.js +3 -3
  135. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  136. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  137. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  138. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  139. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  140. package/dist/core/storage/session/memory-session-store.js +3 -3
  141. package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
  142. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  143. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  144. package/dist/core/storage/session/released-history-files.code.js +1 -1
  145. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  146. package/dist/core/storage/session/released-history-files.js +3 -3
  147. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  148. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  149. package/dist/core/storage/session/session-resume.impl.js +3 -3
  150. package/dist/core/storage/session/session-resume.js +3 -3
  151. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  152. package/dist/core/storage/session/snapshot-cut.js +3 -3
  153. package/dist/core/storage/session/snapshot-history.code.js +2 -2
  154. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  155. package/dist/core/storage/session/snapshot-history.js +3 -3
  156. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  157. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  158. package/dist/core/storage/session/sql-session-store.js +3 -3
  159. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  160. package/dist/core/storage/session/tree-outline.js +3 -3
  161. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  162. package/dist/core/storage/session/tree-presentation.js +3 -3
  163. package/dist/core/storage/storage-status.impl.js +3 -3
  164. package/dist/core/storage/storage-status.js +3 -3
  165. package/dist/core/storage/team.impl.js +3 -3
  166. package/dist/core/storage/team.js +3 -3
  167. package/dist/core/structured-output/index.code.js +1 -1
  168. package/dist/core/structured-output/index.impl.js +3 -3
  169. package/dist/core/structured-output/index.js +3 -3
  170. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  171. package/dist/core/tasks/task-completion-entry.js +3 -3
  172. package/dist/core/tasks/task-file-history.code.js +2 -2
  173. package/dist/core/tasks/task-file-history.impl.js +3 -3
  174. package/dist/core/tasks/task-file-history.js +3 -3
  175. package/dist/core/tasks/task-reference-archive.code.js +2 -2
  176. package/dist/core/tasks/task-reference-archive.js +3 -3
  177. package/dist/core/tasks/task-reference-identity.js +3 -3
  178. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  179. package/dist/core/tasks/task-reference-stream.js +3 -3
  180. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  181. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  182. package/dist/core/tasks/task-view-source.impl.js +3 -3
  183. package/dist/core/tasks/task-view-source.js +3 -3
  184. package/dist/core/tools/read-url.impl.js +3 -3
  185. package/dist/core/tools/read-url.js +3 -3
  186. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  187. package/dist/core/worktree-snapshot/errors.code.js +1 -1
  188. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  189. package/dist/core/worktree-snapshot/errors.js +3 -3
  190. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  191. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  192. package/dist/extensions/codemode/execute.impl.js +3 -3
  193. package/dist/extensions/codemode/execute.js +3 -3
  194. package/dist/extensions/codemode/renderer.impl.js +3 -3
  195. package/dist/extensions/codemode/renderer.js +3 -3
  196. package/dist/extensions/mcp/cli.code.js +1 -1
  197. package/dist/extensions/mcp/cli.impl.js +3 -3
  198. package/dist/extensions/mcp/cli.js +3 -3
  199. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  200. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  201. package/dist/extensions/mcp/cli.lazy.js +3 -3
  202. package/dist/extensions/mcp/runtime.code.js +1 -1
  203. package/dist/extensions/mcp/runtime.impl.js +3 -3
  204. package/dist/extensions/mcp/runtime.js +3 -3
  205. package/dist/index.d.ts +21 -1
  206. package/dist/index.js +2 -2
  207. package/dist/main-first-time-setup.code.js +1 -1
  208. package/dist/main-first-time-setup.impl.js +3 -3
  209. package/dist/main-first-time-setup.js +3 -3
  210. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  211. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  212. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  213. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  214. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  215. package/dist/modes/print-mode.js +1 -1
  216. package/dist/package-manager-cli.code.js +2 -2
  217. package/dist/package-manager-cli.impl.js +3 -3
  218. package/dist/package-manager-cli.js +3 -3
  219. package/dist/startup-files.json +1 -1
  220. package/dist/startup-stages/6.js +1 -1
  221. package/dist/utils/startup-database-spare.code.js +1 -1
  222. package/dist/utils/startup-database-spare.impl.js +3 -3
  223. package/dist/utils/startup-database-spare.js +3 -3
  224. package/dist/utils/tools-manager.impl.js +3 -3
  225. package/dist/utils/tools-manager.js +3 -3
  226. package/docs/background-tasks/reference.md +182 -0
  227. package/docs/background-tasks.md +98 -405
  228. package/docs/build.md +67 -27
  229. package/docs/changelog.mdx +11 -1
  230. package/docs/codemode.md +108 -39
  231. package/docs/compaction/branch-summaries.md +54 -0
  232. package/docs/compaction/custom-compactors.md +161 -0
  233. package/docs/compaction/memory-compaction.md +77 -0
  234. package/docs/compaction/reference.md +86 -38
  235. package/docs/compaction.md +51 -252
  236. package/docs/computer-use.md +169 -321
  237. package/docs/containerization.md +71 -57
  238. package/docs/custom-provider/api-reference.md +119 -25
  239. package/docs/custom-provider/oauth.md +114 -132
  240. package/docs/custom-provider/override.md +37 -27
  241. package/docs/custom-provider/registration.md +107 -83
  242. package/docs/custom-provider/streaming.md +85 -71
  243. package/docs/custom-provider.md +85 -52
  244. package/docs/development.md +39 -29
  245. package/docs/docs.json +80 -67
  246. package/docs/environment-variables.md +94 -44
  247. package/docs/extensions/api-reference.md +86 -43
  248. package/docs/extensions/authoring.md +162 -154
  249. package/docs/extensions/events.md +80 -25
  250. package/docs/extensions/examples.md +90 -85
  251. package/docs/extensions/ui.md +206 -82
  252. package/docs/extensions.md +79 -108
  253. package/docs/getting-started/authentication.md +67 -36
  254. package/docs/getting-started/first-session.md +53 -43
  255. package/docs/getting-started/installation.md +117 -90
  256. package/docs/getting-started/project-instructions.md +48 -34
  257. package/docs/guides/configuration.md +82 -20
  258. package/docs/guides/non-interactive.md +66 -24
  259. package/docs/guides/resume-on-any-machine.md +135 -82
  260. package/docs/guides/team-setup.md +114 -105
  261. package/docs/guides.md +76 -32
  262. package/docs/herdr.md +16 -17
  263. package/docs/how-atomic-works.md +140 -0
  264. package/docs/index.md +58 -44
  265. package/docs/intercom/operations.md +141 -151
  266. package/docs/intercom/reference.md +85 -108
  267. package/docs/intercom.md +84 -145
  268. package/docs/json.md +120 -67
  269. package/docs/keybindings.md +85 -49
  270. package/docs/libraries/agent-core.md +137 -275
  271. package/docs/libraries/ai.md +100 -84
  272. package/docs/libraries/codemode.md +210 -300
  273. package/docs/libraries/schema.md +59 -53
  274. package/docs/libraries/storage-postgres.md +49 -35
  275. package/docs/libraries/telemetry.md +153 -354
  276. package/docs/libraries/tui.md +265 -393
  277. package/docs/libraries.md +42 -26
  278. package/docs/llama-cpp.md +171 -161
  279. package/docs/mcp-servers.md +90 -51
  280. package/docs/models/choose-a-model.md +188 -0
  281. package/docs/models/reference.md +74 -30
  282. package/docs/models.md +153 -88
  283. package/docs/orchestration/migrating-workflows.md +23 -16
  284. package/docs/orchestration/patterns.md +39 -44
  285. package/docs/orchestration.md +65 -26
  286. package/docs/packages/authoring.md +51 -29
  287. package/docs/packages/reference.md +42 -21
  288. package/docs/packages.md +69 -58
  289. package/docs/programmatic.md +118 -24
  290. package/docs/prompt-templates.md +84 -83
  291. package/docs/providers/reference.md +43 -48
  292. package/docs/providers.md +219 -451
  293. package/docs/quickstart.md +140 -120
  294. package/docs/reference/cli.md +135 -97
  295. package/docs/reference.md +20 -19
  296. package/docs/rpc/examples.md +76 -20
  297. package/docs/rpc/extension-ui.md +64 -38
  298. package/docs/rpc/protocol.md +361 -110
  299. package/docs/rpc.md +57 -17
  300. package/docs/sdk/reference.md +409 -534
  301. package/docs/sdk/storage.md +53 -13
  302. package/docs/sdk/structured-decisions.md +82 -56
  303. package/docs/sdk/web-server.md +57 -43
  304. package/docs/sdk.md +106 -84
  305. package/docs/security.md +42 -64
  306. package/docs/session-format.md +62 -38
  307. package/docs/sessions.md +99 -214
  308. package/docs/settings.md +165 -195
  309. package/docs/shell-aliases.md +9 -6
  310. package/docs/skills/authoring.md +69 -48
  311. package/docs/skills/reference.md +51 -20
  312. package/docs/skills.md +99 -148
  313. package/docs/slash-commands.md +129 -0
  314. package/docs/storage/custom-adapters.md +160 -85
  315. package/docs/storage/jsonl.md +81 -66
  316. package/docs/storage/postgres/pgbouncer.md +120 -126
  317. package/docs/storage/postgres/tuning.md +120 -143
  318. package/docs/storage/postgres.md +314 -330
  319. package/docs/storage/sqlite.md +71 -42
  320. package/docs/storage.md +298 -302
  321. package/docs/subagents/authoring.md +55 -38
  322. package/docs/subagents/reference.md +73 -33
  323. package/docs/subagents.md +119 -187
  324. package/docs/terminal-setup.md +51 -39
  325. package/docs/themes/reference.md +23 -19
  326. package/docs/themes.md +142 -127
  327. package/docs/tmux.md +47 -55
  328. package/docs/tools.md +147 -109
  329. package/docs/tui/reference.md +166 -214
  330. package/docs/tui.md +196 -341
  331. package/docs/usage.md +118 -138
  332. package/docs/verification.md +79 -51
  333. package/docs/web-access.md +121 -101
  334. package/docs/windows.md +26 -27
  335. package/docs/worktree-snapshots/reference.md +245 -0
  336. package/docs/worktree-snapshots.md +71 -259
  337. package/package.json +8 -8
  338. package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
  339. package/docs/guides/intercom.md +0 -32
  340. package/docs/guides/orchestration.md +0 -28
  341. package/docs/guides/subagents.md +0 -37
  342. package/docs/termux.md +0 -118
package/docs/subagents.md CHANGED
@@ -1,18 +1,20 @@
1
1
  ---
2
2
  title: "Run subagents"
3
- sidebarTitle: "Subagents guide"
4
- description: "Launch bundled or custom subagents in the background, isolate edits in Git worktrees, and control running tasks."
3
+ sidebarTitle: "Run subagents"
4
+ description: "Delegate bounded work to bundled or custom subagents in the background, isolate edits in Git worktrees, and control running tasks."
5
5
  ---
6
6
 
7
- Subagents let your main chat delegate bounded work to specialist agents running in separate sessions. No separate package installation is required.
7
+ A subagent is a separate agent session that your main session launches for a focused task. It runs in its own context window in the background, so long code searches, debugging traces, or parallel edits do not crowd out your main conversation. No separate package installation is required.
8
8
 
9
- When to delegate:
10
-
11
- - Delegate independent research, analysis, debugging, or parallel implementation work that can overlap with other steps.
12
- - Keep interactive, exploratory, or immediately blocking tasks in your main chat unless specialist focus or context isolation adds value.
13
- - Every subagent runs in the background. Let completion notices report back instead of polling, and call `subagent({ action: "wait", id })` only when the next step depends on a subagent's result.
9
+ | What you want | Use this |
10
+ | --- | --- |
11
+ | Quick, interactive, or immediately blocking work | Keep it in your main chat |
12
+ | Focused research, diff review, or debugging in isolation | Delegate to a `fresh`-context subagent |
13
+ | Implementation that builds on decisions from the current chat | Delegate to `worker` (uses `fork` context by default) |
14
+ | Parallel edits without file conflicts | Launch a parallel `tasks` batch with `worktree: true` or named `worktree: { branch }` |
15
+ | Multi-step coordination or custom skills | Launch subagents from [codemode scripts](#from-codemode-scripts) ([Orchestration](/orchestration)) |
14
16
 
15
- New to subagents? Start with [Subagents overview](/guides/subagents). See [Manage background tasks](/background-tasks) for the agent panel, `/tasks`, shell output, cancellation, and completion notices. For defining custom agents, see [Create custom subagents](/subagents/authoring). For discovery precedence, fallback chains, and configuration keys, see [Subagent reference](/subagents/reference). For embedding subagents in an app, see [Subagent children in the SDK](/sdk#subagent-children).
17
+ Every subagent runs in the background. Let completion notices report back instead of polling, and call `subagent({ action: "wait", id })` only when your next step depends on a subagent's result.
16
18
 
17
19
  ## Start with natural language
18
20
 
@@ -30,7 +32,7 @@ Run a parallel review: one pass for current behavior, one for failure modes, and
30
32
  Research the upstream library behavior online, then compare it with our local implementation.
31
33
  ```
32
34
 
33
- Atomic chooses the specialist and execution shape (single subagent, parallel batch, or forked context). For multi-step coordination, your main session can also launch subagents from [codemode scripts](#from-codemode-scripts).
35
+ Atomic chooses the specialist and execution shape (single subagent, parallel batch, or forked context).
34
36
 
35
37
  ## Bundled agents
36
38
 
@@ -41,23 +43,23 @@ Atomic chooses the specialist and execution shape (single subagent, parallel bat
41
43
  | `codebase-pattern-finder` | Find similar implementations, conventions, and test patterns. | `fresh` | No |
42
44
  | `codebase-research-locator` | Find related `research/` and `specs/` documents. | `fresh` | No |
43
45
  | `codebase-research-analyzer` | Extract decisions and active constraints from local docs. | `fresh` | No |
44
- | `codebase-online-researcher` | Research official docs, libraries, and open-source code online. | `fresh` | Research notes only (no `edit`/`write` tools) |
46
+ | `codebase-online-researcher` | Research official docs, libraries, and open-source code online (includes `bash` for CLI/cached research notes; no `edit`/`write` tools). | `fresh` | Research notes only |
45
47
  | `debugger` | Reproduce a failure, prove root cause, apply the minimal fix, and validate it. | `fresh` | Yes |
46
48
  | `code-simplifier` | Simplify recent changes while preserving behavior. | `fresh` | Yes |
47
49
  | `worker` | Implement an approved task, validate the change, and escalate scope decisions. | `fork` | Yes |
48
50
 
49
- All bundled agents use `model: "auto"` with no pinned fallback chain. Pin a role via `subagents.agentOverrides.<name>.model` in `settings.json` or a per-call `model` argument. A concrete `model` runs only that model plus the agent's own `fallbackModels` (see [Fallback models](/subagents/reference#fallback-models)).
51
+ All bundled agents use `model: "auto"` with no pinned fallback chain. Pin a role persistently via `subagents.agentOverrides.<name>.model` in `settings.json` or per call with `model`. A concrete `model` runs only that model plus the agent's own `fallbackModels` (see [Fallback models](/subagents/reference#fallback-models)).
50
52
 
51
- The `worker` agent also enables `defaultProgress: true` (isolated run-scoped `progress.md`), sets `inheritProjectContext: true`, sets `inheritSkills: false`, and loads the `tdd`, `agent-browser`, and `tmux` skills.
53
+ Bundled skills are preloaded by role: `worker`, `debugger`, `code-simplifier`, and `codebase-analyzer` load `tdd`, `agent-browser`, and `tmux`, while `codebase-online-researcher` loads `agent-browser`. `worker` also enables `defaultProgress: true` (isolated run-scoped `progress.md`), `inheritProjectContext: true`, and `inheritSkills: false`.
52
54
 
53
55
  ### Browse agents with `/agents`
54
56
 
55
- Run `/agents` (or `/agents <query>`) in an interactive session to inspect available agents, grouped in precedence order: **Project**, **User**, **Built-in**, and **Package**. Outside interactive mode, run `subagent({ action: "list" })`.
57
+ Run `/agents` (or `/agents <query>`) in an interactive session to inspect active agents grouped in precedence order: **Project**, **User**, **Built-in**, and **Package**.
56
58
 
57
- - Type to filter by name, description, or source. Select an agent and press `Enter` to view its model, fallbacks, default context, tools, file path, and system prompt.
59
+ - Type to filter by name, description, or source. Select an agent and press `Enter` to inspect its model, fallbacks, default context, tools, file path, and system prompt.
58
60
  - Press `Esc` to return to the list, then back to chat.
59
61
 
60
- `/agents` is read-only and never launches or edits agents. It applies the same discovery rules as execution, so shadowed or disabled definitions are hidden. Leaving `/agents` open never marks [Herdr](/herdr) as blocked.
62
+ `/agents` is read-only, never launches or edits agents, and hides shadowed or disabled definitions so it matches execution precedence. Outside interactive mode, call `subagent({ action: "list" })` (note that `action: "list"` hides overridden package agents but still lists shadowed user or built-in definitions alongside project overrides). Leaving `/agents` open never marks [Herdr](/herdr) as blocked.
61
63
 
62
64
  ### Review compositions
63
65
 
@@ -80,17 +82,17 @@ Review the current diff with fresh-context specialists: analyze correctness, ins
80
82
  ### Fresh vs. forked context
81
83
 
82
84
  - **`context: "fresh"`** starts an isolated child session containing only the agent's prompt and task. Use `fresh` for adversarial reviews and independent research.
83
- - **`context: "fork"`** branches from your main session's latest settled turn and fails fast if the main session cannot be forked (it never downgrades silently to `fresh`). A forked subagent inherits the main session's model, thinking level, active tool changes, and saved tool outputs without taking ownership of the main session's other subagents or replaying Intercom cards.
85
+ - **`context: "fork"`** branches from your main session's latest settled turn and fails fast if the main session cannot be forked (for example, an empty session with no settled entry before the current turn — it never downgrades silently to `fresh`). A forked subagent inherits the main session's model, thinking level, active tool changes, and saved tool outputs without taking ownership of the main session's other subagents or replaying Intercom cards.
84
86
 
85
87
  <Warning>
86
88
  When you omit `context` on a parallel `tasks` batch, adding **any** agent with `defaultContext: fork` (such as `worker`) causes the **entire batch** to run in forked context. Pass `context: "fresh"` explicitly if you want fresh-context siblings alongside `worker`, or launch `worker` in a separate call.
87
89
  </Warning>
88
90
 
89
- Use `fork` when a subagent needs the main conversation's decisions and context. A forked subagent sends the exact conversation prefix the main session last sent (system prompt, project context, skills, tools, and messages), followed by its own role, a short handoff note, and its task. When it runs on the main session's same model and thinking level, the first request reads from the main session's prompt cache and pays only for the new suffix. On another model or provider it does not share that cache, and on another thinking level it may share only part of it.
91
+ Use `fork` when a subagent needs the main conversation's decisions and context. A forked subagent sends the exact conversation prefix the main session last sent (system prompt, project context, skills, tools, and messages), followed by its own role, a short handoff note, and its task. When it runs on the same model and thinking level, the first request reads from the main session's prompt cache and pays only for the new suffix. On another model or provider it does not share that cache, and on another thinking level it may share only part of it.
90
92
 
91
- In a fork, `inheritProjectContext` and `inheritSkills` do not hide what the main session already sent; those frontmatter flags apply to fresh subagents. The subagent's own tool allowlist still applies: calling a tool outside its allowed list fails with an error naming the allowed tools. Where the provider supports mid-conversation tool changes, removed or child-only tools are declared after the main conversation; otherwise child-only tools run through `codemode` restricted strictly to the subagent's own tools.
93
+ In a fork, `inheritProjectContext` and `inheritSkills` do not hide what the main session already sent; those flags apply to `fresh` subagents. The subagent's own tool allowlist still applies: calling a tool outside its allowed list fails with an error naming the allowed tools, and child-only tools not available directly run through `codemode` restricted strictly to the subagent's own tools.
92
94
 
93
- Fresh subagents inherit the main session's model registry, authentication, and workspace discovery settings. A subagent's tool list can narrow permissions, but it cannot re-enable tools or packages excluded by the main session. See [Subagent children in the SDK](/sdk#subagent-children) for programmatic child configuration.
95
+ Fresh subagents inherit the main session's model registry, authentication, and workspace discovery settings. A subagent's tool list can narrow permissions, never widen them beyond the main session.
94
96
 
95
97
  ### Temporary worktrees
96
98
 
@@ -108,15 +110,15 @@ subagent({
108
110
 
109
111
  Key rules for `worktree: true`:
110
112
 
111
- - **Parallel mode only.** `worktree: true` creates temporary isolated worktrees only for parallel `tasks: [...]` runs (or multiple single-agent calls combined in one assistant message). On a standalone single-agent `{ agent, task }` call, `worktree: true` has no effect and the subagent runs in the main checkout; use `worktree: { branch }` for an isolated single-agent worktree.
113
+ - **Parallel mode only.** Creates isolated worktrees only for parallel `tasks: [...]` runs (or multiple single-agent calls emitted in one assistant message). On a standalone single-agent `{ agent, task }` call, `worktree: true` has no effect; use `worktree: { branch }` for an isolated single-agent worktree.
112
114
  - **Clean tracked working tree required.** Launch fails before starting any subagent if tracked files have staged or unstaged edits (`git status --porcelain --untracked-files=no`). Untracked files do not block launch.
113
- - **Base branch.** Temporary worktrees branch from `origin/<default-branch>` (fetching if needed) and fall back to `HEAD` only if no origin default branch is found, rather than branching from your current local `HEAD`.
114
- - **Automatic post-creation setup.** After creating each temporary worktree, Atomic automatically copies `.atomic/settings.local.json` and any untracked `.atomic/settings.json`, configures Git `core.hooksPath` to share `.husky` or `.git/hooks`, symlinks (or creates a junction on Windows for) `node_modules`, copies gitignored files listed in `.worktreeinclude`, and runs `worktreeSetupHook` if configured in [config.json](/subagents/reference#subagent-config-json-reference).
115
- - **No per-task `cwd` overrides.** All tasks in a `worktree: true` batch must share the same `cwd`; per-task `cwd` overrides that differ from the shared `cwd` are rejected.
116
- - **Patch capture and cleanup.** Once every subagent in the batch finishes, Atomic saves each subagent's changes as a patch under `worktree-diffs/<run-id>` and removes the temporary worktrees and branches. If capturing a worktree's patch fails, Atomic keeps that worktree on disk and reports it in the diff summary so changes are not lost.
117
- - **Paused, quit, and cancelled subagents.** Paused, quit, or session-closed subagents keep their temporary worktree only if it has uncommitted changes, untracked files, or new commits. Clean worktrees are removed; `resume` recreates them from base plus the saved patch and writes later patches as `task-<n>-<agent>.<execution>.patch`. Permanently cancelled subagents release their worktrees, and unresumed stopped worktrees with changes remain under `.atomic/worktrees/`.
118
- - **Waiting on cleanup.** `pause`, `quit`, completion, and failed resume wait for Git cleanup. Pressing `Esc` stops waiting without cancelling cleanup; cleanup taking over 10 seconds warns and continues in the background. Never delete a worktree directory while `worktreeNote` reports pending cleanup or a sibling hold, or after a crash without checking for orphaned Git processes.
119
- - **Git hook integration.** Git filters and hooks can check `ATOMIC_SUBAGENT_WORKTREE_PHASE=finishing` during teardown. Extension authors can also subscribe to `subagent:finishing`; see [Subagent reference](/subagents/reference#sdk-integration-and-errors).
115
+ - **Base branch.** Temporary worktrees branch from `origin/<default-branch>` (fetching if needed), falling back to `HEAD` only if no origin default branch exists.
116
+ - **Automatic post-creation setup.** After creating each temporary worktree, Atomic copies `.atomic/settings.local.json` and any untracked `.atomic/settings.json`, shares `.husky` or `.git/hooks` via `core.hooksPath`, symlinks (or creates a junction on Windows for) `node_modules`, copies gitignored files listed in `.worktreeinclude`, and runs `worktreeSetupHook` if configured in [config.json](/subagents/reference#subagent-config-json-reference).
117
+ - **Shared `cwd`.** All tasks in a `worktree: true` batch must share the same `cwd`; differing per-task `cwd` overrides are rejected.
118
+ - **Patch capture and cleanup.** Once every subagent in the batch finishes, Atomic saves each subagent's changes as a patch under `worktree-diffs/<run-id>` and removes the temporary worktrees and branches. If patch capture fails for a worktree, Atomic keeps that worktree on disk and reports it in the diff summary.
119
+ - **Paused, quit, and cancelled subagents.** Paused, quit, or session-closed subagents keep their temporary worktree only if it has uncommitted changes, untracked files, or new commits. Clean worktrees are removed; `resume` recreates them from base plus the saved patch (`task-<n>-<agent>.<execution>.patch`). Permanently cancelled subagents release their worktrees, while unresumed stopped worktrees with changes remain under `.atomic/worktrees/`.
120
+ - **Waiting on cleanup.** `pause`, `quit`, completion, and failed resume wait for Git cleanup (`Esc` stops waiting without cancelling cleanup; cleanup over 10 seconds warns and continues in the background). Never delete a worktree directory while cleanup is still finishing, a sibling holds the batch, or an orphaned Git process is still running.
121
+ - **Git hook integration.** Git hooks can check `ATOMIC_SUBAGENT_WORKTREE_PHASE=finishing` during teardown, and extensions can subscribe to `subagent:finishing` ([Subagent reference](/subagents/reference#sdk-integration-and-errors)).
120
122
 
121
123
  ### Named worktrees
122
124
 
@@ -134,17 +136,21 @@ subagent({
134
136
 
135
137
  How named worktrees differ from temporary worktrees:
136
138
 
137
- - **No clean-tree requirement and no automatic post-setup.** Named worktrees work with dirty local checkouts and do not symlink `node_modules`, copy settings or `.worktreeinclude` files, set `core.hooksPath`, run `worktreeSetupHook`, or save diff patches.
139
+ - **No clean-tree requirement and no automatic post-setup.** Named worktrees work with dirty local checkouts and do not symlink `node_modules`, copy settings or `.worktreeinclude` files, configure `core.hooksPath`, run `worktreeSetupHook`, or save diff patches.
138
140
  - **Permanent ownership.** Atomic never deletes a named worktree or its branch. Resuming reuses the worktree or checks the branch back out there if removed.
139
- - **Branch and path rules.** `path` defaults to `.atomic/worktrees/<branch>` (`/` replaced with `+`); relative paths resolve against the caller's `cwd`, and an existing empty directory at `path` is allowed. New branches use `--no-track` and start from `base` (resolved in the caller's worktree), then the current branch's upstream (`@{upstream}`), then `HEAD`. Branch names are validated with `git check-ref-format --branch` and cannot contain `@{`. Unused existing branches check out as-is, and a branch already checked out at `path` is reused. Launch fails fast if the branch is checked out elsewhere or `path` holds something else.
140
- - **Subdirectory `cwd`.** If your session runs inside a repository subdirectory, the subagent starts in that same subdirectory inside the worktree (falling back to the worktree root if that subdirectory does not exist on the branch).
141
- - **Concurrency, locks, and recovery.** Different branches and paths run concurrently. Duplicate `(branch, path)` launches wait and reuse; the same branch at a different path fails after the first finishes. Prefer `worktree: { ... }` over running `git worktree add` in the same turn, which can race with sibling tool calls. External `index.lock` files or initializing worktrees time out after 30 seconds (`another git process seems to be running at <path>`). Interrupted previous checkouts fail immediately (`an interrupted named-worktree checkout left an incomplete worktree at <path>`); on Git 2.30 to 2.32, they report busy after 30 seconds. To recover an incomplete checkout, confirm no Git process is running, save needed files, run `git worktree unlock <path>`, remove the directory, run `git worktree prune`, and clear stale `HEAD.lock` or branch `.lock` files (or run `git worktree remove --force --force <path>`). Never fix a partial checkout by deleting only `index.lock`.
141
+ - **Branch and path rules.** `path` defaults to `.atomic/worktrees/<branch>` (`/` replaced with `+`); relative paths resolve against the caller's `cwd`, and an existing empty directory at `path` is allowed. New branches use `--no-track` and start from `base`, then `@{upstream}`, then `HEAD`. Unused existing branches check out as-is, and a branch already checked out at `path` is reused. Launch fails fast if the branch is checked out elsewhere or `path` holds something else.
142
+ - **Subdirectory `cwd`.** If your session runs inside a repository subdirectory, the subagent starts in that same subdirectory inside the worktree (falling back to the worktree root if absent on the branch).
143
+ - **Concurrency and hooks.** Different branches and paths run concurrently; duplicate `(branch, path)` launches wait and reuse, while the same branch at a different path fails after the first finishes. A checkout hook cannot synchronously create another named worktree for the same branch or path (`WorktreeReentryError`). Prefer `worktree: { ... }` over running `git worktree add` alongside subagents in the same turn.
144
+
145
+ <Note>
146
+ **Recovering an interrupted named-worktree checkout.** External Git locks time out after 30 seconds (`another git process seems to be running at <path>`), and an interrupted prior checkout fails immediately (`an interrupted named-worktree checkout left an incomplete worktree at <path>`). To recover, confirm no Git process is running, back up any needed files, run `git worktree unlock <path>`, remove the directory, run `git worktree prune`, and clear stale `HEAD.lock` or branch `.lock` files (or run `git worktree remove --force --force <path>`). Never fix a partial checkout by deleting only `index.lock`.
147
+ </Note>
142
148
 
143
149
  ## Background launches and waiting
144
150
 
145
- Every `subagent` launch runs in the background without interactive preview prompts and returns immediately with each subagent's `taskId` and `intercomTarget` (for example `subagent-worker-1a2b3c4d-1`). Use `intercomTarget` verbatim when messaging a subagent. Legacy calls that pass `wait` still run in the background, and `wait: { kind: "foreground" }` adds a note pointing to `action: "wait"`.
151
+ Every `subagent` launch runs in the background and returns immediately with each subagent's `taskId` and `intercomTarget` (for example `subagent-worker-1a2b3c4d-1`). Use `intercomTarget` verbatim when messaging a subagent.
146
152
 
147
- Subagents return their results directly. Atomic does not infer acceptance gates or parse `acceptance-report` blocks, so write required tests, commands, or evidence checks directly in the task prompt.
153
+ Subagents return their results directly. Atomic does not infer acceptance gates, so put required tests, commands, or evidence checks directly in the task prompt.
148
154
 
149
155
  ```ts
150
156
  subagent({ agent: "codebase-analyzer", task: "Trace the auth flow with file references." })
@@ -152,27 +158,27 @@ subagent({ action: "wait", id: "<taskId>", budgetMs: 120000 })
152
158
  subagent({ action: "status", id: "<taskId>" })
153
159
  ```
154
160
 
155
- - **Waiting.** `subagent({ action: "wait", id: taskId, budgetMs? })` observes an existing task launched by this session up to `budgetMs` (default `tasks.wait.agentBudgetMs`, `30000` ms). Ending a wait on budget or pressing `Esc` leaves the subagent running. Wait for completion before depending on its result. See [Choose how long to wait](/background-tasks#choose-how-long-to-wait).
156
- - **Repeating tasks with `count`.** In parallel `tasks`, set `count` (integer `>= 1`) on a task item to repeat it N times with the same settings. Expanded items count toward `parallel.maxTasks`.
157
- - **Concurrency.** Multiple single-agent launches in one turn share `concurrency` (or the configured parallel limit). Returning from launch or ending a wait does not free a running slot.
158
- - **Heartbeats.** Running subagents send [task heartbeats](/background-tasks#task-heartbeats) every 15 minutes by default, reporting current tool, idle time, turns, tool calls, and tokens. Override with `heartbeatMs` on the call or task entry (`0` disables).
159
- - **Files, progress, and output.** Pass `reads` (single-agent or per-task) to prepend file contents resolved relative to the child's `cwd`. Pass `output` (path or `false`) and `outputMode` (`"inline"` default, or `"file-only"`, which requires an `output` path; duplicate `output` paths in a parallel batch are rejected). Pass `progress: true` to enable an isolated run-scoped `progress.md` under artifact storage (never inside child `cwd` or the repository; omitted inherits the agent's `defaultProgress`, suppressed for read-only tasks unless `progress: true`). Separate `includeProgress: true` adds runtime progress telemetry to the tool result.
160
- - **Settled output.** `wait` and `status` return up to 16 KB inline, plus `Full output: <path>` (Atomic keeps the 256 most recent copies in a private temp directory and cleans them on exit) and `Requested output:` when `output` was set. With `outputMode: "file-only"`, only the saved-file reference returns inline.
161
- - **Yielding to user or Intercom.** User steering (`input-needed`) or an inbound Intercom message (`intercom-coordination`) yields active `wait` calls so the main session can respond without cancelling running or queued subagents. Wait again afterward if you still need the result.
162
- - **Startup progress and retries.** Before a subagent's first turn, `status` reports its exact startup step (`opening its session`, `loading its resources`, `waiting for a resource-admission permit` while waiting for a session slot, `creating its agent session`, `registering on Intercom`, or `dispatching its task`) with elapsed time. If startup exceeds `sessionStartTimeoutMs` (default 5 minutes), Atomic marks the attempt stalled and retries once after releasing its session. If a stalled attempt still holds its session after half the budget (capped at 30 seconds), it fails without retrying. Two stalled attempts fail with `Subagent did not start: its start stalled <step> after <N>s and was retried once; the retry stalled <step> after <M>s`.
163
- - **Session close and reopen.** Closing a session stops running subagents. Reopening it automatically restores running subagents from their saved sessions.
161
+ - **Waiting.** `subagent({ action: "wait", id: taskId, budgetMs? })` observes an existing task launched by this session up to `budgetMs` (default `30000` ms). Ending a wait on budget, pressing `Esc`, user steering (`input-needed`), or an inbound Intercom message (`intercom-coordination`) leaves the subagent running. Wait again when you need its result. See [Observation and wait matrix](/background-tasks/reference#choose-how-long-to-wait).
162
+ - **Repeating tasks (`count`).** In parallel `tasks`, set `count` (integer `>= 1`) on an item to repeat it N times. Expanded items count toward `parallel.maxTasks`.
163
+ - **Concurrency.** Multiple single-agent launches emitted in one assistant message combine into one parallel run sharing `concurrency` (shared options must match across those calls; prefer one explicit `{ tasks: [...] }` call). Returning from launch or ending a wait does not free a running slot.
164
+ - **Heartbeats.** Running subagents send [task heartbeats](/background-tasks#task-heartbeats) every 15 minutes by default. Override with `heartbeatMs` (`0` disables; minimum `60000` ms).
165
+ - **Read directives (`reads`).** `reads` does **not** inline file contents; it prepends `[Read from: <abs-path>, ...]` (resolved relative to child `cwd`) to the prompt so the subagent reads those files with its own tools. In single-agent mode, pass an array of paths or `false` (`reads: true` is rejected, and frontmatter `defaultReads` is not applied). In parallel `tasks[]`, omitting `reads` or passing `reads: true` uses the agent's `defaultReads`, and `reads: false` disables it.
166
+ - **Output files (`output` / `outputMode`).** When `output` is set, Atomic injects `**Output:** Write your findings to: <path>`. If the subagent creates or modifies that file, Atomic reads it back; otherwise Atomic writes the subagent's final assistant text to that path (creating parent directories). Pass `output: true` to use the agent's frontmatter `output` default, or `output: false` (or `"false"`) to disable it. `outputMode: "file-only"` requires an `output` path and returns only the saved-file reference inline on success (failed runs or save errors still return inline details). Duplicate `output` paths in a parallel batch are rejected.
167
+ - **Progress tracking (`progress` / `includeProgress`).** `progress: true` enables an isolated run-scoped `progress.md` under artifact storage (never inside child `cwd` or the repository). When omitted, Atomic inherits the agent's `defaultProgress`, suppressing it automatically if the prompt text uses read-only phrasing (such as `review-only`, `no edits`, `do not edit`, or `leave files unchanged`). `includeProgress: true` only adds progress telemetry on direct blocking runs without a background task host; standard background launches return at admission.
168
+ - **Settled output.** `wait` and `status` return up to 16 KB inline, plus `Full output: <path>` (Atomic keeps the 256 most recent copies in a private temp directory and cleans them on exit) and `Requested output:` when `output` was set.
169
+ - **Startup progress and retries.** Before a subagent's first turn, `status` reports its exact startup step (`opening its session`, `loading its resources`, waiting for a concurrent session-startup slot, `creating its agent session`, `registering on Intercom`, or `dispatching its task`) with elapsed time. If startup exceeds `sessionStartTimeoutMs` (default 5 minutes), Atomic marks the attempt stalled and retries once after releasing its session (failing without retry if the stalled attempt still holds its session after half the budget, capped at 30 seconds).
170
+ - **Session close and reopen.** Closing a session stops running subagents; reopening the same session automatically restores them.
164
171
 
165
172
  ### Task inspection
166
173
 
167
- Use `/tasks` (or `/tasks <id>`) or the agent panel below the prompt (`↓` on an empty prompt) to inspect running, waiting, and finished subagents and their nested shells.
174
+ Use `/tasks` (or `/tasks <id>`) or the agent panel below the prompt (`↓` on an empty prompt) to inspect running, waiting, and finished subagents and their nested shells:
168
175
 
169
- - **Switch to a subagent.** Select a subagent row and press `Enter` (or click it) to view its live transcript and message it on the same chat screen. Press `←` on an empty prompt or select `main` in the panel to return without interrupting the subagent.
170
- - **Pause or stop.** While viewing a working subagent, press `Esc` (or `Ctrl+C` on an empty prompt) to pause its active turn without affecting main chat. In `/tasks` or the agent panel, press `x` twice within 3 seconds to stop a running task resumably (red `◯` stopped mark), or `x` once to dismiss a finished row.
171
- - **Subagent shells and hints.** A subagent's running shells nest underneath it in the agent panel. On a subagent's page in `/tasks`, backgrounded shell blocks show a clickable `· /tasks to manage` hint that opens that subagent's own task list. While viewing a released subagent waiting on a shell, the newest waited shell shows a clickable `· alt+w opens it` hint.
172
- - **Questions in subagents.** A subagent's `ask_user_question` or extension dialog waits inside that subagent's transcript (**Needs input**) without blocking the main chat. SDK hosts without a task inspector route `humanInput` by `sessionId` ([Human input without a terminal](/sdk#human-input-without-a-terminal)).
173
- - **Launch cards and status history.** Each subagent renders `Agent(<agent> · <short task title>)` with state, active elapsed time, and tokens (`Ctrl+O` expands prompt, tool calls, and result). Live progress, `/tasks`, and `status` show the resolved model and clamped reasoning effort. Atomic keeps live status for the 256 most recently finished runs plus all active runs; older subagents remain resumable via `subagent({ action: "resume", id })`.
176
+ - **Switch to a subagent.** Select a subagent row and press `Enter` (or click it) to view its live transcript and message it on the shared chat screen. Press `←` on an empty prompt or select `main` in the panel to return without interrupting the subagent.
177
+ - **Pause or stop.** While viewing a working subagent, press `Esc` (or `Ctrl+C` on an empty prompt) to pause its active turn without affecting main chat. In `/tasks` or the agent panel, press `x` twice within 3 seconds to stop a running task resumably, or `x` once to dismiss a finished row.
178
+ - **Subagent shells and questions.** A subagent's running shells nest beneath it in the agent panel, and a subagent's `ask_user_question` or extension dialogs wait inside its own transcript (**Needs input**) without blocking the main chat.
179
+ - **Launch cards and history.** Each subagent renders `Agent(<agent> · <short task title>)` (`Ctrl+O` expands prompt, tool calls, and result). Atomic keeps live status for the 256 most recently finished runs plus all active runs; older subagents remain resumable via `subagent({ action: "resume", id })`.
174
180
 
175
- See [Manage background tasks](/background-tasks), [Viewing a subagent](/background-tasks#viewing-a-subagent), and [Shells started by subagents](/background-tasks#shells-started-by-subagents) for the full panel layout, key bindings, command-routing table, and `/tasks` controls.
181
+ See [Manage background tasks](/background-tasks) and [Background tasks reference](/background-tasks/reference) for the full panel layout, key bindings, slash-command routing, and `/tasks` controls.
176
182
 
177
183
  ### Run control
178
184
 
@@ -186,67 +192,60 @@ subagent({ action: "quit", all: true }) // Covers running and already-
186
192
  subagent({ action: "resume", id: "<child-id>", message: "Focus on the failing test first." })
187
193
  ```
188
194
 
189
- - **`pause`.** Stops the active turn and keeps queued steering or follow-up messages to deliver once in order before `resume`'s `message`. Intercom messages to a paused subagent do not resume it; they wait with no time limit and reach it after `resume`'s `message`.
190
- - **`quit`.** Stops the subagent gracefully, including paused subagents, while keeping it resumable.
191
- - **Awaiting resume.** Paused and quit subagents report `paused · awaiting resume` or `quit · awaiting resume` with `Stop reason: pause` or `quit` and the exact `subagent({ action: "resume", id: "<child-id>" })` call. `status` lists them under **Awaiting resume** across restarts without auto-relaunching. Completed and failed notices state that execution ended and also provide the `resume` call and Intercom name.
192
- - **Queued parallel subagents.** You can `pause` or `quit` a subagent still waiting for a concurrency slot. `resume` starts it with its original task, optional `message`, model, thinking level, worktree, and fork copy, and re-enters the concurrency queue. If its original model or fork copy no longer exists, `resume` reports it as gone instead of substituting silently.
193
- - **`resume`.** Continues the subagent's saved session under the same child ID, Intercom name, and group with fresh supervisor authorization (`all: true` is not supported). For paused, quit, or interrupted subagents, `message` runs before continuing. For completed or failed subagents, `message` starts a fresh turn. Omitting `message` prompts the subagent to continue or stop if done.
194
- - **Resumable vs. terminal.** Paused, quit, interrupted, completed, failed, and session-closed subagents are resumable. **Killed** (explicit cancellation) and **Gone** (unrestorable after restart) subagents are terminal and reject `resume`. Running subagents also reject `resume` (`<agent> (<child-id>, <intercom-name>) is already running as task <task-id>; pause or quit it first.`); use Intercom to message a running subagent. Failed resumes preserve `worktree: true` checkouts.
195
- - **Interrupting control calls.** Pressing `Esc` stops waiting on `pause`, `quit`, or `resume`. Stops already requested still complete, while unstarted resumes cancel cleanly.
196
- - **Removed actions.** `kill` and `interrupt` were removed. Calls fail and direct you to `{ action: "quit", id }`:
197
-
198
- ```text
199
- The subagent action "kill" was removed. Use { action: "quit", id } to stop a child gracefully; it stays resumable with { action: "resume", id, message? }.
200
- ```
195
+ - **`pause`.** Stops the active turn and keeps queued steering or follow-up messages to deliver once in order before `resume`'s `message`. Intercom messages to a paused subagent do not resume it; they wait without expiry and arrive after `resume`'s `message`.
196
+ - **`quit`.** Stops the subagent gracefully, including already-paused subagents, while keeping it resumable.
197
+ - **Awaiting resume.** Completion notices report `paused · awaiting resume` or `quit · awaiting resume` with `Stop reason: pause` or `quit` and the exact `resume` call. `subagent({ action: "status" })` lists them under **Awaiting resume** across restarts as `paused · awaiting resume` or `quit · paused · awaiting resume` without auto-relaunching.
198
+ - **Queued parallel subagents.** You can `pause` or `quit` a subagent still waiting for a concurrency slot. `resume` starts it with its original task, optional `message`, model, thinking level, worktree, and fork copy, re-entering the concurrency queue (or reporting it gone if its model or fork copy no longer exists).
199
+ - **`resume`.** Continues the subagent's saved session under the same child ID, Intercom name, and group (`all: true` is not supported). For paused, quit, or interrupted subagents, `message` runs before continuing; for completed or failed subagents, `message` starts a fresh turn. Omitting `message` prompts the subagent to continue or stop if done.
200
+ - **Resumable vs. terminal.** Paused, quit, interrupted, completed, failed, and session-closed subagents are resumable. **Killed** (explicit cancellation) and **Gone** (unrestorable after restart) subagents are terminal and reject `resume`. Running subagents reject `resume` (`pause` or `quit` them first, or message them via Intercom). Failed resumes preserve `worktree: true` checkouts.
201
+ - **Interrupting control calls.** Pressing `Esc` stops waiting on `pause`, `quit`, or `resume` (already-requested stops finish; unstarted resumes cancel cleanly).
202
+ - **Removed actions.** `kill` and `interrupt` were removed; calls fail and point to `{ action: "quit", id }`.
201
203
 
202
204
  #### Messages that resume a finished subagent
203
205
 
204
- Any session allowed to message a subagent under ordinary Intercom group and reach rules can wake it. A single-target `intercom` `send` or `ask` to a completed or failed subagent returns immediately with `queued: true`, and the launching session resumes the subagent to handle the message (an `ask` receives its reply later as a message). Calling `subagent({ action: "resume", id: "<intercom-name>", message })` for a subagent launched by another session sends `message` through that same wake queue.
206
+ Any session allowed to message a subagent under Intercom group and reach rules can wake it. A single-target `intercom` `send` or `ask` to a completed or failed subagent returns immediately with `queued: true`, and the launching session resumes the subagent to handle the message. Calling `subagent({ action: "resume", id: "<intercom-name>", message })` for a subagent launched by another session sends `message` through that same wake queue.
205
207
 
206
- Messages to a paused or quit subagent wait in a durable queue without resuming it until the launching session continues it. The launching session always keeps ownership of the resumed subagent, its `/tasks` row, and its controls. Message-triggered resumes are bounded to 6 resumes in 10 minutes and chain depth 4. See [Messages that resume a finished subagent](/intercom/reference#messages-that-resume-a-finished-subagent) and [Subagents with no live session](/intercom/reference#subagents-with-no-live-session) for full queue limits and refusal rules.
208
+ Messages to a paused or quit subagent wait in a durable queue without resuming it until the launching session continues it. Message-triggered resumes are bounded to 6 resumes in 10 minutes and chain depth 4. See [Messages that resume a finished subagent](/intercom/reference#messages-that-resume-a-finished-subagent).
207
209
 
208
210
  ### Released subagents
209
211
 
210
- A background subagent that waits more than 1 minute on a `detachable: true` tool call, a budgetless shell `wait`, an `intercom` `ask`, or a blocking `contact_supervisor` (`need_decision` or `interview_request`) is **released**. The waited operation keeps running while the subagent releases its session resources and wakes automatically when the result arrives.
212
+ A background subagent that waits more than 1 minute on a long-running detachable external tool call (for example, a CI run or deployment tool marked detachable), a budgetless shell `wait`, an `intercom` `ask`, or a blocking `contact_supervisor` (`need_decision` or `interview_request`) is **released**. The waited operation keeps running while the subagent frees its session resources and wakes automatically when the result arrives.
211
213
 
212
- - **What you see.** Your main chat shows a dim notice that does not trigger a model turn (`◌ <name> is waiting on <tool> (<call id>)`). `/tasks`, the agent panel, and the launch card list it under **Waiting** with `◌` and `waiting on <tool>`. `subagent({ action: "status" })` reports `released · waiting on <tool> (<call id>)`.
213
- - **Late results and continuation notes.** If something else wakes the subagent first, the waited call returns as still running; when its result (or a subagent background shell) arrives later, a notice card delivers it once inside the subagent's chat. Whenever Atomic continues a subagent automatically, the subagent receives a short continuation note (`Continuing after Atomic restarted`, `Continuing where it left off`, or `Woken: what it waited for arrived`).
214
- - **Inspecting, waking, or holding.** Viewing a released subagent displays its saved transcript without waking it; press `Alt+W` (`app.tasks.openWaited`) or click `· alt+w opens it` to open its newest waited shell in `/tasks`. Sending a message in its view, sending an Intercom `send`/`ask`, or calling `resume` wakes it immediately. Pressing `x` twice or calling `pause` or `quit` stops auto-wake and holds arriving results until you `resume`.
215
- - **Active waits and crash recovery.** Any parent `action: "wait"` yields and reports the subagent released. Queued steering, follow-up, and Intercom messages persist before wake so nothing is lost on crash. Open Intercom asks stay open across local and [multi-node Intercom routing](/intercom/operations#running-intercom-across-machines). On reopen after restart, detachable tool calls restart with the same call IDs and arguments (mark only idempotent tools `detachable: true`); local Intercom asks time out while multi-node database asks stay alive. At most `parallel.runningCapacity` released subagents wake concurrently.
214
+ - **What you see.** Main chat shows a dim notice (`◌ <name> is waiting on <tool> (<call id>)`) without starting a model turn. `/tasks`, the agent panel, and the launch card list it under **Waiting** with `◌`. `subagent({ action: "status" })` reports `released · waiting on <tool> (<call id>)`.
215
+ - **Inspecting, waking, or holding.** Viewing a released subagent opens its saved transcript without waking it; press `Alt+W` (or click `· alt+w opens it`) to inspect its newest waited shell in `/tasks`. Sending a message in its view, sending an Intercom `send`/`ask`, or calling `resume` wakes it immediately. Pressing `x` twice or calling `pause` or `quit` stops auto-wake and holds arriving results until you `resume`.
216
+ - **Late results and crash recovery.** If something else wakes the subagent first, the waited call returns as still running and its late result arrives later as a notice card inside the subagent's chat. Queued messages persist before wake so nothing is lost on crash. On reopen after restart, detachable external calls re-run with the same call IDs and arguments; local Intercom asks time out while multi-node database asks stay open. At most `parallel.runningCapacity` released subagents wake concurrently.
216
217
 
217
- For the typed `ReleasedChildError` codes reported when tracking or waking a released subagent fails, see [SDK integration and errors](/subagents/reference#sdk-integration-and-errors).
218
+ For the troubleshooting codes reported when tracking or waking a released subagent fails, see [Released subagent error codes](/subagents/reference#sdk-integration-and-errors).
218
219
 
219
220
  ### Automatic restore and session storage
220
221
 
221
- If Atomic exits, crashes, or you switch sessions (`/new`, `/resume`, `/fork`), running subagents stay resumable and relaunch automatically when you reopen the launching session. They keep their Intercom name, group, model, thinking level, original agent definition, forked context instructions, and unread queued steering or follow-up messages (delivered once in order).
222
+ If Atomic exits, crashes, or you switch sessions (`/new`, `/resume`, `/fork`), running subagents stay resumable and relaunch automatically when you reopen the launching session — keeping their Intercom name, group, model, thinking level, original agent definition, forked context, and unread queued messages.
222
223
 
223
- Inbound Intercom messages wait while a subagent restores (see [Connection states and recovery](/intercom/operations#connection-states-and-recovery)). Finished, paused, quit, and permanently cancelled subagents do not auto-relaunch, and session forks (`/fork`, `--fork`) never relaunch the original session's subagents. If a subagent cannot be restored (for example, its session or agent definition is missing), Atomic posts one recovery notice with its IDs, worktree or branch, `git` inspection commands, and relaunch call, then marks it gone.
224
+ Finished, paused, quit, and permanently cancelled subagents do not auto-relaunch, and session forks (`/fork`, `--fork`) never relaunch the original session's subagents. If a subagent cannot be restored, Atomic posts one recovery notice with its IDs, worktree or branch, `git` inspection commands, and relaunch call, then marks it gone.
224
225
 
225
- A subagent always keeps its session in the launching session's own [session store](/storage): the local SQLite file by default, your shared PostgreSQL database, a JSONL directory, or the in-memory store. Nothing about the launch picks another store. A different `cwd`, a project there with its own `.atomic/settings.json` storage settings, a named worktree, `worktree: true`, `context: "fork"`, a resume after a restart, and a launch from a code-mode script all keep the subagent in the launching session's store. Subagents resume, wake, and export wherever their launching session opens, including [another machine sharing the same database](/guides/resume-on-any-machine).
226
+ A subagent always stores its session in the launching session's own [session store](/storage) (local SQLite by default, shared PostgreSQL, JSONL directory, or in-memory), regardless of `cwd`, worktrees, forks, or codemode launches. Subagents resume, wake, and export wherever the launching session opens, including [another machine sharing the same database](/guides/resume-on-any-machine):
226
227
 
227
- - **What this means for `/tasks` and `history://`.** `/tasks`, `status`, and resume read a subagent's session from the launching session's store, so they work wherever that session opens. A subagent's session is readable at `history://sessions/<id>` from any session using that store. The result names it, with `?project=<dir>` when the subagent ran in another directory or worktree.
228
- - **JSONL stores.** With a JSONL-backed launching session, each subagent's session file sits in the same directory as the launching session's file. The launch's `sessionDir` and `defaultSessionDir` in [config.json](/subagents/reference#subagent-config-json-reference) are ignored, with a one-time deprecation warning. Sessions written as files by earlier releases (under `~/.atomic/agent/subagent-sessions/`, beside a JSONL parent's file, or in a `sessionDir`) stay readable in `/tasks` and restorable. A subagent that was queued but never started relaunches in the launching session's store.
229
- - **Unsaved sessions.** A session started with `--no-session` or in-memory storage keeps subagent sessions in memory; a finished subagent's history moves to a temporary file that Atomic deletes on exit.
230
- - **Session list visibility.** Every subagent session, fresh or `context: "fork"`, is marked internal, so `/resume`, `atomic -r`, `-c`, and the `history://sessions` list omit it. A forked subagent differs only in starting from its parent's conversation, and its session records the parent it forked from. In a SQLite or PostgreSQL store it shares that conversation instead of copying it, so it starts as fast from a long conversation as from a short one. See [Shared-history forks](/storage#shared-history-forks). Each result names its session file or `history://sessions/<id>`.
231
- - **Worktree snapshots.** In a blob-capable store, subagents record [worktree snapshots](/worktree-snapshots) of checkouts they modify. Reopening the main session restores each shared checkout from the newest capture among the main session and its finished subagents, while named worktrees and restored active subagents continue from their own snapshots.
228
+ - **Visibility and `history://`.** Subagent sessions are marked internal, so `/resume`, `atomic -r`, `-c`, and `history://sessions` omit them, while `history://sessions/<id>` reads them directly (with `?project=<dir>` if the subagent ran in another directory or worktree). In SQLite and PostgreSQL stores, forked subagents share their parent's conversation history instead of copying it ([Shared-history forks](/storage#shared-history-forks)).
229
+ - **Unsaved sessions.** Sessions started with `--no-session` or in-memory storage keep subagent sessions in memory and move finished transcripts to a temp file cleaned on exit.
230
+ - **Worktree snapshots.** In blob-capable stores, subagents record [worktree snapshots](/worktree-snapshots) of checkouts they modify so reopening restores the newest state cleanly.
232
231
 
233
232
  ## Coordination and swarms
234
233
 
235
234
  ### Supervisor coordination
236
235
 
237
- By default (`intercomBridge.mode: "always"` in [config.json](/subagents/reference#subagent-config-json-reference)), Atomic injects **both** `intercom` and `contact_supervisor` into **every** subagent whose launching session has Intercom active. Tool frontmatter declarations alone control Intercom tool availability only when `intercomBridge.mode` is `"off"` (or `"fork-only"` for fresh subagents). Main-session tool allowlists, exclusions, `noTools`, and disabled Intercom still apply. A subagent without `read` or `search` receives a read-only `session_history` tool after compaction so it can recover its own history (see [Agents without read or search](/compaction#agents-without-read-or-search)).
236
+ By default (`intercomBridge.mode: "always"` in `config.json`), Atomic injects **both** `intercom` and `contact_supervisor` into **every** subagent whose launching session has Intercom active. Tool frontmatter alone controls Intercom availability only when `intercomBridge.mode` is `"off"` (or `"fork-only"` for fresh subagents). A subagent without `read` or `search` also receives a read-only `session_history` tool after compaction to recover its own history (see [Agents without read or search](/compaction/memory-compaction#agents-without-read-or-search)).
238
237
 
239
- - **Supervisor decision waits vs. `intercom` `ask`.** `contact_supervisor({ reason: "need_decision", message })` and `interview_request` wait inside the requesting subagent and continue that same subagent when you reply via `intercom({ action: "reply", message: "..." })` (use `pending` and `replyTo` when multiple asks are open). Never relaunch the subagent to answer it. By contrast, `intercom` `ask` never blocks: it returns at delivery (after any `wait` budget) and delivers late replies as messages.
240
- - **Non-blocking updates.** `intercom` `send` and `contact_supervisor({ reason: "progress_update", message })` return immediately without cancelling or disrupting siblings or worktrees.
241
- - **Messaging a running subagent.** Subagents register on Intercom before their first turn, retrying while starting if the broker is briefly unreachable (supervisor authorization retries up to 30 seconds across broker restarts before starting without it). Address the subagent by its name or full ID from `intercom list`, and set `delivery` to `"steer"` (default), `"followUp"`, or `"interrupt"`. See [Intercom reference](/intercom/reference#the-intercom-tool).
242
- - **Embedded SDK sessions without background task management.** When an embedded SDK session launches a single subagent directly without background task management, `subagent` waits for completion; a blocking `contact_supervisor` request ends that subagent and returns its question, attachments, identity, and `[TASK_CONTEXT]` so the caller can launch a fresh subagent (`subagent({ agent: "worker", task: "[TASK_CONTEXT] ... Continue with this supervisor answer: ..." })`). Cancelling that waiting call stops the subagent permanently and returns labelled partial findings (`progress.md`, last assistant text, or artifact paths).
238
+ - **Decision waits vs. `intercom` `ask`.** `contact_supervisor({ reason: "need_decision", message })` and `interview_request` wait inside the requesting subagent and continue that same subagent when you answer with `intercom({ action: "reply", message: "..." })` (use `pending` and `replyTo` when multiple asks are open). Never relaunch the subagent to answer it. By contrast, `intercom` `ask` returns at delivery and delivers late replies as messages.
239
+ - **Non-blocking updates.** `intercom` `send` and `contact_supervisor({ reason: "progress_update", message })` return immediately without interrupting siblings or worktrees.
240
+ - **Messaging a running subagent.** Subagents register on Intercom before their first turn. Address a subagent by its `intercomTarget` or ID from `intercom list`, and choose `delivery: "steer"` (default), `"followUp"`, or `"interrupt"`. See [Intercom reference](/intercom/reference#the-intercom-tool).
241
+ - **Embedded SDK sessions without background task management.** When an SDK host runs a single subagent directly without a background task host, `subagent` blocks until completion and a blocking `contact_supervisor` ends the subagent with `[TASK_CONTEXT]` so the caller can launch a fresh subagent with the supervisor's answer.
243
242
 
244
243
  ### Peer coordination
245
244
 
246
245
  Peer-to-peer coordination is the default. Siblings in a parallel batch, or sharing an explicit `group`, discover each other with `intercom({ action: "list" })` and communicate directly with `send` and `ask` instead of routing through the supervisor.
247
246
 
248
- - Share findings, divide file ownership or expensive test runs, reuse verified reproductions, and challenge disagreements with evidence. Each subagent still returns its own complete result.
249
- - Reserve `contact_supervisor` for supervisor decisions. Ordinary Intercom group boundaries and user approval gates still apply. Peer asks and one blocking supervisor ask can wait concurrently. See `/skill:intercom` for peer patterns.
247
+ - Share findings, divide file ownership or expensive test runs, pass along reproductions, and challenge disagreements with evidence. Each subagent still returns its own complete result.
248
+ - Reserve `contact_supervisor` for supervisor decisions. Peer asks and one blocking supervisor ask can wait concurrently. See `/skill:intercom` for peer patterns.
250
249
 
251
250
  ```typescript
252
251
  const peerRules =
@@ -255,24 +254,21 @@ const peerRules =
255
254
 
256
255
  subagent({
257
256
  tasks: [
258
- { agent: "reviewer", task: `Review correctness of the auth changes. ${peerRules}` },
259
- { agent: "reviewer", task: `Review security of the auth changes. ${peerRules}` },
260
- { agent: "reviewer", task: `Review test coverage of the auth changes. ${peerRules}` },
257
+ { agent: "codebase-analyzer", task: `Review correctness of the auth changes. ${peerRules}` },
258
+ { agent: "codebase-analyzer", task: `Review security of the auth changes. ${peerRules}` },
259
+ { agent: "codebase-analyzer", task: `Review test coverage of the auth changes. ${peerRules}` },
261
260
  ],
262
261
  });
263
262
  ```
264
263
 
265
264
  ### Scaling a swarm
266
265
 
267
- Atomic supports large parallel swarms organized into peer-coordinating teams:
268
-
269
- - **Parallel limits.** `parallel.maxTasks`, `parallel.concurrency`, and `parallel.runningCapacity` each default to `1000` with no hard upper cap. Raise all three in `config.json` to exceed 1,000, or lower `parallel.concurrency` to throttle. Provider rate limits and host memory remain practical bounds.
270
- - **Nesting.** Delegation is strictly one level deep. Only the main session launches subagents.
271
- - **Teams.** Intercom groups have no member cap. Assign each team its own `group` for internal messaging; members can still reach the supervisor via `contact_supervisor`.
266
+ - **Parallel limits.** `parallel.maxTasks`, `parallel.concurrency`, and `parallel.runningCapacity` each default to `1000` with no hard upper cap. Adjust all three in `config.json` to raise limits, or lower `parallel.concurrency` to throttle. Provider rate limits and host memory remain the practical bounds.
267
+ - **Teams.** Intercom groups have no member cap. Give each team a named `group` (or `group: true` for a unique shared UUID group); members can still reach the supervisor via `contact_supervisor`.
272
268
 
273
269
  ### From codemode scripts
274
270
 
275
- When both `codemode` and `subagent` are active, `tools.subagent()` launches the same background subagents and resolves at launch, not completion. Launched subagents belong to the main session and continue even if the script returns, throws, or times out. Separate `tools.subagent()` calls in a script are not merged into a burst; pass `tasks: [...]` for a parallel batch. Subagents cannot launch nested subagents from codemode.
271
+ When both `codemode` and `subagent` are active, `tools.subagent()` launches the same background subagents and resolves at launch, not completion. Admitted subagents belong to the main session and keep running even if the script returns, throws, or times out. Separate `tools.subagent()` calls are not merged into one burst; pass `tasks: [...]` for a parallel batch.
276
272
 
277
273
  ```js
278
274
  const { tasks } = await tools.subagent({
@@ -286,53 +282,20 @@ store("checks", tasks);
286
282
  return tasks;
287
283
  ```
288
284
 
289
- Single `{ agent, task }` and parallel `{ tasks }` calls both return `{ action: "launch", tasks }`. Each slot has `agent`, `state` (`"admitted"`, `"queued"`, or `"refused"` with `reason`), `taskId`, `childId`, and `intercomTarget` when available. Do not retry already-started siblings if one slot is refused.
290
-
291
- - **`list`, `get`, and `models`.** Inspect executable `agents`, matching `definitions`, or the model catalog (`fullId`, `isCurrent`, `availableThinkingLevels`). Creating, updating, or deleting agent definitions requires a direct tool call.
292
- - **`status`.** Returns `children` launched by this session (pass `id` for one subagent) with state and any `resumeCall`. Use `status` after reopening a session to rediscover subagents instead of relaunching.
293
- - **`wait`.** Takes a task `id` and optional `budgetMs` (default 30 seconds, even if the host waits indefinitely; `0` checks immediately). Script timeouts cancel `wait`, not the subagent. Returns `outcome: "settled"` (with `childId`, `result.status`, output excerpt, `outputPath`, and `resumeCall`), `"running"`, or `"stopped-waiting"` (when the script's signal aborts).
294
- - **`pause`, `quit`, and `resume`.** `pause` and `quit` accept `id` or `all: true`. `resume` takes `id` and optional `message` and returns the new task ID in `children`. Always pass `id` rather than the legacy `runId` alias.
295
- - **Temporary worktrees.** `status` can show `finishing` while `wait` still returns `running`. Check `worktreeNote` or `worktreeNotes` before removing any worktree directory.
285
+ Single and parallel launches both return `{ action: "launch", tasks }`. Each slot contains `agent`, `state` (`"admitted"`, `"queued"`, or `"refused"` with `reason`), `taskId`, `childId`, and `intercomTarget` when available. Do not retry already-started siblings if one slot is refused.
296
286
 
297
- ## Models, scope, and configuration
287
+ - **Strict script rules.** Always pass `id` — passing the legacy `runId` alias is **rejected** in codemode (`"Use id instead of runId in subagent scripts."`). In `wait`, `budgetMs` must be a non-negative safe **integer** (defaults to `30000` ms even when a host configures unlimited foreground waits; `0` checks immediately).
288
+ - **`wait` outcomes.** Returns `outcome: "settled"`, `"running"`, or `"stopped-waiting"` (when the script's signal aborts; script timeouts cancel `wait`, not the subagent). On settled results, both `pause` and `quit` stops (when not released) resolve to `result.status: "paused"` (with `result.reason: "pause"` or `"quit"`), while a released child resolves to `result.status: "cancelled"`.
289
+ - **`list`, `get`, `models`, `status`, and control.** Inspect agents or models, call `status` after reopening a session to reconcile `children`, and call `pause`, `quit`, or `resume` with `id` (or `all: true` for `pause`/`quit`). Creating, updating, or deleting agent definitions requires a direct tool call.
290
+ - **Temporary worktrees.** `status` can show `finishing` while `wait` still returns `running`. Check `worktreeNote` or `worktreeNotes` in script results before deleting any temporary worktree directory.
298
291
 
299
- ### Model selection and `enabledModels` scope
292
+ ## Configuration and start timeouts
300
293
 
301
- All built-in subagents default to `model: "auto"`, which runs your default model (last chosen with `/model`) at its default thinking level, or the launching session's model when no default is set. Per-call `model` overrides the default, and custom agents without `model` or `fallbackModels` inherit the launching session's model and thinking level. See [Automatic model selection](/subagents/reference#automatic-model-selection).
302
-
303
- - **Model catalog.** Call `subagent({ action: "models" })` before pinning a model and use only a returned `fullId` and supported thinking level. Omit per-call `model` unless the user requested a specific model or you have a clear task-specific reason.
304
- - **Credentials.** Providers without configured credentials are skipped before launch and recorded in model attempts. A provider that rejects credentials mid-run is skipped for subsequent fallbacks. If no candidate has credentials, launch fails immediately and lists each missing provider (see [Fallbacks and credentials](/models#fallbacks-and-credentials)).
305
- - **`enabledModels` / `--models` / `/scoped-models` scope.** Subagents enforce the main session's active model scope using the exact same matching rules (`minimatch` `*`/`?`/`[...]` globs, literal bracketed IDs, fuzzy substring matches, and case-insensitive `:thinking` suffixes). `subagent({ action: "models" })` returns only scoped models, fallbacks skip disallowed candidates, and explicit disallowed models fail before launch. If `enabledModels` is set to patterns matching zero available models, **all** subagent launches are refused; only an unset or empty `enabledModels` allows all models.
306
-
307
- ### Subagent `config.json` and call options
308
-
309
- Configure subagent runtime defaults in `~/.atomic/agent/extensions/subagent/config.json` (Atomic falls back to `~/.pi/agent/extensions/subagent/config.json` when the Atomic file is absent):
310
-
311
- ```json
312
- {
313
- "parallel": {
314
- "maxTasks": 2000,
315
- "concurrency": 2000,
316
- "runningCapacity": 2000
317
- },
318
- "resumeInFlight": "ask",
319
- "sessionStartTimeoutMs": 300000,
320
- "intercomBridge": {
321
- "mode": "always"
322
- }
323
- }
324
- ```
325
-
326
- - **`parallel.maxTasks`, `concurrency`, and `runningCapacity`.** All default to `1000` with no hard cap. Per-call `concurrency` overrides `parallel.concurrency`. `runningCapacity` takes effect when the first subagent starts, so restart Atomic after changing it.
327
- - **`resumeInFlight`.** Controls paused or quit subagents awaiting resume on startup or `/resume` (not `/reload`, `/new`, or `/fork`): `"never"` (default, stay in **Awaiting resume**), `"ask"` (one confirmation prompt; falls back to `"never"` without a UI), or `"auto"` (resumes automatically).
328
- - **Additional keys.** `config.json` also supports `defaultSessionDir`, `control` (attention and long-running notice thresholds), `worktreeSetupHook` and `worktreeSetupHookTimeoutMs` (default `30000` ms), and `intercomBridge` (`mode`: `"off" | "fork-only" | "always"`, `instructionFile`). Invalid `resumeInFlight` or `sessionStartTimeoutMs` values drop only that field and log an error while the rest of the file loads; invalid JSON falls back to `{}`. See [Subagent config.json reference](/subagents/reference#subagent-config-json-reference) for every key.
329
- - **Multiple `subagent` calls in one assistant message.** Separate single-agent `subagent` calls emitted in one assistant message combine into one parallel run while returning each call's own results and errors. Shared options (`concurrency`, `worktree: true`, `context`, `control`, `sessionDir`, `maxOutput`, `artifacts`, `includeProgress`, `agentScope`) must match across those calls; `cwd` (must match for `worktree: true`), `group`, and named `worktree: { ... }` stay per call. Prefer one explicit `{ tasks: [...] }` call when planning parallel work.
330
- - **`group`.** A named string joins that Intercom group; boolean `true` or the case-insensitive string `"true"` or `"auto"` creates one shared UUID group for a parallel set. Precedence is explicit `group`, then launching session group, then config, then `"default"`.
331
- - **`cwd` validation.** A missing or non-directory `cwd` fails before starting the subagent.
294
+ Configure subagent runtime defaults in `~/.atomic/agent/extensions/subagent/config.json` (or `~/.pi/agent/extensions/subagent/config.json` when the Atomic file is absent) and inspect available scoped models with `subagent({ action: "models" })`. Subagents enforce your active `enabledModels` / `--models` / `/scoped-models` scope and skip providers without configured credentials before launch. For every `config.json` key, model resolution rule, fallback chain, and tool parameter, see [Subagent reference](/subagents/reference).
332
295
 
333
296
  ### Subagent start timeouts
334
297
 
335
- Subagents have a 5-minute startup budget covering session open, resource load, agent session creation (including slot wait), and task dispatch. Queue wait under `parallel.runningCapacity` does not count. Override the budget in `~/.atomic/agent/extensions/subagent/config.json` (milliseconds, `1` to `2147483647`):
298
+ Subagents have a **5-minute** (`300000` ms) startup budget covering session open, resource load, agent session creation (including slot wait), and task dispatch. Queue wait under `parallel.runningCapacity` does not count. Override it in `~/.atomic/agent/extensions/subagent/config.json` (`1` to `2147483647` ms):
336
299
 
337
300
  ```json
338
301
  { "sessionStartTimeoutMs": 600000 }
@@ -347,60 +310,29 @@ Exceeding the budget fails with `SessionStartTimeoutError` (shown in `status` an
347
310
  | `dispatch` | Session started, but `input` or `before_agent_start` blocked dispatch. | Inspect extension handlers and retry. |
348
311
  | `event-loop` | The main thread was saturated during startup. | Reduce concurrent load and retry. |
349
312
 
350
- For SDK error rehydration (`isSessionStartTimeoutError`, `rehydrateSessionStartError`), see [Session start errors](/sdk/reference#session-start-errors).
351
-
352
- ### Using subagents from the SDK
353
-
354
- `createAgentSession()` enables the bundled subagents package by default. Control subagents and child host behavior directly from `@bastani/atomic`:
355
-
356
- ```typescript
357
- import { createAgentSession } from "@bastani/atomic";
358
-
359
- // Disable the bundled subagents package (also removes its 21 bundled skills)
360
- const withoutPackage = await createAgentSession({
361
- builtins: { subagents: false },
362
- });
363
-
364
- // Hide only the subagent tool while keeping the 21 bundled skills available
365
- const skillsOnly = await createAgentSession({
366
- excludedTools: ["subagent"],
367
- });
368
-
369
- // Route subagent ask_user_question and extension dialogs without a terminal
370
- const headless = await createAgentSession({
371
- extensionBindings: {
372
- humanInput: myHostInput,
373
- },
374
- });
375
- ```
376
-
377
- - **Child inheritance.** Subagents inherit the parent session's `ModelRuntime`, settings, `agentDir`, `scopedModels`, `fallbackModels`, `customTools`, `resourceAdmission`, and `humanInput`. See [Subagent children in the SDK](/sdk#subagent-children).
378
- - **Human input.** Implement `extensionBindings.humanInput` so dialogs triggered inside a child session route cleanly by `sessionId`. See [Human input without a terminal](/sdk#human-input-without-a-terminal).
379
- - **Background task supervision.** Bind `AgentTaskHost` and `OwnerTaskStore` to observe and control background subagents in custom hosts. See [Owner-bound task supervisor](/sdk/reference#owner-bound-task-supervisor) and [Owner-bound task projection](/subagents/reference#owner-bound-task-projection).
380
-
381
- ## Delegation boundaries and migration
382
-
383
- Delegation is fixed at one level: subagents cannot launch, `pause`, `resume`, or `quit` other subagents, and restricted subagents cannot `create`, `update`, or `delete` agent definitions. Subagents can still run background shells (nested under the subagent in the agent panel) and inspect status with `list`, `get`, `status`, and `wait`. Subagent prompts omit parent orchestration artifacts and prior control traffic.
384
-
385
- If older calls or agent definitions still pass removed acceptance-gate fields:
386
-
387
- - Remove `acceptance` from `subagent()` calls and task entries.
388
- - Remove `completionGuard: false` from agent frontmatter (tool updates strip it automatically).
389
- - Put required commands, tests, or evidence checks directly in the task prompt.
390
-
391
- <div id="custom-agents" />
313
+ For SDK configuration (`createAgentSession`, `builtins: { subagents: false }`, `excludedTools: ["subagent"]`, `humanInput`) and error rehydration, see [Subagent children in the SDK](/sdk#subagent-children) and [Session start errors](/sdk/reference#session-start-errors).
392
314
 
393
- <div id="fallback-models" />
315
+ ## Delegation boundaries
394
316
 
395
- <div id="reasoning-levels" />
317
+ Delegation is fixed at one level: only the main session can launch, `pause`, `resume`, or `quit` subagents, and restricted subagents cannot `create`, `update`, or `delete` agent definitions. Subagents can still run background shells (nested under the subagent in the agent panel) and inspect status with `list`, `get`, `status`, and `wait`. Subagent prompts omit parent orchestration artifacts and prior control traffic.
396
318
 
397
- <div id="owner-bound-task-projection" />
319
+ <Note>
320
+ **Removed acceptance-gate fields.** Older calls or agent files that passed `acceptance` or `completionGuard: false` should remove them (tool-based updates strip `completionGuard` automatically) and put required tests, commands, or evidence checks directly in the task prompt.
321
+ </Note>
398
322
 
399
- ## Related docs
323
+ ## Next steps
400
324
 
401
- - [Create custom subagents](/subagents/authoring#custom-agents) explains how to define, scope, and override agents.
402
- - [Subagent reference](/subagents/reference) covers [agent discovery](/subagents/reference#agent-discovery), [fallback models](/subagents/reference#fallback-models), [reasoning levels](/subagents/reference#reasoning-levels), and [owner-bound task projection](/subagents/reference#owner-bound-task-projection).
403
- - [Orchestrate with codemode and subagents](/orchestration) shows multi-step work with codemode and subagents.
404
- - [Coordinate sessions with Intercom](/intercom) covers cross-session messaging and supervisor escalation.
405
- - [Skills](/skills) covers reusable instructions invoked with `/skill:<name>`.
406
- - [Settings](/settings) covers user and project configuration.
325
+ <Columns cols={2}>
326
+ <Card title="Create custom subagents" href="/subagents/authoring">
327
+ Define custom Markdown agents, YAML frontmatter fields, and built-in overrides.
328
+ </Card>
329
+ <Card title="Subagent reference" href="/subagents/reference">
330
+ Discovery precedence, automatic model selection, fallback models, `config.json`, and tool parameters.
331
+ </Card>
332
+ <Card title="Manage background tasks" href="/background-tasks">
333
+ Agent panel, `/tasks`, steering, stopping work, and task heartbeats.
334
+ </Card>
335
+ <Card title="Orchestrate multi-step work" href="/orchestration">
336
+ Coordinate parallel subagents from codemode and recover cleanly after interruptions.
337
+ </Card>
338
+ </Columns>