Skip to content
AAtom

Tools

The 13 local executors, caps, approval classes, background tasks.

13 local tool executors (src/tools.ts). Node builtins plus global fetch only. Every executor returns a string and never throws across the tool boundary: failures come back as Error: ... strings so the model can react.

Source of truth for names and shapes is TOOL_DEFINITIONS in src/tools.ts. The validator and loop build their Available: ... lists from it.

The 13 tools

ToolWhat it doesPermission in normal mode
readRead files, list directories. Args: path, optional 1-based offset/limitauto
writeCreate or overwrite files (creates parent dirs). Silent pre-mutation snapshot for rewindasks
editExact-match patch. Fails on no match, on multiple matches without replaceAll, on stale readasks
grepLine-regex search under dir. include glob, outputMode: content, files_with_matches, countauto
globList paths matching pattern under dir, newest-firstauto
bashShell command. JSON result with exitCode, stdout, stderr. Optional runInBackgroundasks
bash_outputPoll a background shell task by taskIdauto
webfetchFetch a page as markdown, text, or html. http upgrades to httpsauto
websearchKeyless discovery via DuckDuckGo HTML endpoint. query, optional numResults, siteauto
ask_questionInteractive picker for clarifications. Needs question plus at least 2 optionsn/a (is interaction)
todowriteReplace the session task checklistauto
todo_getRead the session task checklistauto
todo_updateUpdate one checklist item by indexauto

Read-only set: read, grep, glob, webfetch, websearch, bash_output, todowrite, todo_get, todo_update. Approval set: write, edit, bash. ask_question never needs approval because it is user interaction.

Caps and truncation

PathCapBehavior
read output~64KBHead plus truncation note. Full text spills to <tmpdir>/atom-overflow/ with a read pointer
bash stdout/stderr~8KB eachEach stream capped independently, JSON flags stdoutTruncated/stderrTruncated, overflow pointer on spill
bash_output streams~8KB eachSame spill behavior for background stdout/stderr
webfetch download~1MBNoted as [truncated: download exceeded ~1MB]
webfetch output~64KBSame overflow-file pointer as read
grep content100 matchesLines over 200 chars shortened with an ellipsis. file:line: text shape
grep files/count100 filesfiles_with_matches is newest-first with a Found N file(s) header. count adds per-file file:count plus totals covering every match
glob200 matchesNewest-first by mtime, recency as relevance proxy
websearchdefault 8, max 20Numbered title plus url plus snippet blocks, or No results. Query capped at 500 chars
bash timeoutdefault 60000ms, max 120000mstimedOut flag in the JSON result
bash_output waitdefault 5000ms, max 60000msPolls about every 100ms until exit or wait expiry
Background tasks20 recordsOldest evicted first, temp files pruned best-effort
Agentic loop30 steps defaultATOM_MAX_TOOL_STEPS, clamped 5-100

Count-cap notes (grep/glob over-cap) and prompt-assembly caps (skills, compact, AGENTS.md, history) do not spill: re-query to narrow.

Path handling

No path sandbox. Relative paths resolve against cwd. Absolute paths and .. escapes are allowed anywhere on the machine, including sensitive locations like ~/.ssh/. Treat those contents as untrusted. Never exfiltrate or commit secrets. The permission mode is the control plane. See Permissions.

Only empty/non-string paths and null bytes are rejected.

Safety guards

  • Read-tracking: read records a sha1 per resolved file. edit refuses with a stale-read error when the file changed since the last read. write/edit refresh the record. Files never read this session have no record.
  • Pre-mutation snapshots: write/edit capture prior bytes for /rewind. See Sessions.
  • Validation: malformed args return Error: invalid call: ... Fix the arguments and retry. The tool never ran. Runtime failures return plain Error: ....
  • Binary skip: grep skips unreadable files and files containing null bytes.

Background shell

bash with runInBackground: true returns immediately with {backgroundTaskId, status: "running", hint}. Poll with bash_output (taskId, optional timeoutMs). Result JSON carries taskId, running, exitCode (null while running), stdout, stderr, timedOut.

Windows note: background spawns attached (detached children drop output on Windows). POSIX uses detached process groups. Observable contract is the same: immediate return, independent run, output to temp files under the OS temp dir.