Tools¶
The model reaches the machine through tools. Two facts shape the whole set:
- Nothing is withheld.
execruns anything with your privileges, so every
other tool is a convenience for doing the same thing precisely, not a sandbox
boundary. Read the security model. - Most of them are plugins.
pty,todo,fetch,repl,task,lsp,questionandcostship as bundled plugins through the same merge path a
third-party module gets. That means each can be shadowed by name or switched
off withdisabledPlugins, and none of them has a private path into the loop.
The core set¶
These are the harness itself (src/tools/index.ts → baseRegistry):
| Tool | One line |
|---|---|
read | File contents, line-numbered; images/audio/video attach as media when the model accepts them |
write | Create or overwrite a file |
edit | Patch a file through a whitespace-tolerant engine; reports what the change broke |
glob | Find files by wildcard pattern |
grep | Search contents with ripgrep when present |
exec | Run a shell command; never drifts from the session directory |
ctx | Search, hide and rewrite the model's own context window |
Bundled plugin tools¶
| Tool | Plugin | One line |
|---|---|---|
pty | bundled:pty | A persistent tmux-backed shell that keeps its cwd and env |
fetch | bundled:fetch | HTTP(S) → readable text, with the local network refused |
repl | bundled:repl | In-process JavaScript scratchpad with persistent variables and background jobs |
todo | bundled:todo | The session's task list, shown in the runtime header |
task | bundled:task | Delegate a subtask to another agent over ACP |
lsp | bundled:lsp | Definition / references / hover / symbols from a real language server |
question | bundled:question | Ask the user a structured question mid-run and wait |
mcp | bundled:mcp | Tools from every configured MCP server |
cost and gateway are also bundled plugins, but contribute no tool: a slash
command plus a status segment and a fox gateway subcommand respectively.
Every name above is what disabledPlugins takes, with or without thebundled: prefix.
Path resolution¶
Every tool that takes a path accepts a relative one and resolves it against
the session's cwd. Absolute paths are for paths genuinely outside the project.exec's workdir and pty's starting directory follow the same rule — but onlypty keeps drifting after that. See exec vs pty.
Slow calls¶
A step runs its tool calls in parallel and waits for all of them. One slow call —
a 30-second build, a read of something on a cold network mount — therefore used
to hold the whole step, and the model saw nothing until it finished.
autoBackgroundMs (default 3000) bounds that wait. A call still running when
the window expires stops being waited on: the step continues, the rest of the
results reach the model, and the slow call keeps running in the background. When
it finishes, its own result row and tool_end event land normally, so the
transcript shows the real output and a later step reads it without anyone
polling.
Three consequences worth knowing:
- The model is not told a call detached, and does not need to poll — the
result arrives on its own. It is the difference between "the agent waits three
minutes for a test suite" and "the agent does something else and reads the
result next step". autoBackgroundMs = 0disables detaching entirely: every call is waited on, as
before.- Only the wait is bounded. A tool that honours
ctx.signalstill stops
properly on interrupt; a detached call is not orphaned, it is unobserved.
Caps¶
Two config keys bound tool output, because a runaway command can otherwise
consume the context window in one step:
toolOutputCap(default 30 000 chars) — per-result cap across tools.readCap(default 50 000 chars) —readrefuses larger files and asks foroffset/limitinstead of silently truncating.
A third key bounds what you and the model read without touching what a tool
may produce:
toolPresentationCap(default 60 000 chars,0= never) — when a stored
result exceeds it, the harness appends areplaceview op holding a head+tail
excerpt. The row inmessageskeeps every byte, so/undoorctx restorebrings the whole thing back, and the transcript's expand key
re-reads it from SQLite.ctxandtodoare never truncated. Each such op
records a policyversion, so a replay can tell a harness excerpt apart from
actx-authored edit.
exec additionally takes full: true to lift the per-result cap for one call.
todo¶
todo replaces the whole list each call. The current list rides the runtime
header of every step, at the message tail rather than in the system prompt —
that placement is deliberate: a live value in the cached system-prompt prefix
would re-bill the whole prompt on every step.
Statuses are pending / in_progress / done; the plain rendering uses[ ] / [~] / [x] so it survives terminals without emoji support.