@bastani/atomic 0.10.14 → 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 +17 -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 +1 -1
  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/sessions.md CHANGED
@@ -1,50 +1,61 @@
1
1
  ---
2
2
  title: "Manage sessions"
3
- sidebarTitle: "Sessions"
4
- description: "Resume, search, name, branch, fork, share, and export conversation sessions in Atomic."
3
+ sidebarTitle: "Manage sessions"
4
+ description: "Resume, search, name, branch, fork, share, export, and recall conversation sessions in Atomic."
5
5
  ---
6
6
 
7
- Atomic saves every conversation as an append-only tree in a local SQLite database (`~/.atomic/workflows/journal.sqlite` by default). You can resume past work, jump back to earlier turns, and branch without losing history. For branch summaries and context clearing, see [Context and compaction](/compaction#branch-summarization).
7
+ Atomic saves every conversation as an append-only tree in a local SQLite database (`~/.atomic/workflows/journal.sqlite` by default). You can resume past work, jump back to earlier turns, and branch without losing history.
8
8
 
9
- - To choose where sessions are stored, such as a shared PostgreSQL database, see [Storage](/storage).
10
- - To resume sessions across machines with worktree snapshots and blueprints, see [Resume sessions on any machine](/guides/resume-on-any-machine).
11
- - To open and pass session stores from Node.js or TypeScript, see [SDK session storage](/sdk/storage).
12
- - For JSONL schemas, entry types, and the `SessionManager` API, see [Session file format](/session-format).
9
+ <Columns cols={2}>
10
+ <Card title="Worktree snapshots" href="/worktree-snapshots">
11
+ Automatically save and restore Git checkout state alongside session history.
12
+ </Card>
13
+ <Card title="Resume on any machine" href="/guides/resume-on-any-machine">
14
+ Share PostgreSQL storage and rebuild dependencies with environment blueprints.
15
+ </Card>
16
+ <Card title="Compaction and branch summaries" href="/compaction">
17
+ Clear or compact long context windows with [memory compaction](/compaction/memory-compaction) or summarize branches with [branch summaries](/compaction/branch-summaries).
18
+ </Card>
19
+ <Card title="Storage and file format" href="/storage">
20
+ Choose local SQLite, JSONL, or PostgreSQL, or inspect the [session file format](/session-format) and [SDK storage](/sdk/storage).
21
+ </Card>
22
+ </Columns>
13
23
 
14
- ## Session commands
24
+ ## Session commands {#session-commands}
15
25
 
16
- Start, resume, fork, or import sessions from the command line:
26
+ Start, resume, fork, export, or import sessions from the command line:
17
27
 
18
28
  ```bash
19
- atomic -c # Continue the most recent session in this folder
20
- atomic -r # Open the interactive session picker
21
- atomic --no-session # Run without saving a resumable session
22
- atomic --name "my task" # Set a display name at startup
23
- atomic --session <id|prefix> # Open by exact ID or unique 8-hex UUID prefix
24
- atomic --session-id <id> # Start a new project-local session with an exact ID
25
- atomic --fork <id|prefix> # Fork by exact ID or unique 8-hex UUID prefix
26
- atomic --import <file> # Import a format-4 JSONL export into storage
29
+ atomic -c # Continue the most recent session in this folder
30
+ atomic -r # Open the interactive session picker
31
+ atomic --no-session # Run without saving a resumable session
32
+ atomic --name "my task" # Set a display name at startup
33
+ atomic --session <id|prefix> # Open by exact ID or unique 8-hex UUID prefix
34
+ atomic --session-id <id> # Open this project's session with exact ID, or create it if missing
35
+ atomic --fork <id|prefix> # Fork by exact ID or unique 8-hex UUID prefix
36
+ atomic --import <file> # Import an exported JSONL session into storage
37
+ atomic --export <file> [output] # Convert an exported .jsonl file on disk to HTML
27
38
  ```
28
39
 
29
- Inside an interactive session, use these slash commands:
40
+ Inside an interactive session, use these slash commands (see [Slash commands](/slash-commands) for the complete list):
30
41
 
31
42
  | Command | Action |
32
43
  | --- | --- |
33
44
  | `/resume [id]` | Open the session picker, or resume directly by exact ID or unique 8-hex UUID prefix |
34
45
  | `/new` | Start a fresh session |
35
- | `/name <name>` | Set the display name |
46
+ | `/name [name]` | Set the display name, or show the current name when run with no arguments (prints usage if unnamed) |
36
47
  | `/session [snapshot]` | Show session ID, message counts, tokens, and cost; pass `snapshot` to inspect worktree snapshots and diff them against the current tree |
37
48
  | `/tree` | Navigate and branch inside the session tree |
38
49
  | `/fork` | Copy history up to a chosen user message into a new session |
39
50
  | `/clone` | Duplicate the active branch into a new session |
40
- | `/compact [instructions]` | Clear context, or compact with `compactionModel`; see [Context and compaction](/compaction) |
41
- | `/export [file]` | Export to HTML by default, or export the **active branch** to a format-4 `.jsonl` file (with inline worktree snapshots) when the path ends in `.jsonl` (case-insensitive). Wrap paths containing spaces in matching `'...'` or `"..."` quotes; unclosed quotes return an error. Use `atomic storage export` for raw backups of every branch across sessions. |
42
- | `/import <file>` | Import and resume a session from a format-4 JSONL file |
43
- | `/share` | Export the session as `session.jsonl` and upload it as a secret GitHub gist (`gh gist create --public=false`). Requires the GitHub CLI (`gh`) installed and logged in (`gh auth login`). Omits worktree snapshot blobs and session tool-output blobs, and cancels automatically if you switch sessions during upload. |
51
+ | `/compact [instructions]` | Clear context, or compact with a configured compactor model; see [Context and compaction](/compaction) |
52
+ | `/export [file]` | Export to HTML by default, or export the **active branch** to a `.jsonl` file (with inline worktree snapshots) when the path ends in `.jsonl` (case-insensitive). Wrap paths containing spaces in matching `'...'` or `"..."` quotes. Use `atomic storage export` for full multi-branch backups. |
53
+ | `/import <file>` | Import and resume a session from a JSONL export |
54
+ | `/share` | Export the session as `session.jsonl` and upload it as a secret GitHub gist (`gh gist create --public=false`). Requires the GitHub CLI (`gh`) installed and logged in (`gh auth login`). Omits worktree snapshot blobs and large tool-output blobs, and cancels if you switch sessions during upload. |
44
55
 
45
- ## Resuming and deleting sessions
56
+ ## Resuming and deleting sessions {#resuming-and-deleting-sessions}
46
57
 
47
- Run `/resume` or `atomic -r` to open the **Resume** picker. Run `/resume <id>` with an exact session ID or unique 8-hex UUID prefix to jump directly into that session.
58
+ Run `/resume` or `atomic -r` to open the **Resume** picker, or pass an exact session ID or unique 8-hex UUID prefix to jump straight in.
48
59
 
49
60
  Every session binds to its original working directory so tools, `@path` references, and project settings resolve there:
50
61
 
@@ -54,20 +65,20 @@ Every session binds to its original working directory so tools, `@path` referenc
54
65
  | `--resume` (`-r`), `/resume`, `--session` | Session's recorded directory |
55
66
  | `--fork`, or choosing to fork a cross-directory `--session` | Current directory (new session) |
56
67
 
57
- - **Session IDs and prefix matching.** `--session` and `--fork` check for an exact, case-sensitive session ID match first. If none matches, an 8-character hexadecimal prefix (case-insensitive, such as `019f6a2e`) matches UUID-backed sessions only, never custom non-UUID IDs. Atomic checks the current project first, then all projects, and lists matching sessions on a collision. Any other hex-and-hyphen fragment (such as 6 or 12 characters, or `019f6a2e-1234`) is rejected as malformed rather than not found.
58
- - **Custom IDs and flag conflicts.** `--session-id <id>` sets an exact project-local ID matching ASCII letters, digits, `.`, `_`, and `-`, starting and ending with a letter or digit. `--fork` cannot be combined with `--session`, `--continue`, `--resume`, or `--no-session`, though you can combine `--fork` with `--session-id <id>` to name the forked session. `--session-id` cannot be combined with `--session`, `--continue`, or `--resume`. `--import` cannot be combined with `--session`, `--fork`, `--session-id`, `--continue`, or `--resume` (combining `--import` with `--no-session` inspects the file without saving it). Conflicting flags exit with code `1`.
59
- - **Snapshots on resume.** When a session recorded [worktree snapshots](/worktree-snapshots), `atomic --session <id>` from another directory reopens it directly. Atomic reuses a matching local checkout or restores the files into `~/.atomic/agent/worktree-snapshots/` with a one-line notice. When exact restoration fails, Atomic opens the closest state and reports what is missing. Inspect snapshots with `/session snapshot` ([Inspecting snapshots](/worktree-snapshots#inspecting-snapshots)).
60
- - **Missing working directory.** When a session's directory no longer exists, interactive mode offers **Continue** (run in `cwd` without saving the new path), **Fork** (copy into `cwd` as a new session), or **Cancel**. Print mode, RPC mode, and extension calls to `ctx.switchSession()` in interactive mode reject with `MissingSessionCwdError`. At CLI startup in interactive mode, choose **Fork** instead of **Continue**, or open from an existing directory through `/resume` where **Continue** works.
61
- - **Fast resume and progress.** Compacted sessions open from the latest compaction boundary instead of loading the full history upfront. Commands that inspect older entries (`/tree`, `/fork`, `/clone`, `/export`, `/share`, and `/session`) read earlier history on demand in pages. `/session` shows totals immediately and fills in per-model cost, cache hit rate, and wasted cache cost once that scan finishes, while `history://` covers the full session. Extensions start with the active context window (including `atomic.appendEntry()` records on the active branch) and can read older entries through `ctx.sessionManager.readHistory()`. Slow resumes or sessions with 100,000 or more entries print step timings before opening the TUI.
68
+ - **Session IDs and prefix matching.** `--session` and `--fork` check for an exact, case-sensitive session ID match first. If none matches, an 8-character hexadecimal prefix (case-insensitive, such as `019f6a2e`) matches UUID-backed sessions only, never custom non-UUID IDs. Atomic checks the current project first, then all projects, and lists matching sessions on a collision. Any other hex-and-hyphen fragment (such as 6 or 12 characters, or `019f6a2e-1234`) is rejected as malformed.
69
+ - **Custom IDs and flag conflicts.** `--session-id <id>` opens an existing project-local session with that exact ID in the current directory, or creates a new one (printing a notice on stderr) if none exists. IDs use ASCII letters, digits, `.`, `_`, and `-`, starting and ending with a letter or digit. Combining `--fork` with `--session-id <id>` names the new forked session and fails if that ID already exists. `--fork` cannot be combined with `--session`, `--continue`, `--resume`, or `--no-session`; `--session-id` cannot be combined with `--session`, `--continue`, or `--resume`; `--import` cannot be combined with `--session`, `--fork`, `--session-id`, `--continue`, or `--resume` (combining `--import` with `--no-session` inspects the file without saving it). Conflicting flags exit with code `1`.
70
+ - **Snapshots on resume.** When a session recorded [worktree snapshots](/worktree-snapshots), `atomic --session <id>` from another directory reopens it directly—reusing a matching local checkout or restoring files into `~/.atomic/agent/worktree-snapshots/` with a one-line notice. Inspect snapshots with `/session snapshot` ([Inspecting snapshots](/worktree-snapshots#inspecting-snapshots)).
71
+ - **Missing working directory.** When a session's recorded directory no longer exists, interactive `/resume` offers **Continue** (run in the current directory without overwriting the saved path), **Fork** (copy into the current directory as a new session), or **Cancel**. At CLI startup in interactive mode, choose **Fork** instead of **Continue** (or reopen through `/resume`). Non-interactive modes (`-p`, RPC) and programmatic session switches fail with a missing-directory error rather than prompting.
72
+ - **Fast resume.** Compacted sessions open from the latest compaction boundary instead of loading the entire history upfront. Commands that inspect earlier entries (`/tree`, `/fork`, `/clone`, `/export`, `/share`, and `/session`) page older history on demand. `/session` shows totals immediately and fills in per-model cost and cache stats once that scan finishes. Slow resumes or sessions with 100,000 or more entries print step timings before opening the TUI.
62
73
  - **Draft preservation.** Text typed before a startup picker or prompt appears waits as a draft without confirming pickers or `Fork this session? [y/N]`.
63
- - **Tool restoration.** Plain resume restores the session's recorded tool selection along with newly available extension tools. Tools explicitly disabled through `--tools`, `--no-tools`, `--exclude-tools`, or `setActiveTools` stay off, and `--tools +name,-name` adjusts the restored set. Missing previously used tools appear below startup resources and under **Missing** in `/tools`. Forked subagents keep their own configured tools subject to parent restrictions.
74
+ - **Tool restoration.** Plain resume restores the session's recorded tool selection along with newly available extension tools. Explicitly disabled tools stay off, `--tools +name,-name` adjusts the restored set, and previously used tools that are no longer installed appear under **Missing** in `/tools`.
64
75
 
65
76
  ### Interrupted work on resume
66
77
 
67
78
  When you reopen an interactive session (`--session`, `-c`, `-r`, or `/resume`) after an abrupt exit or session switch, the transcript renders first and recovery runs visibly:
68
79
 
69
80
  - Running background subagents relaunch and reconnect to Intercom. Paused, quit, completed, and failed children stay as they were, and forked sessions never relaunch original children (see [Run control](/subagents#run-control)).
70
- - Undelivered user or peer messages replay in a turn (`Replaying N interrupted deliveries`). Messages from gone peers post one notice without starting a turn. Messages that cannot deliver because Intercom is unreachable or a relaunched subagent has not reconnected yet wait until the next resume.
81
+ - Undelivered user or peer messages replay in a turn (`Replaying N interrupted deliveries`). Messages from gone peers post one notice without starting a turn. Messages that cannot deliver yet wait until the next resume.
71
82
  - Unseen background task results render as cards without starting a turn, followed by a recovery summary line.
72
83
  - Non-interactive runs (`atomic -p`) leave interrupted work pending until the next interactive resume.
73
84
 
@@ -77,17 +88,11 @@ Each row in the **Resume** picker shows the session name or first message, age,
77
88
 
78
89
  Type to filter sessions using three query modes:
79
90
 
80
- - **Word tokens (default).** Space-separated words match with logical AND (case-insensitive). Each word checks for a literal substring match first across name, title, ID, detail, summary, message text, and folder. If no literal match is found, it falls back to fuzzy matching across metadata fields only (name, title, detail, summary, and folder, never message bodies or IDs).
81
- - **Exact phrases.** Wrap multiple words in double quotes (`"auth token refresh"`) for case-insensitive phrase matching across all fields with normalized whitespace. An unclosed quote falls back to whitespace-separated word tokens.
91
+ - **Word tokens (default).** Space-separated words match with logical AND (case-insensitive). Each word checks for a literal substring match across name, title, ID, detail, summary, message text, and folder, falling back to fuzzy matching across metadata fields only (never message bodies or IDs).
92
+ - **Exact phrases.** Wrap words in double quotes (`"auth token refresh"`) for case-insensitive phrase matching with normalized whitespace. An unclosed quote falls back to word tokens.
82
93
  - **Regular expressions.** Prefix a query with `re:` (such as `re:error\s+50[23]`) for case-insensitive JavaScript regex matching. An invalid regex returns no matches.
83
94
 
84
- Press `Ctrl+S` to cycle through three sort modes:
85
-
86
- - **Threaded (default).** Groups forked sessions under their parent session, ordered by most recent activity.
87
- - **Recent.** Flat list ordered by most recent modification time.
88
- - **Relevance.** Ranked by match quality (name matches first, then text matches, then fuzzy matches), tie-broken by modification time.
89
-
90
- Bottom hints display active shortcuts (`space preview · enter resume · type to search · esc cancel`, plus `? keys` or `f1 keys` while searching):
95
+ Press `Ctrl+S` to cycle sort modes: **Threaded** (default; groups forks under their parent by recent activity), **Recent** (flat list by modification time), and **Relevance** (name matches, then text matches, then fuzzy matches).
91
96
 
92
97
  | Key | Action |
93
98
  | --- | --- |
@@ -96,46 +101,42 @@ Bottom hints display active shortcuts (`space preview · enter resume · type to
96
101
  | Type / `Esc` | Filter list or clear search; a second `Esc` closes the picker |
97
102
  | `Space` | Toggle preview when search is empty |
98
103
  | `Tab` | Toggle current folder vs. all folders |
99
- | `Ctrl+P` / `Ctrl+S` / `Ctrl+N` | Toggle paths, sort mode (`threaded`, `recent`, `relevance`), or named-only filter |
100
- | `Ctrl+R` | Rename session |
104
+ | `Ctrl+P` / `Ctrl+S` / `Ctrl+N` | Toggle paths, sort mode, or named-only filter |
105
+ | `Ctrl+R` | Rename session (submit empty to clear the display name) |
101
106
  | `Ctrl+D`, then `Enter` | Delete session with confirmation (`trash` CLI for JSONL when available, record delete for database stores; the active session cannot be deleted) |
102
107
  | `Ctrl+Backspace` | Delete selected session when the search box is empty |
103
108
  | `Ctrl+C` | Close picker from any state |
104
109
 
105
110
  ### Session summaries
106
111
 
107
- Once the agent goes idle, Atomic generates a one-line `session_summary` using the session's active model. Summaries run for saved interactive and RPC sessions, and skip `--no-session`, `-p`, JSON mode, internal sessions, and sessions with fewer than 4 entries on the active branch.
108
-
109
- Summary generation feeds up to 4,000 tokens of recent conversation, caps the stored line at 160 characters (truncated with `...`), counts toward session usage, cancels on new input or exit, and retires on a later branch summary. Disable summaries with `"sessionSummary": { "enabled": false }`.
112
+ Once the agent goes idle, Atomic generates a one-line summary using the session's active model. Summaries run for saved interactive and RPC sessions and skip `--no-session`, `-p`, JSON mode, internal sessions, and sessions with fewer than 4 entries on the active branch.
110
113
 
111
- ### Internal sessions
114
+ Summary generation feeds up to 4,000 tokens of recent conversation, caps the stored line at 160 characters (truncated with `…`), counts toward session usage, cancels on new input or exit, and retires on a later branch summary. Disable summaries with `"sessionSummary": { "enabled": false }`.
112
115
 
113
- Sessions marked **internal** are hidden from `/resume`, `atomic -r`, `-c`, and `history://sessions`, while remaining openable by exact session ID. Every subagent's own session is internal, whether it started fresh or as a `context: "fork"` copy of its parent's conversation.
116
+ ### Internal and subagent sessions
114
117
 
115
- ### Subagent sessions
118
+ Sessions marked **internal** are hidden from `/resume`, `atomic -r`, `-c`, and `history://sessions`, while remaining openable by exact session ID. Every subagent's own session is internal—whether fresh or forked (`context: "fork"`).
116
119
 
117
- A subagent's session always lives in the same session store as the session that launched it. The subagent's working directory, worktree, or the storage settings of the project it runs in never select another store. Forked and fresh subagents are stored the same way, and so are subagents resumed after a restart. As a result:
120
+ A subagent's session always lives in the same session store as the session that launched it, regardless of the subagent's working directory or worktree:
118
121
 
119
- - `history://sessions/<id>` reads a subagent's session from any session that uses that store, including the launching session after it is resumed on another machine that shares the database. Add `?project=<dir>` when the subagent ran in another directory; its result gives the full URL.
120
- - `/tasks` and `subagent({ action: "status" })` read the transcript from the launching session's store, so a subagent's history is available wherever that session opens.
121
- - Subagents do not appear in `/resume` or the `history://sessions` list, since their sessions are internal.
122
-
123
- When an 8-character ID prefix passed to `--session` or `--fork` matches both a listed session and internal sessions (such as subagent sessions created around the same time), Atomic selects the listed session.
122
+ - `history://sessions/<id>` reads a subagent's session from any session sharing that store, including after resuming on another machine. Add `?project=<dir>` if the subagent ran in another directory.
123
+ - `/tasks` and `subagent({ action: "status" })` read transcripts from the launching session's store.
124
+ - When an 8-character ID prefix passed to `--session` or `--fork` matches both a regular session and internal sessions, Atomic selects the regular session.
124
125
 
125
126
  ## Naming sessions
126
127
 
127
- Set a display name interactively with `/name <name>` or at startup with `--name` / `-n`:
128
+ Set a display name interactively with `/name <name>`, inspect the current name with bare `/name`, or set one at startup with `--name` / `-n`:
128
129
 
129
130
  ```bash
130
131
  atomic --name "Refactor auth module"
131
132
  atomic --name "CI audit" -p "Review this build failure"
132
133
  ```
133
134
 
134
- ## Branching with `/tree` {#branching-with-tree}
135
+ To clear a display name interactively, press `Ctrl+R` on the session in `/resume` and submit an empty name.
135
136
 
136
- Every session entry carries `id` and `parentId`. Run `/tree` to jump to any earlier entry and start a new branch in place:
137
+ ## Branching with `/tree` {#branching-with-tree}
137
138
 
138
- <p align="center"><img src="images/tree-view.png" alt="Atomic terminal UI showing the interactive Session Tree panel opened by /tree, listing user messages, assistant replies, and tool calls with keyboard filter shortcuts and an inline search bar." width="600" /></p>
139
+ Every session entry links to its parent, forming a tree. Run `/tree` to jump to any earlier turn and explore a different direction without losing the original path:
139
140
 
140
141
  ```text
141
142
  ├─ user: "Hello, can you help..."
@@ -147,9 +148,7 @@ Every session entry carries `id` and `parentId`. Run `/tree` to jump to any earl
147
148
  │ └─ assistant: "For approach B..."
148
149
  ```
149
150
 
150
- ### Tree controls
151
-
152
- Type anywhere in `/tree` to filter entries through the inline search bar.
151
+ Type anywhere in `/tree` to filter entries through the inline search bar:
153
152
 
154
153
  | Key | Action |
155
154
  | --- | --- |
@@ -157,15 +156,13 @@ Type anywhere in `/tree` to filter entries through the inline search bar.
157
156
  | `←` / `→` | Page up or down |
158
157
  | `Ctrl+←` / `Ctrl+→` or `Alt+←` / `Alt+→` | Fold, unfold, or jump between branches |
159
158
  | `Shift+L` / `Shift+T` | Set or clear a bookmark label, or toggle label timestamps |
160
- | `Ctrl+O` / `Shift+Ctrl+O` | Cycle filter forward or backward (`default`, `no-tools`, `user-only`, `labeled-only`, `all`; default set by `treeFilterMode`) |
159
+ | `Ctrl+O` / `Shift+Ctrl+O` | Cycle filter (`default`, `no-tools`, `user-only`, `labeled-only`, `all`; default set by `treeFilterMode`) |
161
160
  | `Ctrl+D` / `Ctrl+T` / `Ctrl+U` / `Ctrl+L` / `Ctrl+A` | Jump directly to `default`, `no-tools`, `user-only`, `labeled-only`, or `all` filter |
162
161
  | `Enter` / `Esc` | Select entry or cancel |
163
162
 
164
- ### Selection behavior
165
-
166
- - **User or custom message.** Moves the active leaf to its parent and loads its text into the editor so you can edit and branch. Selecting the root user message resets to an empty conversation with that prompt.
163
+ - **User or extension message.** Moves the active leaf to its parent and loads its text into the editor so you can edit and branch. Selecting the root user message resets to an empty conversation with that prompt.
167
164
  - **Assistant, tool, or compaction entry.** Moves the active leaf to that entry with an empty editor to continue from there.
168
- - Navigation persists immediately, so quitting or resuming before sending a message stays on the chosen branch. Pressing `Esc` during branch-summary generation cancels it and reopens `/tree`.
165
+ - Navigation saves immediately, so quitting or resuming stays on the chosen branch. Pressing `Esc` during branch-summary generation cancels it and reopens `/tree`.
169
166
 
170
167
  ## Compare `/tree`, `/fork`, and `/clone` {#tree-fork-and-clone}
171
168
 
@@ -176,154 +173,53 @@ Type anywhere in `/tree` to filter entries through the inline search bar.
176
173
  | Typical use | Explore alternatives in place | Branch from an earlier prompt | Duplicate current path before continuing |
177
174
  | Summary | Optional branch summary | None | None |
178
175
 
179
- `/fork` and `/clone` start a new session from the active path, including its worktree snapshots. `atomic --fork <id>`, choosing **Fork** for a session whose directory is missing, and the SDK's `forkTo()` into the same store take every branch.
180
-
181
- A fork into another store, such as an SDK `forkTo()` that names a different store, carries only the current context, without retired turns or private task records. Reopening it shows `Parent history is in its original store or is no longer available.` To move every branch of a session to another store, use `atomic storage export` and `atomic storage import`.
176
+ `/fork` and `/clone` start a new session from the active path, including its worktree snapshots. `atomic --fork <id>` and choosing **Fork** for a missing directory copy every branch in the same store. Forking across different stores carries only the current context window; to move every branch between stores, use `atomic storage export` and `atomic storage import`.
182
177
 
183
178
  ### Shared-history forks {#forks-share-history}
184
179
 
185
- In a SQLite or PostgreSQL store, a fork shares the history it starts from with the original session instead of copying it, so forking a long session is about as fast as forking a short one. A fork still behaves exactly like a copy: later changes to the original never show up in it, and deleting the original never changes it. Exports and forks into another store write full copies. JSONL and in-memory stores always copy. On SQLite there is nothing to set up. On PostgreSQL, the owner runs `atomic storage migrate` once. Atomic 0.10.11 upgrades the store so that earlier releases can no longer open it. See [Shared-history forks](/storage#shared-history-forks).
180
+ In SQLite and PostgreSQL stores, a fork shares its prior history with the original session instead of copying every row, so forking a long session is as fast as forking a short one. The fork still behaves like an independent copy: later edits to or deletion of the original never affect the fork, and exports always write full copies. JSONL and in-memory stores always copy. See [Shared-history forks](/storage#shared-history-forks).
186
181
 
187
182
  ## Branch summaries
188
183
 
189
- When `/tree` switches away from a branch, Atomic can optionally summarize the abandoned branch. You can choose no summary, the default summary, or custom focus instructions. When `branchSummary.skipPrompt` is enabled, Atomic skips the prompt and defaults to no summary. See [Branch summaries](/compaction#branch-summaries).
184
+ When `/tree` switches away from a branch, Atomic can optionally summarize the abandoned branch (no summary, default summary, or custom focus instructions). Set `"branchSummary": { "skipPrompt": true }` to skip the prompt and default to no summary. See [Branch summaries](/compaction/branch-summaries).
190
185
 
191
- ## Recalling earlier work
186
+ ## Recalling earlier work {#recalling-earlier-work}
192
187
 
193
- The agent can inspect past project sessions from any session or subagent using read-only `history://` URLs with `read` and `search`. These URLs work across SQLite, PostgreSQL, JSONL, memory, and custom stores:
188
+ From any session or subagent, the agent can read and search past project sessions using read-only `history://` URLs across SQLite, PostgreSQL, JSONL, memory, and custom stores:
194
189
 
195
190
  | URL | What it returns |
196
191
  | --- | --- |
197
- | `history://` | Overview of available history sources (`read`), or searches recent project sessions like `history://sessions` (`search`). |
198
- | `history://sessions` | Recent project sessions, newest first (`?limit=N` up to 200, default 25; `?offset=N`; add `?project=all` or `?project=<dir>` only when checking other projects). Uncached JSONL and legacy sessions may show estimated counts. |
199
- | `history://sessions/<id>` | Full transcript, or an outline with counts and `:N-M` turn links for sessions with more than 2,000 entries, oversized bodies, or cold JSONL files. Lines over 4,000 characters split cleanly. |
200
- | `history://sessions/<id>:N-M` | 1-based **entry** ranges (not file lines): `:N` (from entry N), `:N-M`, `:N+C` (start plus count), or comma-separated ranges like `:1-20,90-120`. Append `:raw` to omit the transcript header. |
201
-
202
- Concrete examples:
203
-
204
- ```ts
205
- // List the newest 25 sessions for this project (or page further).
206
- read({ path: "history://sessions" })
207
- read({ path: "history://sessions?limit=50&offset=25" })
208
- read({ path: "history://sessions?project=all" })
209
-
210
- // Read an outline or a specific 1-based entry range of one session.
211
- read({ path: "history://sessions/019f6a2e-..." })
212
- read({ path: "history://sessions/019f6a2e-...:40-90" })
213
- read({ path: "history://sessions/019f6a2e-...:40+25:raw" })
214
-
215
- // Search across recent project sessions, or inside one specific session.
216
- search({ pattern: "connection refused", paths: "history://sessions" })
217
- search({ pattern: "retry.*backoff", paths: "history://sessions/019f6a2e-...", i: true })
218
- ```
192
+ | `history://` | Overview of history sources (when read), or searches recent project sessions (when searched) |
193
+ | `history://sessions` | Recent sessions for this project, newest first (`?limit=N` up to 200, default 25; `?offset=N`; add `?project=all` or `?project=<dir>` only when checking other projects) |
194
+ | `history://sessions/<id>` | Full transcript, or a structured outline with `:N-M` entry ranges for large sessions (over 2,000 entries, oversized bodies, or cold JSONL files) |
195
+ | `history://sessions/<id>:N-M` | 1-based **entry** ranges: `:N`, `:N-M`, `:N+C`, or comma-separated ranges like `:1-20,90-120` (append `:raw` to omit the header) |
219
196
 
220
- - **Search behavior.** Searching `history://sessions` or `history://` scans the newest 25 sessions per page, excludes the current session (search the current session through its own ID URL, `history://sessions/<current-id>`), skips `custom` and `worktree_snapshot` entries, and caps output at 10 matches per session. Extra matches include a `?cursor=<seq>.<match>` continuation. Multi-line patterns match across up to 16,384 characters or 256 entries, with the same window for lookbehind, and matches crossing that boundary note the cutoff. After compaction, the boundary message gives the exact session URL and range to recover earlier details ([Context cleared](/compaction#context-cleared)).
221
- - **Budgets and continuations.** Every `history://` call enforces a 40,000-byte output cap and a 250,000-entry scan cap. Outside a live session (or after the session closes), calls also enforce a 3-second nominal time budget; inside a live session, a slow call moves to the background with no time limit instead (see [Slow history searches](#slow-history-searches)). Whenever a call hits the byte cap, the entry cap, or (outside a session) the time cap, it stops cleanly and prints a `continue with` URL carrying query parameters such as `cursor=<seq>.<match>`, `after=<activityMs>.<createdMs>[.<id>]`, and an optional `session=<id>`. Pass that URL back to `read` or `search` verbatim to pick up where it left off; multi-session list continuations expire after 60 seconds.
222
- - **Indexing and storage.** SQLite and PostgreSQL build a search index on the first search. PostgreSQL installs `pg_trgm` during `atomic storage migrate` or on open when permissions allow. Multi-line patterns scan linearly. The index roughly doubles text-heavy session storage and clears automatically when sessions are deleted or rewritten (`VACUUM` or `VACUUM FULL` reclaims disk space). Never edit active JSONL files in place outside Atomic's storage APIs.
197
+ - **Project isolation.** Reading or searching a session ID from another project fails with a project-isolation error unless `?project=<dir>` or `?project=all` is passed explicitly.
198
+ - **What is indexed and omitted.** History search scans the newest 25 sessions per page, excludes the current session unless targeted by its own ID URL (`history://sessions/<current-id>`), and caps output at 10 matches per session. It omits non-conversation metadata—thinking blocks, system/model/thinking-level changes, usage records, labels, context edits, internal extension state, and worktree snapshots. After compaction, the boundary message gives the exact session URL and range to recover earlier details ([Memory compaction](/compaction/memory-compaction)).
199
+ - **Output caps and continuations.** Every `history://` call caps output at 40,000 bytes and scans at most 250,000 entries, stopping cleanly with a `continue with` URL when either limit is hit (multi-session list continuations expire after 60 seconds). Multi-line regex patterns match across up to 16,384 characters or 256 entries.
200
+ - **Offline SQLite search.** To run a read-only regex search against a local SQLite session file from the shell without taking writer locks, run `atomic storage search-session <sqlite-file> <session-id> <pattern> [cursor]` (see [CLI reference](/reference/cli#storage-and-intercom-commands)).
223
201
 
224
202
  ### Slow history searches {#slow-history-searches}
225
203
 
226
- Reading or searching past sessions can take more than a few seconds when the session store is large or remote, such as a PostgreSQL database. Inside a session, Atomic handles slow `history://` calls in `read` and `search` the exact same way it handles slow commands in `bash` and `powershell`:
204
+ When a `history://` read or search takes longer than 10 seconds (for example against a large or remote PostgreSQL database), Atomic automatically continues it in the background and shows a live status line such as `Search(history-3) · continues in background`, delivering the result as a completion notice when done.
227
205
 
228
- 1. **Observe in the foreground first (10 seconds by default).** When `wait` is omitted, Atomic waits up to 10 seconds for the result (or whatever observation budget the session is configured with). If the call finishes in time, it returns its result inline.
229
- 2. **Continue in the background with a task ID.** If the call is still running when the observation wait ends, Atomic keeps scanning in the background and returns a task ID such as `history-3` so the agent can do other work without waiting.
230
- 3. **Deliver the result as a completion notice.** When the background scan finishes, its result arrives in the chat as a completion notice.
206
+ - **No time limit.** Background history tasks run until they finish, hit the 40,000-byte output cap or 250,000-entry scan cap (returning a `continue with` URL), are stopped, or the session closes or reloads.
207
+ - **Separate concurrency pool.** A session runs up to **4** active history reads and searches at once (separate from the 64 background shell commands), and keeps the 16 most recently finished history results available for late waits.
231
208
 
232
- A background history task has **no time limit**: it runs until it finishes, the agent stops it with `kill`, or the session closes or reloads. It still obeys the 40,000-byte output limit and 250,000-entry scan limit; if either is reached, the completed result ends with a `continue with` URL as usual.
209
+ For tool `wait` options, `kill({ id })`, and how background history searches compare to background shells, see [Background history searches](/background-tasks#background-history-searches) and [Background tasks reference](/background-tasks/reference).
233
210
 
234
- In the chat, a backgrounded call shows `Search(history-3) · continues in background` (or `Read(history-3) · continues in background`), and the agent receives:
211
+ ## Session storage {#session-storage}
235
212
 
236
- ```text
237
- History search is still running (task history-3). It has no time limit: it runs until it finishes, kill stops it, or this session ends. The result arrives as a completion notice; if it is too long, it ends with a "continue with" URL as usual. Wait for it with search({ action: "wait", id: "history-3" }) or stop it with kill({ id: "history-3" }). Never repeat the call to get its result.
238
- ```
239
-
240
- When the task finishes, a completion line appears in chat:
241
-
242
- ```text
243
- ● History search "/ERR_/ in history://sessions" completed · 12s
244
- ```
245
-
246
- #### Controlling wait time, checking progress, and stopping
247
-
248
- Both `read` and `search` accept the same `wait` parameter and the same `{ action: "wait", id, budgetMs? }` wait mode as `bash` and `powershell`:
213
+ Atomic saves sessions automatically in `~/.atomic/workflows/journal.sqlite` by default. See [Storage](/storage) to switch backends, share PostgreSQL across machines, or migrate sessions between stores.
249
214
 
250
- | Call shape | What happens |
251
- | --- | --- |
252
- | `wait` omitted (or `wait: { kind: "foreground" }`) | Waits up to the default observation budget (10 seconds), then returns a `history-N` task ID if still running. |
253
- | `wait: { kind: "background" }` | Returns a `history-N` task ID immediately while the read or search runs in the background. `budgetMs` is not allowed with `kind: "background"`. |
254
- | `wait: { kind: "foreground", budgetMs: 30000 }` | Waits up to `budgetMs` milliseconds (finite, non-negative; `0` checks immediately), then continues in the background if still running. |
255
- | `{ action: "wait", id: "history-3" }` | Observes an existing history task for up to the default observation budget (10 seconds). Cannot be combined with `path`, `pattern`, `paths`, `wait`, or other call fields. |
256
- | `{ action: "wait", id: "history-3", budgetMs: 5000 }` | Observes an existing history task for up to `budgetMs` milliseconds (`0` returns immediately with the result if finished, or the still-running status). |
257
- | `kill({ id: "history-3" })` | Stops the background history scan immediately and sends no completion notice. |
258
-
259
- Examples for both `search` and `read`:
260
-
261
- ```ts
262
- // Start in the background right away.
263
- search({ pattern: "ERR_", paths: "history://sessions", wait: { kind: "background" } })
264
- read({ path: "history://sessions/019f6a2e-...:1-500", wait: { kind: "background" } })
265
-
266
- // Wait up to 60 seconds inline before moving to the background.
267
- search({ pattern: "ERR_", paths: "history://sessions", wait: { kind: "foreground", budgetMs: 60000 } })
268
- read({ path: "history://sessions/019f6a2e-...", wait: { kind: "foreground", budgetMs: 60000 } })
269
-
270
- // Wait up to 30 more seconds for a running task's result (or poll immediately with budgetMs: 0).
271
- search({ action: "wait", id: "history-3", budgetMs: 30000 })
272
- read({ action: "wait", id: "history-4", budgetMs: 0 })
273
-
274
- // Stop a running history task.
275
- kill({ id: "history-3" })
276
- ```
215
+ - **Sessions from older releases.** With the default SQLite store, legacy JSONL sessions in `~/.atomic/agent/sessions` still appear in `/resume` and `--continue`. Opening one imports a copy into SQLite and leaves the original file untouched.
216
+ - **Project settings.** A project's storage settings take effect once you [trust the project](/security). New sessions use the project store, while resumed sessions remain in the store they came from.
217
+ - **Importing a file.** `--import <file>` or `/import <file>` imports a JSONL export with its inline [worktree snapshots](/worktree-snapshots), upgrades older formats automatically, and refuses duplicate session IDs.
218
+ - **Temporary runs (`--no-session`).** Nothing is written to a resumable store. If Atomic releases an idle subagent from memory during a `--no-session` run, its history is kept in a temporary file deleted on exit.
277
219
 
278
- #### Rules, limits, and how history tasks compare to background shells
220
+ ### Choosing a store {#choosing-a-store}
279
221
 
280
- - **No duplicate notices.** If an `action: "wait"` call is observing the task when it finishes, that wait returns the result directly and no completion notice is sent afterward. A task stopped with `kill` sends no completion notice either; calling `action: "wait"` on a stopped task returns an error noting it was stopped, and calling `kill` again reports that it had already finished.
281
- - **Late waits still work.** Atomic keeps the 16 most recently finished history tasks in the session so a late `{ action: "wait", id }` call still returns the result (both `read` and `search` can wait on any `history-N` task from the same session). Older evicted or unknown IDs fail with `Unknown history task <id>`.
282
- - **At most 4 active at once.** A session runs up to 4 active history reads and searches at once (counting both background tasks and calls currently being observed in the foreground). They run inside Atomic on the session's store and a shared regex worker, so more at once would only slow each other down. This limit is separate from the 64 shell commands a session can run. A fifth concurrent call is refused immediately with:
283
-
284
- ```text
285
- 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.
286
- ```
287
-
288
- - **How they mirror — and differ from — background shells:**
289
-
290
- | Capability | `bash` / `powershell` tasks | `read` / `search` `history://` tasks |
291
- | --- | --- | --- |
292
- | Default foreground wait | 10 seconds | 10 seconds |
293
- | `wait` options | `{ kind: "background" }`, `{ kind: "foreground", budgetMs? }` | `{ kind: "background" }`, `{ kind: "foreground", budgetMs? }` |
294
- | Observe existing task | `{ action: "wait", id, budgetMs? }` | `{ action: "wait", id, budgetMs? }` |
295
- | Stop running task | `kill({ id })` | `kill({ id })` |
296
- | Execution time limit | None unless `timeout` (seconds) is set | None (no `timeout` parameter; stops at 40,000-byte or 250,000-entry cap with a `continue with` URL) |
297
- | Concurrency limit per session | 64 commands | 4 history reads/searches (separate pool) |
298
- | Heartbeats and `/tasks` panel | Heartbeats every 15m; shown in `/tasks` | No heartbeats; not listed in `/tasks` |
299
- | On session close or reload | Stopped; not restarted on resume | Stopped without notices; not restarted on resume |
300
-
301
- ### Searching a stored session in the background
302
-
303
- Run a read-only CLI search against an existing, unprefixed local SQLite session file without creating indexes, updating indexes, or taking writer locks:
304
-
305
- ```bash
306
- atomic storage search-session ./sessions.sqlite my-session 'connection refused'
307
- ```
308
-
309
- The full command syntax is `atomic storage search-session <sqlite-file> <session-id> <pattern> [cursor]`. The command requires an existing local SQLite file (it refuses `:memory:`, URLs, and UNC paths). Session IDs must use ASCII `[A-Za-z0-9_-]` (periods `.` are not accepted here, unlike `--session-id`), and an optional numeric cursor such as `6` or `6.2` resumes an earlier scan.
310
-
311
- This command writes no `-wal` or `-shm` files on cleanly closed databases and stops cleanly if the session's write revision changes mid-scan. Agents can also run it through `bash` with `wait: { kind: "background" }` and monitor it with `bash({ action: "wait", id })` or cancel it with `kill({ id })`. For JSONL, memory, remote stores, or multi-session listings, use `read` and `search` on `history://`.
312
-
313
- ## Session storage
314
-
315
- Atomic saves sessions as you go, by default in a local SQLite file, `~/.atomic/workflows/journal.sqlite`. [Storage](/storage) covers every store, sharing sessions between machines, and moving sessions between stores.
316
-
317
- - **Sessions from older releases.** With the default store, JSONL sessions from earlier releases in `~/.atomic/agent/sessions` still appear in `/resume` and `--continue`. Opening one imports a copy into SQLite and leaves the original file unchanged. If a sync tool left conflicting copies of a file, the newest message wins. An unopened file over 32 KiB shows an estimated summary until you open it. With any other store, only that store's sessions appear.
318
- - **Project settings.** A project's storage settings apply once you [trust the project](/security). New conversations then use the project's store, while resumed conversations stay in the store they came from. To reopen a session in a store that is not your default, keep the flags Atomic prints, for example `atomic --session-store "/data/project A/sessions.sqlite" --session-prefix project_ --session <id>`.
319
- - **Importing a file.** `--import <file>` or `/import <file>` imports a JSONL export as it is, including the [worktree snapshots](/worktree-snapshots) that `/export <file>.jsonl` wrote. It upgrades older formats, and fails with `SessionExistsError` if the store already has a session with that ID. A session imported with an empty ID reopens with `atomic --session ""` or from the picker.
320
- - **Nothing saved (`--no-session`).** Nothing goes to a store you can resume from. If Atomic unloads an idle subagent from memory in this mode, it keeps the subagent's history in a private temporary file in your agent directory, and deletes it on exit. A later start on the same machine removes files left by a crash. See [Releasing idle sessions](/sdk#releasing-idle-sessions).
321
- - **Forks share history.** See [Shared-history forks](#forks-share-history).
322
- - **Session stats (`/session`).** Shows the session ID, message count, tokens, and cost. The counts update after each completed message.
323
-
324
- ### Choosing a store
325
-
326
- Set `sessions.storage` to choose a store for sessions only, or top-level `storage` to choose one for sessions and Intercom together. For example, in `settings.json`:
222
+ Set `sessions.storage` for sessions only, or top-level `storage` for sessions and Intercom together, in `settings.json`:
327
223
 
328
224
  ```json
329
225
  {
@@ -335,27 +231,16 @@ Set `sessions.storage` to choose a store for sessions only, or top-level `storag
335
231
 
336
232
  | Value | Store |
337
233
  | --- | --- |
338
- | `{ "path": "sessions.sqlite" }` | A [local SQLite](/storage/sqlite) file. |
339
- | `{ "dir": "sessions" }` | A [JSONL directory](/storage/jsonl). Only in `sessions.storage` and `ATOMIC_SESSIONS_STORAGE`. |
340
- | `{ "memory": true }` | Memory only. Sessions are lost when the process exits. |
341
- | `{}` | The default SQLite file. In top-level `storage`, `~/.atomic/storage.sqlite`. |
342
- | `{ "adapter": "...", "options": {}, "secrets": {} }` | A database through an adapter: [PostgreSQL](/storage/postgres) or a [custom adapter](/storage/custom-adapters#selecting-an-adapter). |
234
+ | `{ "path": "sessions.sqlite" }` | A [local SQLite](/storage/sqlite) file |
235
+ | `{ "dir": "sessions" }` | A [JSONL directory](/storage/jsonl) (valid in `sessions.storage` and `ATOMIC_SESSIONS_STORAGE` only) |
236
+ | `{ "memory": true }` | Memory only (lost on exit) |
237
+ | `{}` | The default SQLite file (`~/.atomic/storage.sqlite` in top-level `storage`) |
238
+ | `{ "adapter": "...", "options": {}, "secrets": {} }` | [PostgreSQL](/storage/postgres) or a [custom adapter](/storage/custom-adapters#selecting-an-adapter) |
343
239
 
344
- A selection replaces any lower one as a whole object. Fields are never merged. Command-line flags and environment variables can override these settings for one process. [Which selection wins](/storage#which-selection-wins) lists the order. Relative paths in settings and JSON values resolve against the [storage home](/storage#storage-home). Relative paths in `--session-dir`, `--session-store`, and `ATOMIC_CODING_AGENT_SESSION_DIR` resolve against the current directory.
240
+ A higher-precedence selection replaces any lower one as a whole object without merging fields (see [Which selection wins](/storage#which-selection-wins)). Relative paths in settings resolve against the [storage home](/storage#storage-home), whereas relative paths in `--session-dir`, `--session-store`, and `ATOMIC_CODING_AGENT_SESSION_DIR` resolve against the current directory.
345
241
 
346
- Flag rules:
347
-
348
- - `--session-store` cannot be combined with `--session-dir` or `--no-session`.
349
- - A non-empty `ATOMIC_CODING_AGENT_SESSION_DIR` cannot be combined with `ATOMIC_SESSIONS_STORAGE`, `--storage`, or `--storage-file`. Startup fails with `StorageConfigError` and reason `conflicting-overrides`.
350
- - `--session-prefix` works only with `--session-store`, for a local SQLite file. The prefix must match `[A-Za-z_][A-Za-z0-9_]*` and must not start with `sqlite_` in any letter case. For a shared database, set `prefix` in the `storage` setting, or pass `atomic storage join --prefix`. PostgreSQL prefixes must also be lowercase and at most 24 characters.
351
- - Invalid storage flags stop the CLI with `Error: ...` and exit code `1`. A store that is invalid or cannot be opened always raises an error. Atomic never falls back to memory.
352
-
353
- From the SDK, `sessionStore` accepts all five selection kinds (`{ kind: "sqlite", path, prefix? }`, `{ kind: "jsonl", dir }`, `{ kind: "memory" }`, `{ kind: "database", database, prefix? }`, and `{ kind: "adapter", module, options?, secrets?, prefix? }`) or a concrete `SessionStore` instance (`SqlSessionStore`, `JsonlSessionStore`, or `MemorySessionStore`). Passing an explicit `sessionManager` bypasses store selection:
354
-
355
- ```typescript
356
- const { session } = await createAgentSession({
357
- sessionStore: { kind: "sqlite", path: "/data/sessions.sqlite" },
358
- });
359
- ```
242
+ - `--session-store` cannot be combined with `--session-dir` or `--no-session`, and `ATOMIC_CODING_AGENT_SESSION_DIR` cannot be combined with `ATOMIC_SESSIONS_STORAGE`, `--storage`, or `--storage-file`.
243
+ - `--session-prefix` applies only with `--session-store` on a local SQLite file (matching `[A-Za-z_][A-Za-z0-9_]*`, never starting with `sqlite_`). For PostgreSQL, use a lowercase prefix up to 24 characters via `storage.prefix` or `atomic storage join --prefix`.
244
+ - Invalid storage configuration or unreachable stores always fail with an error rather than silently falling back to memory.
360
245
 
361
- See [SDK session storage](/sdk/storage) for PostgreSQL, direct `SessionStore`, and store-closing recipes, [SDK and local SQLite API](/storage/sqlite#sdk-and-local-sqlite-api) for low-level SQLite handles, and [Session file format](/session-format) for JSONL schemas, entry types, and the `SessionManager` API.
246
+ For programmatic store selection, `SessionStore` implementations, and store-closing rules in Node.js and TypeScript, see [SDK session storage](/sdk/storage). For JSONL schemas, entry types, and `SessionManager` methods, see [Session file format](/session-format).