Skip to content

Tools

The model reaches the machine through tools. Two facts shape the whole set:

  • Nothing is withheld. exec runs 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,
    question and cost ship as bundled plugins through the same merge path a
    third-party module gets. That means each can be shadowed by name or switched
    off with disabledPlugins, and none of them has a private path into the loop.

The core set

These are the harness itself (src/tools/index.ts → baseRegistry):

ToolOne line
readFile contents, line-numbered; images/audio/video attach as media when the model accepts them
writeCreate or overwrite a file
editPatch a file through a whitespace-tolerant engine; reports what the change broke
globFind files by wildcard pattern
grepSearch contents with ripgrep when present
execRun a shell command; never drifts from the session directory
ctxSearch, hide and rewrite the model's own context window

Bundled plugin tools

ToolPluginOne line
ptybundled:ptyA persistent tmux-backed shell that keeps its cwd and env
fetchbundled:fetchHTTP(S) → readable text, with the local network refused
replbundled:replIn-process JavaScript scratchpad with persistent variables and background jobs
todobundled:todoThe session's task list, shown in the runtime header
taskbundled:taskDelegate a subtask to another agent over ACP
lspbundled:lspDefinition / references / hover / symbols from a real language server
questionbundled:questionAsk the user a structured question mid-run and wait
mcpbundled:mcpTools 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 the
bundled: 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 only
pty 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 = 0 disables detaching entirely: every call is waited on, as
    before.
  • Only the wait is bounded. A tool that honours ctx.signal still 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) — read refuses larger files and asks for
    offset/limit instead 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 a replace view op holding a head+tail
    excerpt. The row in messages keeps every byte, so /undo or
    ctx restore brings the whole thing back, and the transcript's expand key
    re-reads it from SQLite. ctx and todo are never truncated. Each such op
    records a policy version, so a replay can tell a harness excerpt apart from
    a ctx-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.