Skip to main content
Atomic ships a default set of coding tools for reading, editing, running commands, searching files, tracking tasks, and scripting multi-step operations. Two additional built-in tools (ls and tool_search) are off by default and can be enabled per run or in settings. 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: codemode acts 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, and bash or powershell with pty: true run 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.
  • Interrupting stuck tools. When you interrupt a turn (for example with Esc), Atomic waits up to 10 seconds for a tool call that ignores cancellation to stop before abandoning it with an Operation aborted error and discarding any late return. Override this grace period in milliseconds with ATOMIC_TOOL_ABORT_GRACE_MS (0 skips waiting).
  • Inspecting active tools. Run /tools to see active tools, why inactive tools are off, and any unrecognized names in defaultTools. Its Git section reports which git binary Atomic uses (system, provisioned portable Git, or unavailable with an install command) and any failed portable Git update. See Git. SDK and RPC clients get the same report from session.getToolStatus() and get_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:
  1. Read a target: pass path (required), plus optional wait (used only for history:// URLs; ignored for local files, directories, archives, SQLite, and web URLs).
  2. Wait on a background history read: pass only action: "wait", id (the task ID returned earlier, such as "history-3"), and optional budgetMs (milliseconds; omit for the default 10-second wait, or pass 0 to check immediately). Do not combine action: "wait" with path or wait. This wait observes only history-N tasks from a history:// read or search that continued in the background. It is not a general sleep: wait for a shell command with bash and for a subagent with subagent.
When you read a past session, leaving out 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.
Reading a directory returns a depth-2 tree sorted by most-recent modification time (with sizes and ages). It prunes .git and node_modules and caps each child directory at 12 entries while preserving the oldest shown entry with an elision marker.

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- or file.ts:5 (line 5 to end of file without widening), file.ts:5:16 (colon range or grep-style file:LINE:COL), comma-separated ranges (file.ts:5-16,960-973), and URL line ranges (https://example.test/page:5-8). Line numbers are 1-indexed (:0 fails with an error), and adjacent or overlapping ranges sort and merge automatically. Bounded reads add 1 leading and 3 trailing context lines, prefix each slice with [Lines 9-14 of 40], and end limited reads with the continuation selector. Append :raw for exact bytes, CRLF endings, or raw notebook JSON without labels. Out-of-range selectors report beyond EOF. On history://sessions/<id>:A-B, numbers select 1-indexed session entries rather than lines.
  • 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. read detects supported image files, resizes them automatically by default to match the active model’s resize profile, and returns an image block. If the active model does not accept images, Atomic warns you and sends a placeholder instead.
  • Archives (read, search, write). Supports .zip, .jar, .tar, .tgz, .tar.gz, and .gz (gzipped tar archives only—not standalone single-file .gz streams) without Python. Limits are 256 MiB per tar archive, 64 MiB per member, and 500 entries per directory listing. ZIP reading supports stored and deflate entries; ZIP selective writes reject entries with data descriptors. Tar rejects sparse files and base-256 numeric fields, and tar writes preserve other members and file modes while refusing to overwrite links, directories, duplicate members, or damaged headers. Member names may contain raw, conflicts, 1, L1, or raw:notes.txt. Archive writes reject directory targets ending in /.
  • SQLite (read, search, write). Supports .sqlite, .sqlite3, .db, and .db3 files (including Windows drive paths). Non-SQLite files with those extensions are treated as plain files. See SQLite limits and writes 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 are limit (max 500), offset, where, order (col:asc,col2:desc, defaulting to asc), schema=true (or 1), sampleRows / sample_rows (clamped 0 to 100), and id (aliases :rowId). Query reads default to 20 rows (max 500). Table listings cap at 500 (excluding sqlite_%); row counts probe up to 50,001 rows.
  • Query and filter safety. Raw ?q= accepts a single SELECT statement (max 1,000 rows). Both ?q= and where= block sqlite_%, pragma_*, ATTACH, DETACH, UNION, INTERSECT, EXCEPT, load_extension, comments (--, /*, */), and ;. Raw ?q= also blocks mutating DDL/DML (INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, REPLACE, VACUUM, REINDEX), and where= also blocks SELECT, LIMIT, OFFSET, and PRAGMA.
  • Writes. Table writes (write to app.db:users) accept {} (INSERT DEFAULT VALUES) or a JSON5 object (unquoted keys, single quotes, comments, trailing commas, +, and hex numbers) with valid column names and scalar values. On table inserts, a JSON "id" key automatically maps to a single primary key column of another name. Row writes (app.db:users:42) update that row; empty content deletes the row only when a row ID is specified. SQLite writes reply Inserted row into <table>, Updated row ..., or Deleted row ....
  • 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 .gitignore or .ignore paths; files previously read with :conflicts appear first in read order). Conflict IDs are 1-indexed (conflict://1, never conflict://0). conflict://<id> shows ours, theirs, and base; conflict://<id>/ours, theirs, or base returns 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> or conflict://* 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:N IDs, preserving unknown fields), and PDF, .doc, .docx, .ppt, .pptx, .xls, .xlsx, .rtf, and .epub documents (including extensionless downloads identified by Content-Type).
  • URL normalization and fetching. read accepts http://, https://, bare www.* URLs (defaulting to https://), and repairs collapsed single-slash schemes (https:/example.com). Fetches use a 10-second timeout, follow up to 5 redirects, cap response bodies at 10 MiB, and keep a session-scoped cache of 100 entries.
  • Markdown discovery. For HTML pages, read first checks for a native markdown representation via an alternate <link> tag, a .md URL suffix, or Accept: text/markdown content negotiation. Otherwise it converts the HTML to markdown; only if conversion yields 100 characters or fewer or looks low-quality does it probe llms.txt / llms.md endpoints (including /.well-known/llms.txt and parent path segments).
  • 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.
Network safety. read blocks private, localhost, .localhost, cloud-metadata, multicast, and reserved IP targets (including alternate numeric IPv4/IPv6 forms and redirects). Set ATOMIC_ALLOW_PRIVATE_URL_READS=1 only when a workflow must read private URLs. By contrast, fetch_content allows direct local/private HTTP fetches while keeping private URLs out of third-party fallbacks.

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:
This request adds prepare(); before start();. The oldText block is less indented than it is in the file:
  • path is the file to change, either an absolute path or one relative to the working directory.
  • edits is the list of replacements to make in that file.
  • oldText is the current text to find. In JSON, \n starts a new line.
  • newText is what to put in its place. Use "" to delete the matched text.
All replacements refer to the file before any edits. If two replacements overlap, combine them into one. If any replacement fails, 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

  1. It looks for an exact match first.
  2. 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.
  3. 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, edit adjusts the replacement to fit the file’s tabs or spaces. It does not ignore differences in spaces between words.
If a step finds multiple matches, 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:
In interactive mode, review the file preview. It shows the indentation that edit will write to the file.

When an edit fails

If the text appears more than once, add nearby lines to oldText 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:
Reopen the file and copy the exact lines, including their indentation, into 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:
  1. Run a command: pass command (required) with optional cwd, env, timeout, wait, pty, and heartbeatMs.
  2. 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 optional budgetMs. budgetMs sets how long the wait lasts, so leave out timeout, wait, and the other command fields.
  • Observation and background yield (wait, action: "wait"). wait controls how long the tool observes output and never changes the execution timeout. When wait is omitted (or wait: { kind: "foreground" } omits budgetMs) in interactive and standard sessions, Atomic yields automatically after 10 seconds while the command keeps running in the background. Pass wait: { kind: "background" } (without budgetMs) to return immediately with the task ID after the command starts, or wait: { kind: "foreground", budgetMs } to wait up to budgetMs milliseconds before yielding. Passing null for optional fields works the same as omitting them; non-null conflicting fields or invalid values are rejected. Background mode and task waits require a session with background task support (standalone SDK sessions without a task supervisor wait until the command finishes).
  • Incremental paging on action: "wait". Calling { action: "wait", id, budgetMs? } (0 checks immediately) on a still-running task reads incremental output from the last observed byte offset in 8 KiB pages (printing [Additional output not shown; wait again to retrieve retained output.] if more output is already buffered). Once the task finishes, waiting reads the full retained output from byte 0.
  • cwd and leading cd. Sets the working directory for the command. If cwd is omitted, a leading cd <path> && ... or cd <path>; ... sets the working directory when <path> is a single literal word (optionally single- or double-quoted, with no variables, globs, or leading -). Unquoted ~ and ~/ expand to your home directory. Atomic skips stripping when CDPATH applies to a non-dot relative path or the local directory cannot be entered.
  • env and session variables. Adds or overrides environment variables for the command. Every key must match ^[A-Za-z_][A-Za-z0-9_]*$; invalid names fail before spawning. Atomic automatically sets ATOMIC_SESSION_ID, ATOMIC_PROVIDER, ATOMIC_MODEL, and ATOMIC_REASONING_LEVEL (and legacy PI_* aliases) and strips caller-supplied overrides for those keys plus ATOMIC_SESSION_FILE / PI_SESSION_FILE.
  • Execution timeout. Commands have no time limit by default and run until they finish, someone stops them (kill or /tasks), or the session closes. wait never stops a command. Pass timeout in seconds to set a hard execution deadline:
  • 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. Set ATOMIC_NO_PTY=1 to force pipes (see Environment variables). On Windows with a WSL stdin-transport bash shell, supervised execution fails with ContainmentUnavailable: run Atomic inside WSL to supervise Linux guest commands.
  • heartbeatMs. Background task heartbeat interval in milliseconds (defaults to tasks.heartbeatMs or 15 minutes; 0 disables; minimum 60000). 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 to powershell. Those codes are still available in the full-output file (when present), structured output returned to codemode, or output retrieved in a later action: "wait" call. For ordinary pipe output, omit pty or set it to false.
  • 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 with wait: { kind: "background" }. They run with no timeout until you stop them with kill({ id }) or /tasks, they exit, or the session closes (resuming a session does not restart prior servers). They count toward the 64-command limit while active. See Background tasks 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.sh or printf %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 cwd and env values always expand supported URLs. When using custom command prefixes or spawn wrappers, pass URLs in cwd or env instead of relying on inline command expansion.

PowerShell

On native Windows, Atomic enables powershell automatically when pwsh.exe or powershell.exe resolves on PATH, preferring PowerShell 7 and falling back to Windows PowerShell 5.1. It takes the same parameters, wait modes, optional timeout, and 64-command concurrency pool as bash.
  • Resolved paths use PowerShell single-quoted literals (doubling ASCII apostrophes and U+2018–U+201B smart single quotes). bash always uses POSIX quoting, even on Windows.
  • PowerShell commands force UTF-8 console output ([Console]::OutputEncoding) and turn off progress output ($ProgressPreference = 'SilentlyContinue'). Errors and warnings that PowerShell writes as #< CLIXML appear as the console shows them, after the command’s other output. Redirected stderr on a successful native command (such as git push 2>&1 | Select-Object -Last 3) still reports success; on Windows PowerShell 5.1, this exit-status handling is skipped if the command ends with a trailing backtick (`).
  • 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 bash or powershell, including one that yielded to the background after the default wait.
  • A slow history:// read or search task (with an ID such as history-3).
Pass the task ID returned by the tool, not an OS process ID. kill never stops subagents or another session’s tasks. Stopping a history task replies History search <id> was stopped; it no longer reads the session store. and sends no completion notice. 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. 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/**/*.ts searches src/; **/src/**/*.ts searches any nested src/). Rooted globs (/**/*.ts, C:\**\*.ts, \\server\share\**\*.ts) search that root. Glob matching is case-sensitive on every platform (*.ts never matches A.TS).
  • Defaults and pruning. Includes hidden files and respects nested .gitignore rules by default. Prunes .git and node_modules even with gitignore: false (name node_modules explicitly to scan it).
  • 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 applying limit, 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:
  1. Search contents: pass pattern (required), plus optional paths (string or string array; omitted or empty searches .), i (boolean), case (boolean), gitignore (default true), skip (non-negative integer or null, floored; ignored in single-file mode), and wait (used when paths includes a history:// URL). Hidden files are searched by default.
  2. Wait on a background history search: pass only action: "wait", id (such as "history-3"), and optional budgetMs (omit for the default 10-second wait, or pass 0 to check immediately). Do not combine action: "wait" with search fields (pattern, paths, i, case, gitignore, skip, or wait). Like a read wait, it observes only history-N tasks.
  • Slow history searches and reads. On history:// targets, wait works identically to bash and read: omitting wait waits 10 seconds before yielding, wait: { kind: "background" } returns a task ID immediately, and wait: { kind: "foreground", budgetMs } waits up to budgetMs ms. Running history tasks have no time limit and return a completion notice when finished. You can wait via either search({ action: "wait", id }) or read({ action: "wait", id }) (both share the session’s history tasks, retaining the 16 most recently finished tasks for late waits) or stop one with kill({ id }). A session runs at most 4 active history searches/reads at once (separate from the 64 shell commands). History tasks are process-local, do not appear in /tasks, and cancel without completion notices on session close or /reload. See Slow history searches.
  • Targets and path splitting. Searches files, directories, globs, archive members, SQLite selectors (.sqlite, .sqlite3, .db, .db3), and supported internal URLs (local://, skill://, artifact://, conflict://, history://, tool-output://). Rejects http:// and https://. String paths values use the same comma, semicolon, and whitespace splitting rules as find; missing paths are skipped when multiple targets are supplied (a single missing target errors).
  • Patterns and case sensitivity. Whitespace-only patterns are rejected; all other patterns pass verbatim, including inline (?i), (?m), (?s), and (?x) flags at the start of patterns on resource-backed selectors. Setting i: true or case: false enables case-insensitive matching (if both i: true and case: true are passed, case-insensitive matching wins).
  • Line selectors. Line-range selectors work on single files only (directories and globs fail with an error) and restrict matches before adding context lines. Unlike read, search supports only :N (matches only line N, not N-to-EOF), :A-B, :A..B, :A+C, and comma-separated combinations; open-ended :N-, L-prefixed :L5-L10, and colon :5:10 forms are rejected.
  • Paging, caps, and context. Multi-file searches return 20 files per page (up to 20 matches per file), and skip paginates files in multi-file mode. Single-file searches return up to 200 matches. Regular filesystem searches collect at most 2,000 matches before skip pagination (refine the pattern or path if that cap is hit). Archive, SQLite, and internal-URL searches do not use the 2,000-match cap (SQLite tables default to 1,000 rows; history:// uses its own byte/row/time budgets and cursor pagination). Context defaults to 1 line before and 3 after (search.contextBefore and search.contextAfter).
  • Limits and format. Local files cap at 4 MiB, lines truncate at 512 characters, combined output caps at 50 KiB, and native filesystem grep uses a 30-second timeout. Output is plain text (path:LINE: text for matches, path-LINE- text for context).

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 optional limit (maximum entries to return, default 500).
  • Output. Lists directory entries sorted alphabetically, appends / to directories, includes dotfiles, and truncates at limit entries 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 as TODO-<hex>, and id accepts TODO-<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" clears assigned_to_session automatically. list returns open tasks sorted with assigned tasks first, then unassigned tasks by created_at ascending. list-all returns every task including closed ones.
  • Locking. While a session edits a task, Atomic creates a <hex>.lock file with a 30-minute lifetime. Within 30 minutes, conflicting writes fail immediately. After 30 minutes, interactive mode prompts to take over the stale lock while non-interactive mode fails with an error.
  • Actions and parameters. Required action: list, list-all, get, create, update (replaces body and updates fields), append (appends to body), delete, claim (assigns an open task to the current session—fails on closed tasks; pass force: true to override another session’s assignment), and release (clears assignment; pass force: true to release another session’s assignment). Optional parameters: id, title, body, status, tags, and force. Validation and lock errors return plain text error messages in the tool result rather than throwing.

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, header up to 16 characters (a longer header is shortened with ”…” rather than rejected), and option label up to 60 characters. Duplicate questions and duplicate option labels are rejected. Reserved labels ("Other", "Type something.", "Chat about this", and "Next") are rejected even on multiSelect: true.
  • Multi-select and previews. Pass multiSelect: true to let the user choose multiple options (this hides the custom "Type something." choice). On single-select questions, options can include a markdown preview rendered side by side (which also hides "Type something." while keeping "Chat about this"). See Keybindings for dialog controls.
  • Custom prompt guidance. Machine-level overrides in ~/.config/rpiv-ask-user-question/config.json can customize guidance.promptSnippet and guidance.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:
A cancelled or unanswered question is not approval. When no interactive question tool is available (for example in non-interactive runs or with --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:
Disable it for one run with atomic --tools -codemode. Explicit allowlists must name every desired tool (for example atomic --tools read,search,find,codemode). MCP servers configured for codemode exposure activate codemode if defaultTools omits it, but not after an explicit -codemode.
  • 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 (default 3000 estimated tokens) and codemode.mode in tool settings. Atomic’s MCP host remains the sole MCP connection owner.
See Codemode for globals, return shapes, store() and load(), models.classify(), models.generateImages(), subagent and Intercom access, and limits. 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 codemode and deferred tools that are not already active, then activates matches for the next model turn.
  • Name matching normalizes punctuation to _, ignores case, and accepts dotted mcp.<server>.<tool> names, mcp__<server>__<tool>, and __ suffixes (such as thread_read for mcp__app__thread_read). Exact names and __ suffixes rank first.
  • tool_search is model-only (codemode scripts use await searchTools()). It respects session tool restrictions and does not replace MCP server discovery.
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-empty query (sent verbatim to DeepWiki’s ask_question) are required. Optional maxTokens defaults to 5000 (range 1000 to 50000, 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_search for 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, and EditTargetError extend EditToolError. Type guards (isEditToolError, isEditInputError, isEditMatchError, isEditTargetError, and isWriteSelectorError) also match cross-process copies by name and code. Use serializeFileToolError (which strips URL credentials from causes) with rehydrateEditToolError and rehydrateWriteSelectorError across process boundaries.
  • Aborts and OS errors. Cancelling read, find, edit, or write throws FileToolAbortedError (name: "AbortError", code: "aborted", cause set to the abort reason). OS write errors (EACCES, EISDIR, and similar) propagate directly.
  • SDK tool details. Extension hooks and SDK consumers can inspect structured details returned by built-in tools: read populates meta (source, sourcePath, truncation, limits) and imageUnsupportedByModel; edit returns diff, unified patch, and firstChangedLine; bash returns wallTimeMs, non-zero exitCode, timeoutSeconds (and requestedTimeoutSeconds when a fractional timeout was rounded to milliseconds), and fullOutputPath; find returns scopePath, fileCount, and files; search sets fileLimitReached and meta.limits.fileLimit.