ls and tool_search) are off by default and can be enabled per run or in settings.
Bundled integrations also add
code_search, web search and fetching, MCP servers, subagents, and Intercom:
Codemode
Sandbox globals, return shapes, branch storage, classifiers, image generation, and limits.
Background tasks
Observe, steer, and stop long-running shells, subagents, and slow history reads.
Web access
Search the web, fetch webpages, PDFs, GitHub repos, and videos, and query DeepWiki.
MCP servers
Connect external stdio and streamable HTTP tools, resources, and OAuth logins.
Execution rules and diagnostics
- Tool concurrency. Within a single assistant turn, tools fall into three modes:
- Exclusive:
codemodeacts as a turn barrier—it waits for earlier tool calls to finish and blocks later calls until it completes. - Sequential:
edit,write,todo,ask_user_question, andbashorpowershellwithpty: truerun one at a time in call order. - Parallel:
read,find,search,ls,kill,tool_search, non-PTY shell commands, MCP tools, and web-access tools can run in parallel.
- Exclusive:
- 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 anOperation abortederror and discarding any late return. Override this grace period in milliseconds withATOMIC_TOOL_ABORT_GRACE_MS(0skips waiting). - Inspecting active tools. Run
/toolsto see active tools, why inactive tools are off, and any unrecognized names indefaultTools. Its Git section reports whichgitbinary Atomic uses (system,provisionedportable Git, orunavailablewith an install command) and any failed portable Git update. See Git. SDK and RPC clients get the same report fromsession.getToolStatus()andget_tools. - 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.
Enabling and restricting tools
Control which tools a session exposes from the CLI, settings, SDK, or extensions:read and path selectors
read reads files, directories, images, documents, archives, SQLite databases, internal Atomic resources, and public HTTP(S) URLs through one path parameter. When reading past sessions via history://, it also supports background observation using the same wait and action: "wait" model as bash.
It supports two mutually exclusive call modes:
- Read a target: pass
path(required), plus optionalwait(used only forhistory://URLs; ignored for local files, directories, archives, SQLite, and web URLs). - Wait on a background history read: pass only
action: "wait",id(the task ID returned earlier, such as"history-3"), and optionalbudgetMs(milliseconds; omit for the default 10-second wait, or pass0to check immediately). Do not combineaction: "wait"withpathorwait. This wait observes onlyhistory-Ntasks from ahistory://read or search that continued in the background. It is not a general sleep: wait for a shell command withbashand for a subagent withsubagent.
wait or using wait: { kind: "foreground" } waits up to 10 seconds by default. If the read takes longer, it keeps running and gives you a task ID. Use wait: { kind: "background" } to get a task ID right away, or wait: { budgetMs: 5000 } to wait up to five seconds. You can also write the time as "5000". Passing null for optional fields is the same as leaving them out.
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 and Background tasks..git and node_modules and caps each child directory at 12 entries while preserving the oldest shown entry with an elision marker.
Lines and local resources
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:
- 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-orfile.ts:5(line 5 to end of file without widening),file.ts:5:16(colon range or grep-stylefile: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 (:0fails 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:rawfor exact bytes, CRLF endings, or raw notebook JSON without labels. Out-of-range selectors report beyond EOF. Onhistory://sessions/<id>:A-B, numbers select 1-indexed session entries rather than lines. - 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).
- Images.
readdetects 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. - Archives (
read,search,write). Supports.zip,.jar,.tar,.tgz,.tar.gz, and.gz(gzipped tar archives only—not standalone single-file.gzstreams) 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 containraw,conflicts,1,L1, orraw:notes.txt. Archive writes reject directory targets ending in/. - SQLite (
read,search,write). Supports.sqlite,.sqlite3,.db, and.db3files (including Windows drive paths). Non-SQLite files with those extensions are treated as plain files. See SQLite limits and writes for syntax and examples.
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.Internal URLs and web schemes
Each URL scheme has a fixed set of supported tools and permissions:
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.
SQLite limits and writes
Use colon and query selectors to inspect tables, filter rows, run read-only SQL, or write individual rows:- Read limits. Reading a table (
app.db:users) returns its schema plus 5 sample rows by default. Supported query parameters arelimit(max500),offset,where,order(col:asc,col2:desc, defaulting toasc),schema=true(or1),sampleRows/sample_rows(clamped0to100), andid(aliases:rowId). Query reads default to 20 rows (max500). Table listings cap at 500 (excludingsqlite_%); row counts probe up to 50,001 rows. - Query and filter safety. Raw
?q=accepts a singleSELECTstatement (max1,000rows). Both?q=andwhere=blocksqlite_%,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), andwhere=also blocksSELECT,LIMIT,OFFSET, andPRAGMA. - Writes. Table writes (
writetoapp.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 replyInserted row into <table>,Updated row ..., orDeleted row .... - 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.
Conflict resolution and file writes
- Reading.
conflict://*lists up to 100 conflict regions across up to 10,000 scanned files under the working directory (skipping.git,node_modules, and.gitignoreor.ignorepaths; files previously read with:conflictsappear first in read order). Conflict IDs are 1-indexed (conflict://1, neverconflict://0).conflict://<id>showsours,theirs, andbase;conflict://<id>/ours,theirs, orbasereturns one read-only side. - Matching. Matches exact Git 7-character markers (
<<<<<<<,|||||||,=======,>>>>>>>, alone or followed by a space and label) in order. Longer runs such as markdown==========stay untouched, and malformed regions are skipped. - Writing. Write to
conflict://<id>orconflict://*using literal text or@ours,@theirs, and@base(preserving that side’s exact bytes). Other text writes as UTF-8 using the region’s line endings while keeping the rest of the file byte-identical. Stale conflicts that changed on disk since reading are refused.
Documents and URLs
- Formats. Extracts readable text from HTML URLs, Jupyter notebooks (0-based
cell:NIDs, preserving unknown fields), and PDF,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.rtf, and.epubdocuments (including extensionless downloads identified byContent-Type). - URL normalization and fetching.
readacceptshttp://,https://, barewww.*URLs (defaulting tohttps://), 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. - Markdown discovery. For HTML pages,
readfirst checks for a native markdown representation via an alternate<link>tag, a.mdURL suffix, orAccept: text/markdowncontent negotiation. Otherwise it converts the HTML to markdown; only if conversion yields 100 characters or fewer or looks low-quality does it probellms.txt/llms.mdendpoints (including/.well-known/llms.txtand parent path segments). - 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.
edit
Use edit to replace part of an existing file without rewriting the whole file. Copy the text you want to change from the file so it matches in exactly one place. You don’t have to call read first if you already know what’s in the file.
Suppose example.js contains this function:
prepare(); before start();. The oldText block is less indented than it is in the file:
pathis the file to change, either an absolute path or one relative to the working directory.editsis the list of replacements to make in that file.oldTextis the current text to find. In JSON,\nstarts a new line.newTextis what to put in its place. Use""to delete the matched text.
edit leaves the whole file unchanged. For integrations that send an edit in another form, edit also accepts a single object in edits, an array or object encoded as a JSON string, or oldText and newText next to path.
How edit finds the text
- It looks for an exact match first.
- If it finds none, it allows differences such as spaces at the end of a line, curly versus straight quotes, and some other equivalent characters.
- If it still finds none, it tries to match whole lines with different indentation. The block can be indented more or less than the file, but the lines must nest in the same way. If one block matches and the indentation can be converted consistently,
editadjusts the replacement to fit the file’s tabs or spaces. It does not ignore differences in spaces between words.
edit stops and reports the ambiguity.
In this example, the if block has the same nesting in the request and the file. edit keeps the file’s indentation:
edit will write to the file.
When an edit fails
If the text appears more than once, add nearby lines tooldText so it matches only one place. Keep those lines in newText too. If nothing matches in a nonempty file, edit points to the closest lines and shows where the text differs. For example, suppose you copy the block with its indentation but put halt(); in oldText where the file says start();. The error points to line 3:
oldText. Make newText use the same indentation. Extensions and SDK integrations can check the edit error codes instead of parsing the message.
edit works on UTF-8 text. It keeps the file’s line endings and byte order mark, if present. To edit a Jupyter notebook (.ipynb), use the # %% [code] cell:N format that read shows. edit keeps the notebook’s cell metadata, outputs, and execution counts. The notebook preview appears with the result.
write
write creates a file or replaces its full content (path and content), creating missing parent directories automatically and returning Successfully wrote to <path>. No prior read is required. Use edit for targeted changes to existing files.
write also supports archive members, SQLite table and row selectors, conflict:// resolutions, and local:// resources (see Lines and local resources and Edit and write errors).
bash
bash runs shell commands in the workspace and can observe or wait on background shell tasks. It supports two mutually exclusive call modes:
- Run a command: pass
command(required) with optionalcwd,env,timeout,wait,pty, andheartbeatMs. - Wait on a command that continued in the background: pass only
action: "wait",id(the shell task ID, such as"task-1-0-3"), and optionalbudgetMs.budgetMssets how long the wait lasts, so leave outtimeout,wait, and the other command fields.
-
Observation and background yield (
wait,action: "wait").waitcontrols how long the tool observes output and never changes the executiontimeout. Whenwaitis omitted (orwait: { kind: "foreground" }omitsbudgetMs) in interactive and standard sessions, Atomic yields automatically after 10 seconds while the command keeps running in the background. Passwait: { kind: "background" }(withoutbudgetMs) to return immediately with the task ID after the command starts, orwait: { kind: "foreground", budgetMs }to wait up tobudgetMsmilliseconds before yielding. Passingnullfor 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). -
Incremental paging on
action: "wait". Calling{ action: "wait", id, budgetMs? }(0checks 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. -
cwdand leadingcd. Sets the working directory for the command. Ifcwdis omitted, a leadingcd <path> && ...orcd <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 whenCDPATHapplies to a non-dot relative path or the local directory cannot be entered. -
envand 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 setsATOMIC_SESSION_ID,ATOMIC_PROVIDER,ATOMIC_MODEL, andATOMIC_REASONING_LEVEL(and legacyPI_*aliases) and strips caller-supplied overrides for those keys plusATOMIC_SESSION_FILE/PI_SESSION_FILE. -
Execution
timeout. Commands have no time limit by default and run until they finish, someone stops them (killor/tasks), or the session closes.waitnever stops a command. Passtimeoutin seconds to set a hard execution deadline: - 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.
-
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. SetATOMIC_NO_PTY=1to force pipes (see Environment variables). On Windows with a WSL stdin-transport bash shell, supervised execution fails withContainmentUnavailable: run Atomic inside WSL to supervise Linux guest commands. -
heartbeatMs. Background task heartbeat interval in milliseconds (defaults totasks.heartbeatMsor 15 minutes;0disables; minimum60000). See Background tasks reference. -
Terminal formatting. With
pty: true, Atomic removes color and cursor codes from the initial result sent to the model. This also applies topowershell. Those codes are still available in the full-output file (when present), structured output returned to codemode, or output retrieved in a lateraction: "wait"call. For ordinary pipe output, omitptyor set it tofalse. -
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).
Long-running servers and watchers
Start dev servers, file watchers, local databases, or tunnels withwait: { 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 for day-to-day management and /tasks controls.
Internal URL expansion (skill://, local://, artifact://):
- Only unquoted URLs starting a plain shell word expand to shell-quoted filesystem paths (for example
bash skill://my-skill/scripts/check.shorprintf %s local://notes.txt). Other schemes (conflict://,history://,tool-output://,http://,https://) stay literal text. - 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. - Structured
cwdandenvvalues always expand supported URLs. When using custom command prefixes or spawn wrappers, pass URLs incwdorenvinstead of relying on inline command expansion.
PowerShell
On native Windows, Atomic enablespowershell 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.
- Resolved paths use PowerShell single-quoted literals (doubling ASCII apostrophes and
U+2018–U+201Bsmart single quotes).bashalways uses POSIX quoting, even on Windows. - PowerShell commands force UTF-8 console output (
[Console]::OutputEncoding) and turn off progress output ($ProgressPreference = 'SilentlyContinue'). Errors and warnings that PowerShell writes as#< CLIXMLappear as the console shows them, after the command’s other output. Redirected stderr on a successful native command (such asgit 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 (`). - Unlike
bash, standalone SDK PowerShell sessions do not fall back to pipes if the native PTY fails.
kill
kill({ id: taskId }) stops a background task started in the current session:
- A shell command started by
bashorpowershell, including one that yielded to the background after the default wait. - A slow
history://readorsearchtask (with an ID such ashistory-3).
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.
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.
find and search
Use find to locate paths by glob and search to match file and resource contents by regular expression.
Finding paths
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).
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.
- Anchoring and case. Relative globs start at
cwd(src/**/*.tssearchessrc/;**/src/**/*.tssearches any nestedsrc/). Rooted globs (/**/*.ts,C:\**\*.ts,\\server\share\**\*.ts) search that root. Glob matching is case-sensitive on every platform (*.tsnever matchesA.TS). - Defaults and pruning. Includes hidden files and respects nested
.gitignorerules by default. Prunes.gitandnode_moduleseven withgitignore: false(namenode_modulesexplicitly to scan it). - 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. - 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.
- 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 applyinglimit, and caps output at 50 KiB.
Searching contents
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:
- Search contents: pass
pattern(required), plus optionalpaths(string or string array; omitted or empty searches.),i(boolean),case(boolean),gitignore(defaulttrue),skip(non-negative integer ornull, floored; ignored in single-file mode), andwait(used whenpathsincludes ahistory://URL). Hidden files are searched by default. - Wait on a background history search: pass only
action: "wait",id(such as"history-3"), and optionalbudgetMs(omit for the default 10-second wait, or pass0to check immediately). Do not combineaction: "wait"with search fields (pattern,paths,i,case,gitignore,skip, orwait). Like areadwait, it observes onlyhistory-Ntasks.
- Slow history searches and reads. On
history://targets,waitworks identically tobashandread: omittingwaitwaits 10 seconds before yielding,wait: { kind: "background" }returns a task ID immediately, andwait: { kind: "foreground", budgetMs }waits up tobudgetMsms. Running history tasks have no time limit and return a completion notice when finished. You can wait via eithersearch({ action: "wait", id })orread({ action: "wait", id })(both share the session’s history tasks, retaining the 16 most recently finished tasks for late waits) or stop one withkill({ 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. - 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://). Rejectshttp://andhttps://. Stringpathsvalues use the same comma, semicolon, and whitespace splitting rules asfind; missing paths are skipped when multiple targets are supplied (a single missing target errors). - 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. Settingi: trueorcase: falseenables case-insensitive matching (if bothi: trueandcase: trueare passed, case-insensitive matching wins). - 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,searchsupports 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:10forms are rejected. - Paging, caps, and context. Multi-file searches return 20 files per page (up to 20 matches per file), and
skippaginates files in multi-file mode. Single-file searches return up to 200 matches. Regular filesystem searches collect at most 2,000 matches beforeskippagination (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.contextBeforeandsearch.contextAfter). - 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: textfor matches,path-LINE- textfor context).
ls
ls is a built-in directory listing tool that is disabled by default. Enable it for one run with atomic --tools +ls or permanently with "defaultTools": ["+ls"].
- Parameters. Optional
path(defaults to the current directory) and optionallimit(maximum entries to return, default500). - Output. Lists directory entries sorted alphabetically, appends
/to directories, includes dotfiles, and truncates atlimitentries or 50 KiB (whichever is hit first).
todo
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.
- IDs. Task IDs are 8 lowercase hex characters (
^[a-f0-9]{8}$, matched case-insensitively). Tasks display asTODO-<hex>, andidacceptsTODO-<hex>,#<hex>, or the raw 8-hex string. - Statuses and ordering. New tasks default to
"open". Only"closed"and"done"(case-insensitive) count as closed; updating a task to"closed"or"done"clearsassigned_to_sessionautomatically.listreturns open tasks sorted with assigned tasks first, then unassigned tasks bycreated_atascending.list-allreturns every task including closed ones. - Locking. While a session edits a task, Atomic creates a
<hex>.lockfile 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. - Actions and parameters. Required
action:list,list-all,get,create,update(replacesbodyand updates fields),append(appends tobody),delete,claim(assigns an open task to the current session—fails on closed tasks; passforce: trueto override another session’s assignment), andrelease(clears assignment; passforce: trueto release another session’s assignment). Optional parameters:id,title,body,status,tags, andforce. Validation and lock errors return plain text error messages in the tool result rather than throwing.
ask_user_question
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.
- Limits and validation. Each call accepts 1 to 4 questions with 2 to 4 options per question,
headerup to 16 characters (a longer header is shortened with ”…” rather than rejected), and optionlabelup to 60 characters. Duplicate questions and duplicate option labels are rejected. Reserved labels ("Other","Type something.","Chat about this", and"Next") are rejected even onmultiSelect: true. - Multi-select and previews. Pass
multiSelect: trueto let the user choose multiple options (this hides the custom"Type something."choice). On single-select questions, options can include a markdownpreviewrendered side by side (which also hides"Type something."while keeping"Chat about this"). See Keybindings for dialog controls. - Custom prompt guidance. Machine-level overrides in
~/.config/rpiv-ask-user-question/config.jsoncan customizeguidance.promptSnippetandguidance.promptGuidelines. - Decision context. The question and options should tell you what you’re deciding, the facts you need, and what happens for each choice, without relying on earlier progress updates.
- Scoped approvals. A confirmation question should name the exact action, identify the target PRs or resources, and offer explicit proceed and decline choices:
--exclude-tools ask_user_question), the agent continues autonomously while respecting safety and approval gates.
codemode
codemode lets the model run JavaScript in a sandboxed worker (256 MiB memory cap) to compose permitted tool calls and return only filtered output. It is enabled by default.
Disable it in ~/.atomic/agent/settings.json or .atomic/settings.json:
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.
- Provider support. Works with every provider. Models supporting OpenAI grammar tools receive JavaScript-constrained input; other models see a regular tool. Confirm status with
/tools. - 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.
- Settings and MCP. Configure
codemode.inlineBudget(default3000estimated tokens) andcodemode.modein tool settings. Atomic’s MCP host remains the sole MCP connection owner.
store() and load(), models.classify(), models.generateImages(), subagent and Intercom access, and limits.
tool_search
Deferred tools and namespaces are omitted from codemode’s inline catalog. Scripts discover them via await searchTools(), await describeNamespace(), or ALL_TOOLS; for direct tool calls, enable tool_search.
tool_search is off by default. Enable it with "defaultTools": ["+tool_search"] or --tools +tool_search. It accepts a required non-empty query string and an optional positive integer limit (default 8).
- Searches only registered
codemodeanddeferredtools that are not already active, then activates matches for the next model turn. - Name matching normalizes punctuation to
_, ignores case, and accepts dottedmcp.<server>.<tool>names,mcp__<server>__<tool>, and__suffixes (such asthread_readformcp__app__thread_read). Exact names and__suffixes rank first. tool_searchis model-only (codemode scripts useawait searchTools()). It respects session tool restrictions and does not replace MCP server discovery.
code_search
Provided by the bundled web access integration, code_search answers code, architecture, and API questions about public GitHub repositories via DeepWiki MCP (https://mcp.deepwiki.com/mcp) with no API key or MCP setup:
- Parameters.
repoName(owner/repo, single repository, not a URL) and non-emptyquery(sent verbatim to DeepWiki’sask_question) are required. OptionalmaxTokensdefaults to5000(range1000to50000, best-effort output cap of about 4 characters per token plus truncation notice). - Limits and fallback. Uses a 60-second deadline with cancellation support. Results depend on DeepWiki indexing; errors and empty responses do not fall back to Exa. Use
web_searchfor broader discovery or unindexed repositories.
Persisted tool output
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>).
Where persisted output is stored depends on the session store and execution context:
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.
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.Edit and write errors
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.
- Inheritance and cross-process helpers (SDK).
EditInputError,EditMatchError, andEditTargetErrorextendEditToolError. Type guards (isEditToolError,isEditInputError,isEditMatchError,isEditTargetError, andisWriteSelectorError) also match cross-process copies bynameandcode. UseserializeFileToolError(which strips URL credentials from causes) withrehydrateEditToolErrorandrehydrateWriteSelectorErroracross process boundaries. - Aborts and OS errors. Cancelling
read,find,edit, orwritethrowsFileToolAbortedError(name: "AbortError",code: "aborted",causeset to the abort reason). OS write errors (EACCES,EISDIR, and similar) propagate directly. - SDK tool details. Extension hooks and SDK consumers can inspect structured
detailsreturned by built-in tools:readpopulatesmeta(source,sourcePath,truncation,limits) andimageUnsupportedByModel;editreturnsdiff, unifiedpatch, andfirstChangedLine;bashreturnswallTimeMs, non-zeroexitCode,timeoutSeconds(andrequestedTimeoutSecondswhen a fractional timeout was rounded to milliseconds), andfullOutputPath;findreturnsscopePath,fileCount, andfiles;searchsetsfileLimitReachedandmeta.limits.fileLimit.