@bastani/atomic 0.10.14-alpha.1 → 0.10.15-alpha.1

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 (341) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/_shared/dist-KOELCESV.js +2 -2
  3. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  4. package/dist/_shared/lib-4PES5P4V.js +2 -2
  5. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
  6. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
  7. package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
  8. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  9. package/dist/_shared/runtime-O4KCSG4C.js +2 -2
  10. package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
  11. package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
  12. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  13. package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
  14. package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
  15. package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
  16. package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
  17. package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
  18. package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
  19. package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
  20. package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
  21. package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
  22. package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
  23. package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
  24. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  25. package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
  26. package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
  27. package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
  28. package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
  29. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  30. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  31. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  32. package/dist/builtin/intercom/package.json +1 -1
  33. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  34. package/dist/builtin/mcp/package.json +1 -1
  35. package/dist/builtin/subagents/package.json +1 -1
  36. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  37. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  38. package/dist/builtin/web-access/package.json +1 -1
  39. package/dist/cli/auth-cli.code.js +1 -1
  40. package/dist/cli/auth-cli.impl.js +3 -3
  41. package/dist/cli/auth-cli.js +3 -3
  42. package/dist/cli/blueprint-command.impl.js +3 -3
  43. package/dist/cli/blueprint-command.js +3 -3
  44. package/dist/cli/intercom-command.code.js +3 -3
  45. package/dist/cli/intercom-command.impl.js +3 -3
  46. package/dist/cli/intercom-command.js +3 -3
  47. package/dist/cli/list-models.impl.js +3 -3
  48. package/dist/cli/list-models.js +3 -3
  49. package/dist/cli/session-picker.code.js +1 -1
  50. package/dist/cli/session-picker.impl.js +3 -3
  51. package/dist/cli/session-picker.js +3 -3
  52. package/dist/cli/startup-ui.code.js +1 -1
  53. package/dist/cli/startup-ui.impl.js +3 -3
  54. package/dist/cli/startup-ui.js +3 -3
  55. package/dist/cli/storage-command.impl.js +3 -3
  56. package/dist/cli/storage-command.js +3 -3
  57. package/dist/cli/storage-search-session.code.js +1 -1
  58. package/dist/cli/storage-search-session.impl.js +3 -3
  59. package/dist/cli/storage-search-session.js +3 -3
  60. package/dist/cli/team-command.code.js +1 -1
  61. package/dist/cli/team-command.impl.js +3 -3
  62. package/dist/cli/team-command.js +3 -3
  63. package/dist/cli.js +2 -2
  64. package/dist/core/compaction/compactor.d.ts +0 -8
  65. package/dist/core/debug.impl.js +3 -3
  66. package/dist/core/debug.js +3 -3
  67. package/dist/core/export-html/card-projection.impl.js +3 -3
  68. package/dist/core/export-html/card-projection.js +3 -3
  69. package/dist/core/export-html/index.code.js +2 -2
  70. package/dist/core/export-html/index.impl.js +3 -3
  71. package/dist/core/export-html/index.js +3 -3
  72. package/dist/core/export-html/json-spans.impl.js +3 -3
  73. package/dist/core/export-html/json-spans.js +3 -3
  74. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  75. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  76. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  77. package/dist/core/export-html/tool-renderer.js +3 -3
  78. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  79. package/dist/core/extensions/jiti-loader.js +3 -3
  80. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  81. package/dist/core/extensions/jiti-static-loader.js +3 -3
  82. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  83. package/dist/core/extensions/loader-host-modules.js +3 -3
  84. package/dist/core/intercom-broker-control-host.code.js +1 -1
  85. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  86. package/dist/core/intercom-broker-control-host.js +3 -3
  87. package/dist/core/intercom-broker-control.code.js +2 -2
  88. package/dist/core/intercom-broker-control.impl.js +3 -3
  89. package/dist/core/intercom-broker-control.js +3 -3
  90. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  91. package/dist/core/package-manager-storage-adapters.js +3 -3
  92. package/dist/core/sdk.code.js +1 -1
  93. package/dist/core/sdk.impl.js +3 -3
  94. package/dist/core/sdk.js +3 -3
  95. package/dist/core/session-manager-core.js +3 -3
  96. package/dist/core/session-manager-list.impl.js +3 -3
  97. package/dist/core/session-manager-list.js +3 -3
  98. package/dist/core/session-manager.impl.js +3 -3
  99. package/dist/core/session-manager.js +3 -3
  100. package/dist/core/session-storage.impl.js +3 -3
  101. package/dist/core/session-storage.js +3 -3
  102. package/dist/core/storage/index.js +2 -2
  103. package/dist/core/storage/node-sqlite-thread.js +2 -2
  104. package/dist/core/storage/node-sqlite.js +2 -2
  105. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  106. package/dist/core/storage/offline-snapshot-file.js +3 -3
  107. package/dist/core/storage/provider.js +2 -2
  108. package/dist/core/storage/selection.js +2 -2
  109. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  110. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  111. package/dist/core/storage/session/branch-fork-source.js +3 -3
  112. package/dist/core/storage/session/card-view.impl.js +3 -3
  113. package/dist/core/storage/session/card-view.js +3 -3
  114. package/dist/core/storage/session/child-reader.code.js +2 -2
  115. package/dist/core/storage/session/child-reader.impl.js +3 -3
  116. package/dist/core/storage/session/child-reader.js +3 -3
  117. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  118. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  119. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  120. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  121. package/dist/core/storage/session/expanded-child-details.js +3 -3
  122. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  123. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  124. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  125. package/dist/core/storage/session/fork-row-index.js +3 -3
  126. package/dist/core/storage/session/fork-staging.code.js +1 -1
  127. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  128. package/dist/core/storage/session/fork-staging.js +3 -3
  129. package/dist/core/storage/session/fork-window.code.js +2 -2
  130. package/dist/core/storage/session/fork-window.impl.js +3 -3
  131. package/dist/core/storage/session/fork-window.js +3 -3
  132. package/dist/core/storage/session/history-pages.impl.js +3 -3
  133. package/dist/core/storage/session/history-pages.js +3 -3
  134. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  135. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  136. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  137. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  138. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  139. package/dist/core/storage/session/memory-session-store.js +3 -3
  140. package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
  141. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  142. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  143. package/dist/core/storage/session/released-history-files.code.js +1 -1
  144. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  145. package/dist/core/storage/session/released-history-files.js +3 -3
  146. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  147. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  148. package/dist/core/storage/session/session-resume.impl.js +3 -3
  149. package/dist/core/storage/session/session-resume.js +3 -3
  150. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  151. package/dist/core/storage/session/snapshot-cut.js +3 -3
  152. package/dist/core/storage/session/snapshot-history.code.js +2 -2
  153. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  154. package/dist/core/storage/session/snapshot-history.js +3 -3
  155. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  156. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  157. package/dist/core/storage/session/sql-session-store.js +3 -3
  158. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  159. package/dist/core/storage/session/tree-outline.js +3 -3
  160. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  161. package/dist/core/storage/session/tree-presentation.js +3 -3
  162. package/dist/core/storage/storage-status.impl.js +3 -3
  163. package/dist/core/storage/storage-status.js +3 -3
  164. package/dist/core/storage/team.impl.js +3 -3
  165. package/dist/core/storage/team.js +3 -3
  166. package/dist/core/structured-output/index.code.js +1 -1
  167. package/dist/core/structured-output/index.impl.js +3 -3
  168. package/dist/core/structured-output/index.js +3 -3
  169. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  170. package/dist/core/tasks/task-completion-entry.js +3 -3
  171. package/dist/core/tasks/task-file-history.code.js +2 -2
  172. package/dist/core/tasks/task-file-history.impl.js +3 -3
  173. package/dist/core/tasks/task-file-history.js +3 -3
  174. package/dist/core/tasks/task-reference-archive.code.js +2 -2
  175. package/dist/core/tasks/task-reference-archive.js +3 -3
  176. package/dist/core/tasks/task-reference-identity.js +3 -3
  177. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  178. package/dist/core/tasks/task-reference-stream.js +3 -3
  179. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  180. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  181. package/dist/core/tasks/task-view-source.impl.js +3 -3
  182. package/dist/core/tasks/task-view-source.js +3 -3
  183. package/dist/core/tools/read-url.impl.js +3 -3
  184. package/dist/core/tools/read-url.js +3 -3
  185. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  186. package/dist/core/worktree-snapshot/errors.code.js +1 -1
  187. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  188. package/dist/core/worktree-snapshot/errors.js +3 -3
  189. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  190. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  191. package/dist/extensions/codemode/execute.impl.js +3 -3
  192. package/dist/extensions/codemode/execute.js +3 -3
  193. package/dist/extensions/codemode/renderer.impl.js +3 -3
  194. package/dist/extensions/codemode/renderer.js +3 -3
  195. package/dist/extensions/mcp/cli.code.js +1 -1
  196. package/dist/extensions/mcp/cli.impl.js +3 -3
  197. package/dist/extensions/mcp/cli.js +3 -3
  198. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  199. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  200. package/dist/extensions/mcp/cli.lazy.js +3 -3
  201. package/dist/extensions/mcp/runtime.code.js +1 -1
  202. package/dist/extensions/mcp/runtime.impl.js +3 -3
  203. package/dist/extensions/mcp/runtime.js +3 -3
  204. package/dist/index.d.ts +21 -1
  205. package/dist/index.js +2 -2
  206. package/dist/main-first-time-setup.code.js +1 -1
  207. package/dist/main-first-time-setup.impl.js +3 -3
  208. package/dist/main-first-time-setup.js +3 -3
  209. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  210. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  211. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  212. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  213. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  214. package/dist/modes/print-mode.js +1 -1
  215. package/dist/package-manager-cli.code.js +2 -2
  216. package/dist/package-manager-cli.impl.js +3 -3
  217. package/dist/package-manager-cli.js +3 -3
  218. package/dist/startup-files.json +1 -1
  219. package/dist/startup-stages/6.js +1 -1
  220. package/dist/utils/startup-database-spare.code.js +1 -1
  221. package/dist/utils/startup-database-spare.impl.js +3 -3
  222. package/dist/utils/startup-database-spare.js +3 -3
  223. package/dist/utils/tools-manager.impl.js +3 -3
  224. package/dist/utils/tools-manager.js +3 -3
  225. package/docs/background-tasks/reference.md +182 -0
  226. package/docs/background-tasks.md +98 -405
  227. package/docs/build.md +67 -27
  228. package/docs/changelog.mdx +9 -0
  229. package/docs/codemode.md +108 -39
  230. package/docs/compaction/branch-summaries.md +54 -0
  231. package/docs/compaction/custom-compactors.md +161 -0
  232. package/docs/compaction/memory-compaction.md +77 -0
  233. package/docs/compaction/reference.md +86 -38
  234. package/docs/compaction.md +51 -252
  235. package/docs/computer-use.md +169 -321
  236. package/docs/containerization.md +71 -57
  237. package/docs/custom-provider/api-reference.md +119 -25
  238. package/docs/custom-provider/oauth.md +114 -132
  239. package/docs/custom-provider/override.md +37 -27
  240. package/docs/custom-provider/registration.md +107 -83
  241. package/docs/custom-provider/streaming.md +85 -71
  242. package/docs/custom-provider.md +85 -52
  243. package/docs/development.md +39 -29
  244. package/docs/docs.json +76 -63
  245. package/docs/environment-variables.md +94 -44
  246. package/docs/extensions/api-reference.md +86 -43
  247. package/docs/extensions/authoring.md +162 -154
  248. package/docs/extensions/events.md +80 -25
  249. package/docs/extensions/examples.md +90 -85
  250. package/docs/extensions/ui.md +206 -82
  251. package/docs/extensions.md +79 -108
  252. package/docs/getting-started/authentication.md +67 -36
  253. package/docs/getting-started/first-session.md +53 -43
  254. package/docs/getting-started/installation.md +116 -89
  255. package/docs/getting-started/project-instructions.md +48 -34
  256. package/docs/guides/configuration.md +82 -20
  257. package/docs/guides/non-interactive.md +66 -24
  258. package/docs/guides/resume-on-any-machine.md +135 -82
  259. package/docs/guides/team-setup.md +114 -105
  260. package/docs/guides.md +76 -32
  261. package/docs/herdr.md +15 -16
  262. package/docs/how-atomic-works.md +140 -0
  263. package/docs/index.md +58 -44
  264. package/docs/intercom/operations.md +141 -151
  265. package/docs/intercom/reference.md +85 -108
  266. package/docs/intercom.md +84 -145
  267. package/docs/json.md +120 -67
  268. package/docs/keybindings.md +85 -49
  269. package/docs/libraries/agent-core.md +137 -275
  270. package/docs/libraries/ai.md +100 -84
  271. package/docs/libraries/codemode.md +210 -300
  272. package/docs/libraries/schema.md +59 -53
  273. package/docs/libraries/storage-postgres.md +49 -35
  274. package/docs/libraries/telemetry.md +153 -354
  275. package/docs/libraries/tui.md +265 -393
  276. package/docs/libraries.md +42 -26
  277. package/docs/llama-cpp.md +171 -161
  278. package/docs/mcp-servers.md +90 -51
  279. package/docs/models/choose-a-model.md +188 -0
  280. package/docs/models/reference.md +74 -30
  281. package/docs/models.md +153 -88
  282. package/docs/orchestration/migrating-workflows.md +23 -16
  283. package/docs/orchestration/patterns.md +39 -44
  284. package/docs/orchestration.md +65 -26
  285. package/docs/packages/authoring.md +51 -29
  286. package/docs/packages/reference.md +42 -21
  287. package/docs/packages.md +69 -58
  288. package/docs/programmatic.md +118 -24
  289. package/docs/prompt-templates.md +84 -83
  290. package/docs/providers/reference.md +43 -48
  291. package/docs/providers.md +219 -451
  292. package/docs/quickstart.md +140 -120
  293. package/docs/reference/cli.md +135 -97
  294. package/docs/reference.md +20 -18
  295. package/docs/rpc/examples.md +76 -20
  296. package/docs/rpc/extension-ui.md +64 -38
  297. package/docs/rpc/protocol.md +361 -110
  298. package/docs/rpc.md +57 -17
  299. package/docs/sdk/reference.md +409 -534
  300. package/docs/sdk/storage.md +53 -13
  301. package/docs/sdk/structured-decisions.md +82 -56
  302. package/docs/sdk/web-server.md +57 -43
  303. package/docs/sdk.md +106 -84
  304. package/docs/security.md +42 -64
  305. package/docs/session-format.md +62 -38
  306. package/docs/sessions.md +99 -214
  307. package/docs/settings.md +165 -195
  308. package/docs/shell-aliases.md +9 -6
  309. package/docs/skills/authoring.md +69 -48
  310. package/docs/skills/reference.md +51 -20
  311. package/docs/skills.md +99 -148
  312. package/docs/slash-commands.md +129 -0
  313. package/docs/storage/custom-adapters.md +160 -85
  314. package/docs/storage/jsonl.md +81 -66
  315. package/docs/storage/postgres/pgbouncer.md +120 -126
  316. package/docs/storage/postgres/tuning.md +120 -143
  317. package/docs/storage/postgres.md +314 -330
  318. package/docs/storage/sqlite.md +71 -42
  319. package/docs/storage.md +298 -302
  320. package/docs/subagents/authoring.md +55 -38
  321. package/docs/subagents/reference.md +73 -33
  322. package/docs/subagents.md +119 -187
  323. package/docs/terminal-setup.md +50 -38
  324. package/docs/termux.md +67 -41
  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
package/docs/tools.md CHANGED
@@ -4,22 +4,50 @@ sidebarTitle: "Built-in tools"
4
4
  description: "Reference for Atomic's default coding tools, path and resource selectors, background shell execution, task tracking, and output persistence."
5
5
  ---
6
6
 
7
- By default, Atomic enables `read`, `write`, `edit`, `bash`, `kill`, `find`, `search`, `ask_user_question`, `todo`, and `codemode` (plus `powershell` on native Windows when `pwsh.exe` or `powershell.exe` is on `PATH`). Two more built-in tools, `ls` and `tool_search`, are off by default and can be enabled with `--tools` or `defaultTools`.
7
+ Atomic ships a default set of coding tools for reading, editing, running commands, searching files, tracking tasks, and scripting multi-step operations. Two additional built-in tools (`ls` and `tool_search`) are off by default and can be enabled per run or in settings.
8
8
 
9
- - [Read files, archives, SQLite, and URLs](#read-and-path-selectors)
10
- - [Edit existing files](#edit) or [write files](#write)
11
- - [Run shell commands](#bash) or [stop background shells](#kill)
12
- - [Find paths and search contents](#find-and-search) or [list directories](#ls)
13
- - [Track file-based tasks with `todo`](#todo) or [ask interactive questions](#ask_user_question)
14
- - [Compose tool calls with `codemode`](#codemode) or [discover deferred tools](#tool_search)
15
-
16
- Bundled integrations also add [public repository search](#code_search), [web access](/web-access), and [MCP servers](/mcp-servers).
17
-
18
- **Tool concurrency.** Within a single assistant turn, `edit`, `write`, `todo`, `ask_user_question`, and `bash` or `powershell` with `pty: true` run one at a time in call order. `read`, `find`, `search`, `ls`, and non-PTY shell commands can run in parallel.
19
-
20
- **Inspecting active tools.** Run `/tools` to see active tools, why inactive tools are off, and any unregistered names in `defaultTools`. Its **Git** section reports which `git` binary Atomic uses: `system` (from your `PATH`), `provisioned` (Atomic's managed portable Git copy), or `unavailable` (with an install command), plus any failed portable Git update. See [Git](/getting-started/installation#git). SDK and RPC clients get the same report from [`session.getToolStatus()`](/sdk/reference#checking-tool-status) and [`get_tools`](/rpc/protocol#get_tools). If portable Git cannot be selected, ordinary shell commands still run while Git-dependent features report the error.
21
-
22
- **Malformed tool arguments.** If a model produces invalid or truncated JSON tool arguments, Atomic rejects the call instead of executing a partial request and returns the original arguments so the model can retry.
9
+ | Tool | Default | Purpose |
10
+ | --- | --- | --- |
11
+ | [`read`](#read-and-path-selectors) | Enabled | Read files, directories, images, documents, archives, SQLite databases, internal resources, and public URLs. |
12
+ | [`edit`](#edit) | Enabled | Apply exact-text replacements to an existing file. |
13
+ | [`write`](#write) | Enabled | Create or overwrite files, archive members, SQLite rows, and merge-conflict resolutions. |
14
+ | [`bash`](#bash) | Enabled | Run shell commands and observe background shell tasks. |
15
+ | [`powershell`](#powershell) | Windows only | Run PowerShell commands on native Windows when `pwsh.exe` or `powershell.exe` is on `PATH`. |
16
+ | [`kill`](#kill) | Enabled | Stop a running background shell or history task started in this session. |
17
+ | [`find`](#find-and-search) | Enabled | Locate filesystem paths by glob. |
18
+ | [`search`](#find-and-search) | Enabled | Search file and resource contents with a regular expression. |
19
+ | [`todo`](#todo) | Enabled | Manage file-based tasks in `.atomic/todos`. |
20
+ | [`ask_user_question`](#ask_user_question) | Enabled | Ask interactive multiple-choice or confirmation questions in the terminal UI. |
21
+ | [`codemode`](#codemode) | Enabled | Run sandboxed JavaScript to compose tool calls and return filtered output. |
22
+ | [`ls`](#ls) | Off | List directory entries alphabetically. |
23
+ | [`tool_search`](#tool_search) | Off | Activate deferred tools on demand for direct calls. |
24
+
25
+ Bundled integrations also add [`code_search`](#code_search), web search and fetching, MCP servers, subagents, and Intercom:
26
+
27
+ <Columns cols={2}>
28
+ <Card title="Codemode" href="/codemode">
29
+ Sandbox globals, return shapes, branch storage, classifiers, image generation, and limits.
30
+ </Card>
31
+ <Card title="Background tasks" href="/background-tasks">
32
+ Observe, steer, and stop long-running shells, subagents, and slow history reads.
33
+ </Card>
34
+ <Card title="Web access" href="/web-access">
35
+ Search the web, fetch webpages, PDFs, GitHub repos, and videos, and query DeepWiki.
36
+ </Card>
37
+ <Card title="MCP servers" href="/mcp-servers">
38
+ Connect external stdio and streamable HTTP tools, resources, and OAuth logins.
39
+ </Card>
40
+ </Columns>
41
+
42
+ ### Execution rules and diagnostics
43
+
44
+ - **Tool concurrency.** Within a single assistant turn, tools fall into three modes:
45
+ - **Exclusive:** `codemode` acts as a turn barrier—it waits for earlier tool calls to finish and blocks later calls until it completes.
46
+ - **Sequential:** `edit`, `write`, `todo`, `ask_user_question`, and `bash` or `powershell` with `pty: true` run one at a time in call order.
47
+ - **Parallel:** `read`, `find`, `search`, `ls`, `kill`, `tool_search`, non-PTY shell commands, MCP tools, and web-access tools can run in parallel.
48
+ - **Interrupting stuck tools.** When you interrupt a turn (for example with `Esc`), Atomic waits up to **10 seconds** for a tool call that ignores cancellation to stop before abandoning it with an `Operation aborted` error and discarding any late return. Override this grace period in milliseconds with `ATOMIC_TOOL_ABORT_GRACE_MS` (up to `2147483647`; `0` skips waiting).
49
+ - **Inspecting active tools.** Run `/tools` to see active tools, why inactive tools are off, and any unrecognized names in `defaultTools`. Its **Git** section reports which `git` binary Atomic uses (`system`, `provisioned` portable Git, or `unavailable` with an install command) and any failed portable Git update. See [Git](/getting-started/installation#git). SDK and RPC clients get the same report from [`session.getToolStatus()`](/sdk/reference#checking-tool-status) and [`get_tools`](/rpc/protocol#get_tools).
50
+ - **Malformed tool arguments.** If a model produces invalid or truncated JSON arguments, Atomic rejects the call without executing a partial request and returns the original arguments so the model can retry.
23
51
 
24
52
  ## Enabling and restricting tools
25
53
 
@@ -38,8 +66,8 @@ Control which tools a session exposes from the CLI, settings, SDK, or extensions
38
66
 
39
67
  It supports two mutually exclusive call modes:
40
68
 
41
- 1. **Read a target:** pass `path` (required), plus optional `wait` (used for `history://` URLs; ignored for local files, directories, archives, SQLite, and web URLs).
42
- 2. **Wait on an existing background history read:** pass `action: "wait"`, `id` (the task ID returned earlier, such as `"history-3"`), and optional `budgetMs` (milliseconds; omit to use the default 10-second wait, or pass `0` to check immediately). Do not combine `action: "wait"` with `path` or `wait`.
69
+ 1. **Read a target:** pass `path` (required), plus optional `wait` (used only for `history://` URLs; ignored for local files, directories, archives, SQLite, and web URLs).
70
+ 2. **Wait on a background history read:** pass `action: "wait"`, `id` (the task ID returned earlier, such as `"history-3"`), and optional `budgetMs` (milliseconds; omit for the default 10-second wait, or pass `0` to check immediately). Do not combine `action: "wait"` with `path` or `wait`.
43
71
 
44
72
  ```json
45
73
  { "path": "src/example.ts:10-40" }
@@ -57,7 +85,11 @@ It supports two mutually exclusive call modes:
57
85
  { "action": "wait", "id": "history-3", "budgetMs": 15000 }
58
86
  ```
59
87
 
60
- - **Observation options (`wait`, `action: "wait"`).** On a `history://` read, omitting `wait` (or passing `wait: { kind: "foreground" }` without `budgetMs`) waits up to 10 seconds by default before continuing in the background and returning a `history-N` task ID. Pass `wait: { kind: "background" }` to return immediately with a task ID, or `wait: { kind: "foreground", budgetMs }` to wait up to `budgetMs` milliseconds (`budgetMs` inside `wait` is valid only with `kind: "foreground"`). Omitted optional fields sent as `null` (for example by strict-schema tool callers) are treated as omitted. See [Slow history searches](/sessions#slow-history-searches) and [Background history searches](/background-tasks#background-history-searches).
88
+ On a `history://` read, omitting `wait` (or passing `wait: { kind: "foreground" }` without `budgetMs`) waits up to 10 seconds before continuing in the background and returning a `history-N` task ID. Pass `wait: { kind: "background" }` to return a task ID immediately, or `wait: { kind: "foreground", budgetMs }` to wait up to `budgetMs` milliseconds (`budgetMs` inside `wait` is valid only with `kind: "foreground"`). Passing `null` for optional fields works the same as omitting them.
89
+
90
+ <Note>
91
+ Background `history-N` tasks are process-local: unlike shell tasks, they do not appear in `/tasks`, and they are cancelled without a completion notice if the session closes or `/reload` runs. See [Slow history searches](/sessions#slow-history-searches) and [Background tasks](/background-tasks).
92
+ </Note>
61
93
 
62
94
  Reading a directory returns a depth-2 tree sorted by most-recent modification time (with sizes and ages). It prunes `.git` and `node_modules` and caps each child directory at 12 entries while preserving the oldest shown entry with an elision marker.
63
95
 
@@ -66,10 +98,14 @@ Reading a directory returns a depth-2 tree sorted by most-recent modification ti
66
98
  For local text files, `read` returns plain text with LF line endings, no per-line numbers, and no trailing newline. Existing file or directory names take priority over selector parsing (so `notes:0` or `build:12` reads that literal file when it exists). Otherwise, a trailing `:...` is parsed as a selector:
67
99
 
68
100
  - **Line selectors.** Supported forms are `file.ts:5-16`, `file.ts:L5-L16`, `file.ts:5..16`, `file.ts:5+3` (start plus count), `file.ts:5-` or `file.ts:5` (line 5 to end of file without widening), `file.ts:5:16` (colon range or grep-style `file:LINE:COL`), comma-separated ranges (`file.ts:5-16,960-973`), and URL line ranges (`https://example.test/page:5-8`). Line numbers are 1-indexed (`:0` fails with an error), and adjacent or overlapping ranges sort and merge automatically. Bounded reads add 1 leading and 3 trailing context lines, prefix each slice with `[Lines 9-14 of 40]`, and end limited reads with the continuation selector. Append `:raw` for exact bytes, CRLF endings, or raw notebook JSON without labels. Out-of-range selectors report beyond EOF. On `history://sessions/<id>:A-B`, numbers select 1-indexed session entries rather than lines.
69
- - **Oversized selected ranges.** If an explicit selected range exceeds 50,000 characters (or 50 KiB for archive, SQLite, document, internal resource, or URL selectors), `read` stops with an error (`isError: true`) and asks for a narrower range or byte slice instead of silently truncating.
70
- - **Images.** `read` detects supported image files, resizes them automatically by default (`autoResizeImages: true`, matching the active model's resize profile), and returns an image block. If the active model does not accept image inputs, the result sets `details.imageUnsupportedByModel`.
71
- - **Archives (`read`, `search`, `write`).** Supports `.zip`, `.jar`, `.tar`, `.tgz`, `.tar.gz`, and `.gz` members without Python. Limits are 256 MiB per tar archive, 64 MiB per member, and 500 entries per directory listing. Member names may contain `raw`, `conflicts`, `1`, `L1`, or `raw:notes.txt`. Archive writes reject directory targets ending in `/`. Tar writes preserve all other members and file modes and refuse to overwrite links, directories, duplicate members, or damaged headers.
72
- - **SQLite (`read`, `search`, `write`).** Supports `.sqlite`, `.sqlite3`, `.db`, and `.db3` files (including Windows drive paths). Select tables and rows with `limit`, `offset`, `where`, `order`, `schema`, `sampleRows` (or `sample_rows`), and `id`. Non-SQLite files with those extensions are treated as plain files.
101
+ - **Oversized reads (blocking vs. truncation).** Local text reads—both unselected whole-file reads and explicit line ranges—stop with an error when the output exceeds **50,000 characters**, asking for a narrower line range or byte slice rather than silently truncating. Head truncation at 3,000 lines or 50 KiB applies only when the read stays within 50,000 characters (for example, more than 3,000 short lines or multi-byte UTF-8 exceeding 50 KiB inside 50,000 characters). Archive, SQLite, document, and internal-URL reads also stop with an error whenever the unselected or selected text exceeds 50,000 characters or 50 KiB. Only unselected HTTP(S) URL reads truncate automatically (see [Documents and URLs](#documents-and-urls)).
102
+ - **Images.** `read` detects supported image files, resizes them automatically by default to match the active model's resize profile, and returns an image block. If the active model does not accept images, Atomic warns you and sends a placeholder instead.
103
+ - **Archives (`read`, `search`, `write`).** Supports `.zip`, `.jar`, `.tar`, `.tgz`, `.tar.gz`, and `.gz` (gzipped tar archives only—not standalone single-file `.gz` streams) without Python. Limits are 256 MiB per tar archive, 64 MiB per member, and 500 entries per directory listing. ZIP reading supports stored and deflate entries; ZIP selective writes reject entries with data descriptors. Tar rejects sparse files and base-256 numeric fields, and tar writes preserve other members and file modes while refusing to overwrite links, directories, duplicate members, or damaged headers. Member names may contain `raw`, `conflicts`, `1`, `L1`, or `raw:notes.txt`. Archive writes reject directory targets ending in `/`.
104
+ - **SQLite (`read`, `search`, `write`).** Supports `.sqlite`, `.sqlite3`, `.db`, and `.db3` files (including Windows drive paths). Non-SQLite files with those extensions are treated as plain files. See [SQLite limits and writes](#sqlite-limits-and-writes) for syntax and examples.
105
+
106
+ <Note>
107
+ **Workspace containment.** Archive selectors (`archive.zip:member`) and SQLite selectors (`app.db:users`)—like `local://`—must stay inside the current working directory and reject any path outside it, even through symlinks. Ordinary file paths in `read`, `write`, and `search` are not restricted to the working directory.
108
+ </Note>
73
109
 
74
110
  ### Internal URLs and web schemes
75
111
 
@@ -78,20 +114,35 @@ Each URL scheme has a fixed set of supported tools and permissions:
78
114
  | Scheme | Supported tools | Access | Purpose |
79
115
  | --- | --- | --- | --- |
80
116
  | `local://` | `read`, `search`, `write`, `find`, `bash` | Read and write | Workspace-relative local resources mapped to their underlying filesystem paths. |
81
- | `skill://` | `read`, `search`, `find`, `bash` | Read-only | Loaded skills by name, as the model's skill list shows them: `skill://tdd` is the skill's `SKILL.md`, `skill://tdd/references/guide.md` is a file in its folder, and `skill://tdd:10-40` is a few lines. A plain name means the winning skill when two share it; `skill://tdd@user` picks one. See [Skill addresses](/skills#skill-addresses). Edit skills where they are stored. |
82
- | `artifact://<id>` | `read`, `search`, `find`, `bash` | Read-only | Saved tool output artifacts. |
117
+ | `skill://` | `read`, `search`, `find`, `bash` | Read-only | Loaded skills by name: `skill://tdd` reads the skill's `SKILL.md`, `skill://tdd/references/guide.md` reads a bundled file, and `skill://tdd:10-40` selects lines. A plain name resolves the winning skill; `skill://tdd@user` picks a specific scope. Whole reads of `skill://<name>` (no subpath, range, or `:raw`) prepend `Base directory for this skill: skill://<name>/`. See [Skill addresses](/skills#skill-addresses). |
118
+ | `artifact://<id>` | `read`, `search`, `find`, `bash` | Read-only | Saved tool output artifacts (such as full text from truncated URL reads). |
83
119
  | `conflict://` | `read`, `search`, `write` | Read and write | Inspect and resolve Git merge conflicts under the working directory (individual sides are read-only; rejected by `find`; stays literal in `bash`). |
84
- | `history://` | `read`, `search` | Read-only | Past sessions for this project ([Recalling earlier work](/sessions#recalling-earlier-work)) (rejected by `find` and `write`; stays literal in `bash`). |
85
- | `tool-output://<sha256>` | `read`, `search` | Read-only | Persisted session-blob tool output, including line ranges like `tool-output://<sha256>:1-200` (rejected by `find` and `write`; stays literal in `bash`). |
120
+ | `history://` | `read`, `search` | Read-only | Past sessions for this project ([Recalling earlier work](/sessions#recalling-earlier-work); rejected by `find` and `write`; stays literal in `bash`). |
121
+ | `tool-output://<sha256>` | `read`, `search` | Read-only | Persisted tool output stored in a blob-capable session store, including line ranges like `tool-output://<sha256>:1-200` (rejected by `find` and `write`; stays literal in `bash`). |
86
122
  | `http://`, `https://` | `read` | Read-only | Public web pages (rejected by `search` and `write`; stays literal in `bash`). |
87
123
 
88
- Any other `scheme://` is rejected by `read`, `search`, and `write`, and stays literal text in `bash`. `local://` paths cannot leave the workspace, even through symlinks, and `skill://` paths cannot leave the skill's folder. Cancelling `read` or `find` throws `FileToolAbortedError` (see [Edit and write errors](#edit-and-write-errors)).
124
+ Any other `scheme://` is rejected by `read`, `search`, and `write`, and stays literal text in `bash`. `local://` paths cannot leave the workspace (even through symlinks), and `skill://` paths cannot leave the skill's folder.
89
125
 
90
126
  ### SQLite limits and writes
91
127
 
92
- - **Read limits.** Table reads return the schema plus 5 sample rows by default (`sampleRows` or `sample_rows` clamps from `0` to `100`, `schema=true` or `schema=1` requests schema output, `order=col:asc,col2:desc` sets sort order defaulting to `asc`, and `id` aliases `:rowId`). Query reads default to 20 rows (max 500). Raw `?q=` accepts a single `SELECT` statement only (max 1,000 rows) and blocks `sqlite_%`, `pragma_*`, `ATTACH`, `DETACH`, `UNION`, `INTERSECT`, `EXCEPT`, `INSERT`, `UPDATE`, `DELETE`, `DROP`, `ALTER`, `CREATE`, `REPLACE`, `VACUUM`, `REINDEX`, `load_extension`, comments (`--` and `/*`), and `;`. Table listings cap at 500 (excluding `sqlite_%`); row counts probe up to 50,001 rows.
93
- - **Writes.** Table writes accept `{}` (`INSERT DEFAULT VALUES`). Row writes accept non-empty JSON5 objects (unquoted keys, single quotes, comments, trailing commas, `+`, and hex numbers) and validate columns and scalar values. Empty row writes delete only when a row ID is specified.
94
- - **Row addressing.** Target a row by primary key (`data.sqlite:users:42`), `rowid` (tables without a primary key), or a full JSON array for composite keys (`data.sqlite:members:["acme",2]`; partial keys are rejected). Row IDs are never misread as line ranges (`data.sqlite:events:2024-01-05`), untyped key columns match numeric IDs numerically, and any update or delete affecting more than 1 row is aborted.
128
+ Use colon and query selectors to inspect tables, filter rows, run read-only SQL, or write individual rows:
129
+
130
+ ```json
131
+ { "path": "data/app.db:users?where=active=1&order=created_at:desc&limit=10" }
132
+ ```
133
+
134
+ ```json
135
+ { "path": "data/app.db?q=SELECT id, email FROM users WHERE active = 1 LIMIT 20" }
136
+ ```
137
+
138
+ ```json
139
+ { "path": "data/app.db:users:42" }
140
+ ```
141
+
142
+ - **Read limits.** Reading a table (`app.db:users`) returns its schema plus 5 sample rows by default. Supported query parameters are `limit` (max `500`), `offset`, `where`, `order` (`col:asc,col2:desc`, defaulting to `asc`), `schema=true` (or `1`), `sampleRows` / `sample_rows` (clamped `0` to `100`), and `id` (aliases `:rowId`). Query reads default to 20 rows (max `500`). Table listings cap at 500 (excluding `sqlite_%`); row counts probe up to 50,001 rows.
143
+ - **Query and filter safety.** Raw `?q=` accepts a single `SELECT` statement (max `1,000` rows). Both `?q=` and `where=` block `sqlite_%`, `pragma_*`, `ATTACH`, `DETACH`, `UNION`, `INTERSECT`, `EXCEPT`, `load_extension`, comments (`--`, `/*`, `*/`), and `;`. Raw `?q=` also blocks mutating DDL/DML (`INSERT`, `UPDATE`, `DELETE`, `DROP`, `ALTER`, `CREATE`, `REPLACE`, `VACUUM`, `REINDEX`), and `where=` also blocks `SELECT`, `LIMIT`, `OFFSET`, and `PRAGMA`.
144
+ - **Writes.** Table writes (`write` to `app.db:users`) accept `{}` (`INSERT DEFAULT VALUES`) or a JSON5 object (unquoted keys, single quotes, comments, trailing commas, `+`, and hex numbers) with valid column names and scalar values. On table inserts, a JSON `"id"` key automatically maps to a single primary key column of another name. Row writes (`app.db:users:42`) update that row; empty content deletes the row only when a row ID is specified. SQLite writes reply `Inserted row into <table>`, `Updated row ...`, or `Deleted row ...`.
145
+ - **Row addressing.** Target a row by primary key (`data.sqlite:users:42`), `rowid` (tables without a primary key), or a JSON array for composite keys (`data.sqlite:members:["acme",2]`; partial keys are rejected). Row IDs are never misread as line ranges (`data.sqlite:events:2024-01-05`), untyped key columns match numeric IDs numerically, and any update or delete affecting more than 1 row is aborted.
95
146
 
96
147
  ### Conflict resolution and file writes
97
148
 
@@ -102,9 +153,13 @@ Any other `scheme://` is rejected by `read`, `search`, and `write`, and stays li
102
153
  ### Documents and URLs
103
154
 
104
155
  - **Formats.** Extracts readable text from HTML URLs, Jupyter notebooks (0-based `cell:N` IDs, preserving unknown fields), and PDF, `.doc`, `.docx`, `.ppt`, `.pptx`, `.xls`, `.xlsx`, `.rtf`, and `.epub` documents (including extensionless downloads identified by `Content-Type`).
105
- - **URL fetching.** Public HTTP(S) fetches use a 10-second timeout, follow up to 5 redirects, cap response bodies at 10 MiB, and keep a session-scoped cache of 100 entries. Atomic checks for native markdown representations first (alternate `<link>`, `.md` suffix, `Accept: text/markdown`, `llms.txt`, and `llms.md`) and converts HTML to markdown otherwise.
106
- - **Output caps.** Unselected local text reads cap at 3,000 lines or 50 KiB; unselected URL reads cap at 300 rendered lines or 50 KiB (truncated with metadata rather than blocked). Explicit selected ranges over 50,000 characters (or 50 KiB for resource selectors) stop with an error instead of truncating. Successful reads populate `details.meta.source`, `sourcePath`, `truncation`, and `limits`.
107
- - **Network safety.** Blocks private, localhost, cloud-metadata, multicast, and reserved IP targets (including alternate numeric IPv4 and IPv6 forms and redirects). Use public URLs.
156
+ - **URL normalization and fetching.** `read` accepts `http://`, `https://`, bare `www.*` URLs (defaulting to `https://`), and repairs collapsed single-slash schemes (`https:/example.com`). Fetches use a 10-second timeout, follow up to 5 redirects, cap response bodies at 10 MiB, and keep a session-scoped cache of 100 entries.
157
+ - **Markdown discovery.** For HTML pages, `read` first checks for a native markdown representation via an alternate `<link>` tag, a `.md` URL suffix, or `Accept: text/markdown` content negotiation. Otherwise it converts the HTML to markdown; only if conversion yields 100 characters or fewer or looks low-quality does it probe `llms.txt` / `llms.md` endpoints (including `/.well-known/llms.txt` and parent path segments).
158
+ - **Output caps and line ranges on URLs.** Unselected HTTP(S) URL reads cap at **300 rendered lines or 50 KiB** and truncate rather than blocking, saving the full output as an artifact (`Full output: artifact://<id>`). Passing a line range on a URL (`https://example.com/page:5-20`) bypasses the session cache, markdown discovery, and HTML-to-markdown conversion (falling back to plain HTML stripping), and blocks with an error if the selected range exceeds 50,000 characters or 50 KiB.
159
+
160
+ <Warning>
161
+ **Network safety.** `read` blocks private, `localhost`, `.localhost`, cloud-metadata, multicast, and reserved IP targets (including alternate numeric IPv4/IPv6 forms and redirects). Set `ATOMIC_ALLOW_PRIVATE_URL_READS=1` only when a workflow must read private URLs. By contrast, [`fetch_content`](/web-access#fetch-pages-and-media) allows direct local/private HTTP fetches while keeping private URLs out of third-party fallbacks.
162
+ </Warning>
108
163
 
109
164
  ## `edit`
110
165
 
@@ -122,12 +177,12 @@ Any other `scheme://` is rejected by `read`, `search`, and `write`, and stays li
122
177
 
123
178
  - **Unique, non-overlapping matches.** Each `oldText` must match exactly once against the current file (overlapping occurrences count: `}\n}` occurs twice in `}\n}\n}`). Edits match against the original file simultaneously and cannot overlap; merge adjacent changes into one edit.
124
179
  - **No prior `read` required.** Matches against the file's current bytes on disk, even if changed by `bash` or another process.
125
- - **Fallback normalization.** If no exact match exists, `edit` retries after applying NFKC normalization per grapheme cluster, stripping trailing whitespace per line, and mapping smart single quotes (`U+2018` through `U+201B` to `'`), smart double quotes (`U+201C` through `U+201F` to `"`), Unicode dashes (`U+2010` through `U+2015` and `U+2212` to `-`), and Unicode spaces (`U+00A0`, `U+2002` through `U+200A`, `U+202F`, `U+205F`, and `U+3000` to ASCII space). Normalization locates the region only; `newText` replaces that exact slice and leaves surrounding bytes untouched. A single exact match always wins over normalized matches.
126
- - **Encoding and line endings.** UTF-8 text only (invalid UTF-8 fails with `target-not-utf8`). `oldText` and `newText` cannot split surrogate pairs (`text-splits-character`). Preserves UTF-8 BOM and surrounding line endings (LF, CRLF, or lone CR when the file contains no LF at all); newlines in `newText` adopt the line ending where the match starts.
180
+ - **Fallback normalization.** If no exact match exists, `edit` retries after normalizing compatible Unicode variants (such as full-width characters, while keeping multi-code-point characters intact), stripping trailing whitespace per line, and mapping smart single quotes (`U+2018`–`U+201B` to `'`), smart double quotes (`U+201C`–`U+201F` to `"`), Unicode dashes (`U+2010`–`U+2015`, `U+2212` to `-`), and Unicode spaces (`U+00A0`, `U+2002`–`U+200A`, `U+202F`, `U+205F`, `U+3000` to ASCII space). Normalization locates the region only; `newText` replaces that exact slice and leaves surrounding bytes untouched. A single exact match always wins over normalized matches.
181
+ - **Encoding and line endings.** UTF-8 text only (invalid UTF-8 fails without modifying the file). `oldText` and `newText` cannot split surrogate pairs. Preserves UTF-8 BOM and surrounding line endings (LF, CRLF, or lone CR when the file contains no LF at all); newlines in `newText` adopt the line ending where the match starts.
127
182
  - **Atomicity.** Either all edits apply or the file stays unchanged.
128
183
  - **Notebooks.** `.ipynb` files are edited using the `# %% [code] cell:N` format shown by `read`, preserving cell metadata, outputs, and execution counts.
129
184
 
130
- Returns the replacement count plus `details` (`diff`, unified `patch`, and `firstChangedLine`). Interactive mode previews file diffs as soon as arguments arrive (notebook diffs appear with the result). See [Edit and write errors](#edit-and-write-errors) for typed error codes.
185
+ Interactive mode previews file diffs as soon as arguments arrive (notebook diffs appear with the result). See [Edit and write errors](#edit-and-write-errors) for typed error codes.
131
186
 
132
187
  ## `write`
133
188
 
@@ -154,90 +209,74 @@ Returns the replacement count plus `details` (`diff`, unified `patch`, and `firs
154
209
  { "action": "wait", "id": "task-1234", "budgetMs": 15000 }
155
210
  ```
156
211
 
157
- - **Observation and background yield (`wait`, `action: "wait"`).** `wait` controls how long the tool observes output and never changes the execution `timeout`. When `wait` is omitted (or `wait: { kind: "foreground" }` omits `budgetMs`) in interactive and standard sessions, Atomic yields automatically after 10 seconds by default while the command keeps running in the background. Pass `wait: { kind: "background" }` (without `budgetMs`) to return immediately with the task ID after the command starts, or `wait: { kind: "foreground", budgetMs }` to wait up to `budgetMs` milliseconds before yielding. Call `{ action: "wait", id, budgetMs? }` to observe an owned background task later (omitting `budgetMs` uses the default yield budget; `0` checks immediately). Omitted optional fields sent as `null` (for example by strict-schema tool callers) are treated as omitted, while non-null conflicting fields or invalid values are rejected. Background mode and task waits require sessions with background task support; standalone SDK sessions without background task support wait until the command finishes.
212
+ - **Observation and background yield (`wait`, `action: "wait"`).** `wait` controls how long the tool observes output and never changes the execution `timeout`. When `wait` is omitted (or `wait: { kind: "foreground" }` omits `budgetMs`) in interactive and standard sessions, Atomic yields automatically after 10 seconds while the command keeps running in the background. Pass `wait: { kind: "background" }` (without `budgetMs`) to return immediately with the task ID after the command starts, or `wait: { kind: "foreground", budgetMs }` to wait up to `budgetMs` milliseconds before yielding. Passing `null` for optional fields works the same as omitting them; non-null conflicting fields or invalid values are rejected. Background mode and task waits require a session with background task support (standalone SDK sessions without a task supervisor wait until the command finishes).
213
+ - **Incremental paging on `action: "wait"`.** Calling `{ action: "wait", id, budgetMs? }` (`0` checks immediately) on a **still-running** task reads incremental output from the last observed byte offset in **8 KiB pages** (printing `[Additional output not shown; wait again to retrieve retained output.]` if more output is already buffered). Once the task finishes, waiting reads the full retained output from byte 0.
158
214
  - **`cwd` and leading `cd`.** Sets the working directory for the command. If `cwd` is omitted, a leading `cd <path> && ...` or `cd <path>; ...` sets the working directory when `<path>` is a single literal word (optionally single- or double-quoted, with no variables, globs, or leading `-`). Unquoted `~` and `~/` expand to your home directory. Atomic skips stripping when `CDPATH` applies to a non-dot relative path or the local directory cannot be entered.
159
- - **`env` and session variables.** Adds or overrides environment variables for the command. Every key in `env` must match `^[A-Za-z_][A-Za-z0-9_]*$`; invalid names fail before spawning. Atomic automatically sets `ATOMIC_SESSION_ID`, `ATOMIC_PROVIDER`, `ATOMIC_MODEL`, and `ATOMIC_REASONING_LEVEL` (plus legacy `PI_*` aliases) and strips any caller-supplied values for those keys as well as `ATOMIC_SESSION_FILE` and `PI_SESSION_FILE`.
160
- - **How long a command runs, and `timeout`.** A command has no time limit: it runs until it finishes, someone stops it (`kill` or `/tasks`), or the session closes. How long the call waits (`wait`) never stops it. To give it a deadline, pass `timeout` in seconds: `{ "command": "npm run e2e", "timeout": 7200 }` stops it after 2 hours. The values work like this:
215
+ - **`env` and session variables.** Adds or overrides environment variables for the command. Every key must match `^[A-Za-z_][A-Za-z0-9_]*$`; invalid names fail before spawning. Atomic automatically sets `ATOMIC_SESSION_ID`, `ATOMIC_PROVIDER`, `ATOMIC_MODEL`, and `ATOMIC_REASONING_LEVEL` (and legacy `PI_*` aliases) and strips caller-supplied overrides for those keys plus `ATOMIC_SESSION_FILE` / `PI_SESSION_FILE`.
216
+ - **Execution `timeout`.** Commands have no time limit by default and run until they finish, someone stops them (`kill` or `/tasks`), or the session closes. `wait` never stops a command. Pass `timeout` in seconds to set a hard execution deadline:
161
217
 
162
- | `timeout` | What happens |
218
+ | `timeout` | Behavior |
163
219
  | --- | --- |
164
- | left out | No time limit. The command runs until it finishes or is stopped. Use this for dev servers and watchers. |
165
- | a positive number, such as `7200` | The command is stopped after that many seconds. There is no upper limit. |
166
- | `0` or a negative number, such as `-1` | Refused before the command starts. Leave `timeout` out instead if you want no limit. |
220
+ | Omitted | No time limit. Runs until completion, `kill` / `/tasks`, or session close. |
221
+ | Positive number (e.g. `7200`) | Stops the command after that many seconds. No upper limit. |
222
+ | `0` or negative number | Refused before starting (`Invalid timeout ...`). Omit `timeout` for no limit. |
167
223
 
168
- A refused value shows: `Invalid timeout 0: timeout must be a positive number of seconds. Leave timeout out for no time limit.`
169
-
170
- `timeout` only decides when a command is stopped. To check on a command without waiting, use `wait` instead: `{ "action": "wait", "id": "<task id>", "budgetMs": 0 }` returns its current output at once. Before this release a command stopped after 300 seconds by default and could ask for 3600 seconds at most; both limits are gone. See [How long a command runs](/background-tasks#background-shells).
171
- - **At most 64 at once.** A session runs up to 64 commands at the same time, its subagents' shells included. At that limit a new command is refused with `64 commands are already running in this session, the most it runs at once. Stop one you no longer need with kill or /tasks, or wait for one to finish, then run this command again.` Nothing running is stopped to make room. See [How many commands run at once](/background-tasks#how-many-commands-run-at-once).
172
- - **`pty: true`.** Runs the command in the bundled native PTY. In interactive and standard sessions, native PTY errors fail the call rather than silently falling back to pipes; standalone SDK sessions without background task support fall back to pipes if the native PTY is unavailable. Set `ATOMIC_NO_PTY=1` to force pipes (`ATOMIC_NO_PTY=0` overrides a legacy `PI_NO_PTY=1`).
173
- - **`heartbeatMs`.** Background [task heartbeat](/background-tasks#task-heartbeats) interval in milliseconds (defaults to `tasks.heartbeatMs` or 15 minutes; `0` disables; minimum `60000`).
174
-
175
- Model-facing output truncates at 3,000 lines or 50 KiB with `Full output: <path>`. Structured output (used by codemode) keeps up to 1 MiB (the first and last 512 KiB around an omission marker if longer). Foreground results include `timeoutSeconds` (only when `timeout` was set), `requestedTimeoutSeconds`, `wallTimeMs`, non-zero `exitCode`, and `fullOutputPath` when truncated.
224
+ - **Concurrency cap (64 commands).** A session runs up to **64** shell commands concurrently (including subagents' shells). Additional commands fail with an error until an active command finishes or is stopped; nothing running is stopped to make room.
225
+ - **`pty: true`.** Runs the command in the bundled native PTY. In interactive and standard sessions, native PTY errors fail the call rather than silently falling back to pipes; unbound standalone SDK sessions fall back to pipes if the native PTY is unavailable. Set `ATOMIC_NO_PTY=1` to force pipes (see [Environment variables](/environment-variables)). On Windows with a WSL stdin-transport bash shell, supervised execution fails with `ContainmentUnavailable: run Atomic inside WSL to supervise Linux guest commands`.
226
+ - **`heartbeatMs`.** Background task heartbeat interval in milliseconds (defaults to `tasks.heartbeatMs` or 15 minutes; `0` disables; minimum `60000`). See [Background tasks reference](/background-tasks/reference).
227
+ - **Tail truncation.** Model-facing output keeps the **last** 3,000 lines or 50 KiB (truncating an oversized trailing line to its final 50 KiB) and writes `[Showing lines ... Full output: <path>]`. Structured output returned to codemode keeps up to 1 MiB (first and last 512 KiB around an omission marker if longer).
176
228
 
177
229
  ### Long-running servers and watchers
178
230
 
179
- A dev web server, a file watcher, a local database, or a tunnel can run for as long as you work. Start it in the background:
180
-
181
- ```json
182
- { "command": "npm run dev", "wait": { "kind": "background" } }
183
- ```
184
-
185
- The call returns at once with a task ID such as `task-1-0-5`. Nothing stops the server on a timer: it runs until you stop it with `kill`, it exits on its own, or the session ends.
186
-
187
- - **Check its output** with a short wait, which leaves it running: `{ "action": "wait", "id": "task-1-0-5", "budgetMs": 1000 }`.
188
- - **Stop it** with `kill({ id: "task-1-0-5" })`, or from `/tasks`.
189
- - **It counts toward the 64 commands** a session runs at once, for as long as it runs.
190
- - **When the session ends**, Atomic stops it and the processes it started. Resuming the session does not start it again; the chat shows `Background shell stopped (session closed)` for it, and you run it again if you still need it.
191
-
192
- See [Long-running servers and watchers](/background-tasks#long-running-servers-and-watchers).
231
+ Start dev servers, file watchers, local databases, or tunnels with `wait: { kind: "background" }`. They run with no timeout until you stop them with `kill({ id })` or `/tasks`, they exit, or the session closes (resuming a session does not restart prior servers). They count toward the 64-command limit while active. See [Background tasks](/background-tasks) for day-to-day management and `/tasks` controls.
193
232
 
194
233
  **Internal URL expansion (`skill://`, `local://`, `artifact://`):**
195
- - Only unquoted URLs starting a plain shell word expand to shell-quoted filesystem paths (for example `printf %s local://notes.txt`, or `bash skill://my-skill/scripts/check.sh` to run a script that ships with a skill). Other schemes (`conflict://`, `history://`, `tool-output://`, `http://`, `https://`) stay literal text.
196
- - URLs inside quotes, heredocs, comments, escapes, command substitutions, or directly after `$`, `[`, or quotes stay verbatim. Expansion also stops after the first `((`, `=(`, or non-test `[` (arithmetic, array subscripts, compound assignments). In PowerShell, typographic single and double quotes (`U+2018` to `U+201B` and `U+201C` to `U+201F`), `<#...#>` block comments, and anything after `--%` are not expanded.
197
- - Structured `cwd` and `env` values always expand supported URLs.
198
- - Avoid combining URL expansion with custom command prefixes or spawn wrappers that leave quotes, substitutions, or heredocs open; pass paths in structured `cwd` or `env` instead.
234
+
235
+ - Only unquoted URLs starting a plain shell word expand to shell-quoted filesystem paths (for example `bash skill://my-skill/scripts/check.sh` or `printf %s local://notes.txt`). Other schemes (`conflict://`, `history://`, `tool-output://`, `http://`, `https://`) stay literal text.
236
+ - URLs inside quotes, heredocs, comments, escapes, command substitutions, or directly after `$`, `[`, or quotes stay verbatim. Expansion also stops after the first `((`, `=(`, or non-test `[`. In PowerShell, typographic single quotes (`U+2018`–`U+201B`), typographic double quotes (`U+201C`–`U+201E`), `<#...#>` block comments, and anything after `--%` are not expanded.
237
+ - Structured `cwd` and `env` values always expand supported URLs. When using custom command prefixes or spawn wrappers, pass URLs in `cwd` or `env` instead of relying on inline command expansion.
199
238
 
200
239
  ### PowerShell
201
240
 
202
- On native Windows, Atomic enables the `powershell` tool automatically when `pwsh.exe` or `powershell.exe` resolves on `PATH`. It accepts the same parameters and wait modes as `bash`, preferring PowerShell 7 and falling back to Windows PowerShell 5.1. A PowerShell command has no time limit either, takes the same optional `timeout`, and counts toward the same 64 commands a session runs at once.
241
+ On native Windows, Atomic enables `powershell` automatically when `pwsh.exe` or `powershell.exe` resolves on `PATH`, preferring PowerShell 7 and falling back to Windows PowerShell 5.1. It takes the same parameters, wait modes, optional `timeout`, and 64-command concurrency pool as `bash`.
203
242
 
204
- - Resolved paths use PowerShell single-quoted literals (doubling ASCII apostrophes and `U+2018` to `U+201B` smart single quotes). `bash` always uses POSIX quoting, even on Windows.
205
- - Redirected stderr on a successful native command (such as `git push 2>&1 | Select-Object -Last 3`) still reports success. Failed final statements report failure, and scripts can return an explicit status with `exit <code>`.
243
+ - Resolved paths use PowerShell single-quoted literals (doubling ASCII apostrophes and `U+2018`–`U+201B` smart single quotes). `bash` always uses POSIX quoting, even on Windows.
244
+ - PowerShell commands force UTF-8 console output (`[Console]::OutputEncoding`). Redirected stderr on a successful native command (such as `git push 2>&1 | Select-Object -Last 3`) still reports success; on Windows PowerShell 5.1, this exit-status handling is skipped if the command ends with a trailing backtick (`` ` ``).
245
+ - Unlike `bash`, standalone SDK PowerShell sessions do **not** fall back to pipes if the native PTY fails.
206
246
 
207
247
  ## `kill`
208
248
 
209
- `kill({ id: taskId })` stops a task that is running in the background. It works on two kinds of task:
249
+ `kill({ id: taskId })` stops a background task started in the current session:
210
250
 
211
- - A shell command started by `bash` or `powershell`, including one that moved to the background on its own after the default wait.
212
- - A slow `read` or `search` of past sessions, with an ID such as `history-3`. See [Slow history searches](/sessions#slow-history-searches).
251
+ - A shell command started by `bash` or `powershell`, including one that yielded to the background after the default wait.
252
+ - A slow `history://` `read` or `search` task (with an ID such as `history-3`).
213
253
 
214
- Pass the task ID exactly as the tool returned it, not a process ID. `kill` works only in the session that started the task, and it never stops subagents or another session's tasks. Stopping a history task replies `History search history-3 was stopped; it no longer reads the session store.` and sends no completion notice.
254
+ Pass the task ID returned by the tool, not an OS process ID. `kill` never stops subagents or another session's tasks. Stopping a history task replies `History search <id> was stopped; it no longer reads the session store.` and sends no completion notice.
215
255
 
216
- For a shell task, `kill` returns the cancellation decision plus execution and cleanup state. A cancellation request does not guarantee immediate termination; repeated calls preserve the first decision, finished tasks keep their outcome, and cleanup errors are reported explicitly. See [Stop a shell task from a tool call](/background-tasks#stop-a-shell-task-from-a-tool-call).
256
+ For a shell task, `kill` returns the cancellation decision plus execution and cleanup state. A cancellation request does not guarantee immediate termination; repeated calls preserve the first decision, finished tasks keep their outcome, and cleanup errors are reported explicitly. See [Background tasks](/background-tasks).
217
257
 
218
258
  ## `find` and `search`
219
259
 
220
- Use `find` to locate paths by glob and `search` to match file contents by regular expression.
260
+ Use `find` to locate paths by glob and `search` to match file and resource contents by regular expression.
221
261
 
222
262
  ### Finding paths
223
263
 
224
- `find` takes a required non-empty `paths` string array (unlike `search`, it does not accept a bare string), plus optional `hidden` (default `true`), `gitignore` (default `true`), `limit` (default `200`, clamped from `1` to `200`), and `timeout` (default `5` seconds, clamped from `0.5` to `60`).
264
+ `find` requires a non-empty `paths` string array (unlike `search`, it does not accept a bare string), plus optional `hidden` (default `true`), `gitignore` (default `true`), `limit` (default `200`, clamped `1`–`200`), and `timeout` (default `5` seconds, clamped `0.5`–`60`).
225
265
 
226
- Entries in `paths` can be files, directories (including filesystem roots), globs, or `local://`, `skill://`, and `artifact://` selectors. A `skill://<name>` selector with a glob (such as `skill://tmux/**/*.sh`) searches the skill directory rather than `SKILL.md`. Virtual schemes (`history://`, `conflict://`, and `tool-output://`) are rejected with an error directing you to `read` or `search`.
266
+ Entries in `paths` can be files, directories (including filesystem roots), globs, or `local://`, `skill://`, and `artifact://` selectors. A `skill://<name>` selector with a glob (such as `skill://tmux/**/*.sh`) searches the skill folder rather than `SKILL.md`. Virtual schemes (`history://`, `conflict://`, `tool-output://`) are rejected with an error directing you to `read` or `search`.
227
267
 
228
268
  - **Anchoring and case.** Relative globs start at `cwd` (`src/**/*.ts` searches `src/`; `**/src/**/*.ts` searches any nested `src/`). Rooted globs (`/**/*.ts`, `C:\**\*.ts`, `\\server\share\**\*.ts`) search that root. Glob matching is case-sensitive on every platform (`*.ts` never matches `A.TS`).
229
269
  - **Defaults and pruning.** Includes hidden files and respects nested `.gitignore` rules by default. Prunes `.git` and `node_modules` even with `gitignore: false` (name `node_modules` explicitly to scan it).
230
270
  - **Literal glob characters.** If a path exists verbatim on disk (such as `app/[id]/page.tsx`), it matches literally. Otherwise escape `[`, `]`, `*`, `?`, `{`, or `}` with `\` (`app/\[id\]/*.tsx`); on Windows and UNC paths `\` is always a separator, so only the exact-path rule applies.
231
- - **Path splitting.** Strips surrounding quotes. Existing paths with spaces, commas, or semicolons stay intact; otherwise comma or semicolon lists split if any part resolves, and whitespace lists split only if every part resolves.
232
-
233
- Returns `scopePath`, `fileCount`, `files`, truncation and missing-path metadata, and streaming progress snapshots.
271
+ - **Path splitting and missing paths.** Strips surrounding quotes. Existing paths with spaces, commas, or semicolons stay intact; otherwise comma or semicolon lists split if any part resolves, and whitespace lists split only if every part resolves. When multiple targets are passed, missing paths are skipped and noted instead of failing the call; a single missing target errors.
272
+ - **Output and sorting.** Formats results as a Markdown heading tree with collapsed single-child directories (`# a/b/\nfile.ts`), sorts native results by most-recent modification time before applying `limit`, and caps output at 50 KiB.
234
273
 
235
274
  ### Searching contents
236
275
 
237
276
  `search` searches file and resource contents with a regular expression and can observe background `history://` searches using the same `wait` and `action: "wait"` model as `bash` and `read`. It supports two mutually exclusive call modes:
238
277
 
239
278
  1. **Search contents:** pass `pattern` (required), plus optional `paths` (string or string array; omitted or empty searches `.`), `i` (boolean), `case` (boolean), `gitignore` (default `true`), `skip` (non-negative integer or `null`, floored; ignored in single-file mode), and `wait` (used when `paths` includes a `history://` URL). Hidden files are searched by default.
240
- 2. **Wait on an existing background history search:** pass `action: "wait"`, `id` (such as `"history-3"`), and optional `budgetMs` (omit to use the default 10-second wait, or pass `0` to check immediately). Do not combine `action: "wait"` with search fields (`pattern`, `paths`, `i`, `case`, `gitignore`, `skip`, or `wait`).
279
+ 2. **Wait on a background history search:** pass `action: "wait"`, `id` (such as `"history-3"`), and optional `budgetMs` (omit for the default 10-second wait, or pass `0` to check immediately). Do not combine `action: "wait"` with search fields (`pattern`, `paths`, `i`, `case`, `gitignore`, `skip`, or `wait`).
241
280
 
242
281
  ```json
243
282
  { "pattern": "connection refused", "paths": "history://sessions" }
@@ -247,20 +286,16 @@ Returns `scopePath`, `fileCount`, `files`, truncation and missing-path metadata,
247
286
  { "pattern": "connection refused", "paths": "history://sessions", "wait": { "kind": "background" } }
248
287
  ```
249
288
 
250
- ```json
251
- { "pattern": "connection refused", "paths": "history://sessions", "wait": { "kind": "foreground", "budgetMs": 30000 } }
252
- ```
253
-
254
289
  ```json
255
290
  { "action": "wait", "id": "history-3", "budgetMs": 15000 }
256
291
  ```
257
292
 
258
- - **Slow history searches and reads.** For a `history://` target, `wait` works identically to `bash`: omitting `wait` (or passing `wait: { kind: "foreground" }`) waits 10 seconds by default, `wait: { kind: "background" }` returns a task ID immediately, and `wait: { kind: "foreground", budgetMs }` waits up to `budgetMs` milliseconds (`budgetMs` inside `wait` is valid only with `kind: "foreground"`). A call still running when the observation wait ends keeps running in the background with **no time limit** and returns a task ID such as `history-3`; its result arrives later as a completion notice. Wait for it with `search({ action: "wait", id: "history-3", budgetMs? })` (or `read({ action: "wait", id: "history-3", budgetMs? })` — both tools share the session's history tasks, and Atomic retains the 16 most recently finished tasks for late waits) or stop it with `kill({ id: "history-3" })`. Omitted optional fields sent as `null` are treated as omitted. A session runs at most 4 active history searches and reads at once (separate from the 64 shell commands); a call past that limit fails with `4 history searches and reads are already running in this session, the most it runs at once. Stop one you no longer need with kill, or wait for one to finish, then run this one again.` See [Slow history searches](/sessions#slow-history-searches) and [Background history searches](/background-tasks#background-history-searches).
259
- - **Targets.** Searches files, directories, globs, archive members, SQLite selectors (`.sqlite`, `.sqlite3`, `.db`, `.db3`), and supported internal URLs (`local://`, `skill://`, `artifact://`, `conflict://`, `history://`, `tool-output://`). Rejects `http://` and `https://`.
293
+ - **Slow history searches and reads.** On `history://` targets, `wait` works identically to `bash` and `read`: omitting `wait` waits 10 seconds before yielding, `wait: { kind: "background" }` returns a task ID immediately, and `wait: { kind: "foreground", budgetMs }` waits up to `budgetMs` ms. Running history tasks have **no time limit** and return a completion notice when finished. You can wait via either `search({ action: "wait", id })` or `read({ action: "wait", id })` (both share the session's history tasks, retaining the 16 most recently finished tasks for late waits) or stop one with `kill({ id })`. A session runs at most **4** active history searches/reads at once (separate from the 64 shell commands). History tasks are process-local, do not appear in `/tasks`, and cancel without completion notices on session close or `/reload`. See [Slow history searches](/sessions#slow-history-searches).
294
+ - **Targets and path splitting.** Searches files, directories, globs, archive members, SQLite selectors (`.sqlite`, `.sqlite3`, `.db`, `.db3`), and supported internal URLs (`local://`, `skill://`, `artifact://`, `conflict://`, `history://`, `tool-output://`). Rejects `http://` and `https://`. String `paths` values use the same comma, semicolon, and whitespace splitting rules as `find`; missing paths are skipped when multiple targets are supplied (a single missing target errors).
260
295
  - **Patterns and case sensitivity.** Whitespace-only patterns are rejected; all other patterns pass verbatim, including inline `(?i)`, `(?m)`, `(?s)`, and `(?x)` flags at the start of patterns on resource-backed selectors. Setting `i: true` or `case: false` enables case-insensitive matching (if both `i: true` and `case: true` are passed, case-insensitive matching wins).
261
- - **Line selectors.** Line-range selectors (`file.ts:10-50`) work on single files only (directories and globs fail with an error) and restrict matches before adding context lines.
262
- - **Paging and context.** Multi-file searches return 20 files per page (up to 20 matches per file), and `skip` paginates files in multi-file mode. Single-file searches return up to 200 matches. Pagination over internal and resource selectors collects at most 2,000 matches. Context defaults to 1 line before and 3 after (`search.contextBefore` and `search.contextAfter`).
263
- - **Limits and format.** Local files cap at 4 MiB and lines truncate at 512 characters. Output is plain text (`path:LINE: text` for matches, `path-LINE- text` for context). `fileLimitReached` and `meta.limits.fileLimit` indicate more pages.
296
+ - **Line selectors.** Line-range selectors work on single files only (directories and globs fail with an error) and restrict matches before adding context lines. Unlike `read`, `search` supports only `:N` (matches **only line N**, not N-to-EOF), `:A-B`, `:A..B`, `:A+C`, and comma-separated combinations; open-ended `:N-`, `L`-prefixed `:L5-L10`, and colon `:5:10` forms are rejected.
297
+ - **Paging, caps, and context.** Multi-file searches return 20 files per page (up to 20 matches per file), and `skip` paginates files in multi-file mode. Single-file searches return up to 200 matches. **Regular filesystem searches collect at most 2,000 matches before `skip` pagination** (refine the pattern or path if that cap is hit). Archive, SQLite, and internal-URL searches do not use the 2,000-match cap (SQLite tables default to 1,000 rows; `history://` uses its own byte/row/time budgets and cursor pagination). Context defaults to 1 line before and 3 after (`search.contextBefore` and `search.contextAfter`).
298
+ - **Limits and format.** Local files cap at 4 MiB, lines truncate at 512 characters, combined output caps at 50 KiB, and native filesystem grep uses a 30-second timeout. Output is plain text (`path:LINE: text` for matches, `path-LINE- text` for context).
264
299
 
265
300
  ## `ls`
266
301
 
@@ -271,19 +306,20 @@ Returns `scopePath`, `fileCount`, `files`, truncation and missing-path metadata,
271
306
 
272
307
  ## `todo`
273
308
 
274
- `todo` manages file-based task lists stored in `.atomic/todos` (override the directory with `ATOMIC_TODO_PATH` or legacy `PI_TODO_PATH`). Each task is a standalone `<hex>.md` file starting with a JSON frontmatter object (`id`, `title`, `tags`, `status`, `created_at`, and optional `assigned_to_session`) followed by optional markdown notes.
309
+ `todo` manages file-based task lists stored in `.atomic/todos` (override the directory with `ATOMIC_TODO_PATH`). Each task is a standalone `<hex>.md` file starting with a JSON frontmatter object (`id`, `title`, `tags`, `status`, `created_at`, and optional `assigned_to_session`) followed by optional markdown notes.
275
310
 
276
311
  - **IDs.** Task IDs are 8 lowercase hex characters (`^[a-f0-9]{8}$`, matched case-insensitively). Tasks display as `TODO-<hex>`, and `id` accepts `TODO-<hex>`, `#<hex>`, or the raw 8-hex string.
277
312
  - **Statuses and ordering.** New tasks default to `"open"`. Only `"closed"` and `"done"` (case-insensitive) count as closed; updating a task to `"closed"` or `"done"` clears `assigned_to_session` automatically. `list` returns open tasks sorted with assigned tasks first, then unassigned tasks by `created_at` ascending. `list-all` returns every task including closed ones.
278
313
  - **Locking.** While a session edits a task, Atomic creates a `<hex>.lock` file with a 30-minute lifetime. Within 30 minutes, conflicting writes fail immediately. After 30 minutes, interactive mode prompts to take over the stale lock while non-interactive mode fails with an error.
279
- - **Actions and parameters.** Required `action`: `list`, `list-all`, `get`, `create`, `update` (replaces `body` and updates fields), `append` (appends to `body`), `delete`, `claim` (assigns a task to the current session; pass `force: true` to override another session's assignment), and `release`. Optional parameters: `id`, `title`, `body`, `status`, `tags`, and `force`.
314
+ - **Actions and parameters.** Required `action`: `list`, `list-all`, `get`, `create`, `update` (replaces `body` and updates fields), `append` (appends to `body`), `delete`, `claim` (assigns an open task to the current session—fails on closed tasks; pass `force: true` to override another session's assignment), and `release` (clears assignment; pass `force: true` to release another session's assignment). Optional parameters: `id`, `title`, `body`, `status`, `tags`, and `force`. Validation and lock errors return plain text error messages in the tool result rather than throwing.
280
315
 
281
316
  ## `ask_user_question`
282
317
 
283
318
  When `ask_user_question` is enabled, the agent displays interactive multiple-choice and free-text prompts in the TUI for clarifications, preferences, and explicit confirmations instead of asking in plain chat text. `ask_user_question` is model-only and cannot be called inside codemode scripts.
284
319
 
285
- - **Limits and validation.** Each call accepts 1 to 4 questions with 2 to 4 options per question, `header` up to 16 characters, and option `label` up to 60 characters. Duplicate questions and duplicate option labels are rejected. Reserved labels (`"Other"`, `"Type something."`, `"Chat about this"`, and multi-select navigation labels) are rejected even on `multiSelect: true`.
320
+ - **Limits and validation.** Each call accepts 1 to 4 questions with 2 to 4 options per question, `header` up to 16 characters, and option `label` up to 60 characters. Duplicate questions and duplicate option labels are rejected. Reserved labels (`"Other"`, `"Type something."`, `"Chat about this"`, and `"Next"`) are rejected even on `multiSelect: true`.
286
321
  - **Multi-select and previews.** Pass `multiSelect: true` to let the user choose multiple options (this hides the custom `"Type something."` choice). On single-select questions, options can include a markdown `preview` rendered side by side (which also hides `"Type something."` while keeping `"Chat about this"`). See [Keybindings](/keybindings#tui-fullscreen-viewport) for dialog controls.
322
+ - **Custom prompt guidance.** Machine-level overrides in `~/.config/rpiv-ask-user-question/config.json` can customize `guidance.promptSnippet` and `guidance.promptGuidelines`.
287
323
  - **Scoped approvals.** A confirmation question should name the exact action, identify the target PRs or resources, and offer explicit proceed and decline choices:
288
324
 
289
325
  ```json
@@ -313,8 +349,6 @@ Disable it in `~/.atomic/agent/settings.json` or `.atomic/settings.json`:
313
349
 
314
350
  Disable it for one run with `atomic --tools -codemode`. Explicit allowlists must name every desired tool (for example `atomic --tools read,search,find,codemode`). MCP servers configured for codemode exposure activate `codemode` if `defaultTools` omits it, but not after an explicit `-codemode`.
315
351
 
316
- Example call (`codemode({ code: "..." })` supports top-level `await` and `return`):
317
-
318
352
  ```javascript
319
353
  // @options: {"max_output_tokens": 2000, "timeout_ms": 60000}
320
354
  const files = await Promise.all([
@@ -328,7 +362,7 @@ return files.map((text) => text.slice(0, 1000));
328
362
  - **Sandbox and permissions.** Runs with no Node, filesystem, network, timer, or credential globals. Tool calls run with the session's permissions, and side effects are not rolled back if a script fails.
329
363
  - **Settings and MCP.** Configure `codemode.inlineBudget` (default `3000` estimated tokens) and `codemode.mode` in [tool settings](/settings#tools). Atomic's [MCP host](/mcp-servers) remains the sole MCP connection owner.
330
364
 
331
- See the [Codemode reference](/codemode) for globals, return shapes, `store()` and `load()`, `models.classify()`, `models.generateImages()`, subagent and Intercom access, and limits.
365
+ See [Codemode](/codemode) for globals, return shapes, `store()` and `load()`, `models.classify()`, `models.generateImages()`, subagent and Intercom access, and limits.
332
366
 
333
367
  ## `tool_search`
334
368
 
@@ -353,22 +387,25 @@ code_search({ repoName: "facebook/react", query: "How does useEffect cleanup wor
353
387
 
354
388
  ## Persisted tool output
355
389
 
356
- Text tool results over 50,000 characters are saved automatically and replaced inline with a 2,000-byte preview inside `<persisted-output>` tags, referencing `Full output: <path>` (for `bash`) or `Full output saved to: <path>`. Tool results that contain images are not redirected.
390
+ Text tool results over 50,000 characters are saved automatically and replaced inline with a 2,000-byte head preview inside `<persisted-output>` tags referencing `Full output saved to: <path>`. Tool results containing images are not redirected. `bash` and `read` opt out of `<persisted-output>` (`bash` applies its own tail truncation with `Full output: <path>`, and `read` blocks oversized local/resource reads or saves URL reads as `artifact://<id>`).
357
391
 
358
- - **Session-directory sessions.** Saved under `<sessionDir>/tool-results/`, content-addressed by SHA-256 (`Content: sha256:<hex>`).
359
- - **Blob-capable session stores.** When a background subagent or detached tool result runs on SQLite, PostgreSQL, or an in-memory store, output is saved as a session blob addressed by `tool-output://<sha256>` (readable via `read` with line ranges such as `tool-output://<sha256>:1-200`, or `search`). Blobs share across hosts and branches, export with the session, and delete when the session is deleted. Custom stores without blob storage fall back to the temp tree below.
360
- - **Bash overflow, spill files, and sessions without a session directory.** Stored in a session-scoped temp tree (POSIX `0700` directories and `0600` files; unsafe shared or symlinked temp paths are refused; Windows uses an account-specific name instead of `<uid>`):
392
+ Where persisted output is stored depends on the session store and execution context:
361
393
 
362
- ```text
363
- <tmpdir>/atomic-<uid>/<session-id>/
364
- ```
394
+ | Where it ran | Saved location | How to read it |
395
+ | --- | --- | --- |
396
+ | Local session with a session directory | `<sessionDir>/tool-results/` (content-addressed by SHA-256) | `read` or `search` the printed path. |
397
+ | Background subagent or detached tool result on SQLite, PostgreSQL, or in-memory store | Stored as a session blob (`tool-output://<sha256>`) | `read` (including line ranges like `tool-output://<sha256>:1-200`) or `search`. Blobs share across hosts/branches, export with the session, and delete with the session. |
398
+ | `bash` overflow, spill files, custom stores without blobs, or sessions without a session directory | `<tmpdir>/atomic-<uid>/<session-id>/` (POSIX `0700` dirs / `0600` files; account-scoped on Windows; unsafe shared or symlinked temp paths are refused) | `read` or `search` the printed path. |
399
+
400
+ Each persisted file caps at **64 MiB**; excess bytes are replaced with `[Output truncated: persisted-output cap of 67108864 bytes reached]` without splitting UTF-8 characters.
365
401
 
366
- - **Size cap.** 64 MiB per persisted file; excess bytes are replaced with `[Output truncated: persisted-output cap of 67108864 bytes reached]` without splitting UTF-8 characters.
367
- - **Retention and cleanup.** A cleanup sweep runs 10 seconds after startup (at most once every 24 hours) and deletes temp trees and `tool-results/` directories (including custom `--session-dir` and `ATOMIC_CODING_AGENT_SESSION_DIR` roots) whose newest file is over 30 days old. Active sessions are protected, session `.jsonl` transcripts are never deleted, and symlinks are never followed. Copy output you need long-term elsewhere.
402
+ <Note>
403
+ **30-day automatic cleanup.** Ten seconds after startup (at most once every 24 hours), Atomic deletes temp trees and `tool-results/` directories (including custom `--session-dir` and `ATOMIC_CODING_AGENT_SESSION_DIR` roots) whose newest file is more than 30 days old. Active sessions are protected, session `.jsonl` transcripts are never deleted, and symlinks are never followed. Copy output you need long-term elsewhere.
404
+ </Note>
368
405
 
369
406
  ## Edit and write errors
370
407
 
371
- `edit` and `write` failures are typed. In extensions and SDK integrations, branch on the error class or `code` rather than message text. Every error sets `hint` (next step) and `retryable: false`.
408
+ For extension and SDK integrations, `edit` and `write` failures are typed. Branch on the error class or `code` rather than message text. Every error sets `hint` (next step) and `retryable: false`.
372
409
 
373
410
  | Class | `code` | When | Fields | What to do |
374
411
  | --- | --- | --- | --- | --- |
@@ -394,3 +431,4 @@ Text tool results over 50,000 characters are saved automatically and replaced in
394
431
 
395
432
  - **Inheritance and cross-process helpers (SDK).** `EditInputError`, `EditMatchError`, and `EditTargetError` extend `EditToolError`. Type guards (`isEditToolError`, `isEditInputError`, `isEditMatchError`, `isEditTargetError`, and `isWriteSelectorError`) also match cross-process copies by `name` and `code`. Use `serializeFileToolError` (which strips URL credentials from causes) with `rehydrateEditToolError` and `rehydrateWriteSelectorError` across process boundaries.
396
433
  - **Aborts and OS errors.** Cancelling `read`, `find`, `edit`, or `write` throws `FileToolAbortedError` (`name: "AbortError"`, `code: "aborted"`, `cause` set to the abort reason). OS write errors (`EACCES`, `EISDIR`, and similar) propagate directly.
434
+ - **SDK tool details.** Extension hooks and SDK consumers can inspect structured `details` returned by built-in tools: `read` populates `meta` (`source`, `sourcePath`, `truncation`, `limits`) and `imageUnsupportedByModel`; `edit` returns `diff`, unified `patch`, and `firstChangedLine`; `bash` returns `wallTimeMs`, non-zero `exitCode`, `timeoutSeconds` (and `requestedTimeoutSeconds` when a fractional timeout was rounded to milliseconds), and `fullOutputPath`; `find` returns `scopePath`, `fileCount`, and `files`; `search` sets `fileLimitReached` and `meta.limits.fileLimit`.