Skip to main content
Tools are how the model acts: it reads and edits files, searches, runs commands, fetches web pages and starts other agents by calling them. This page lists every built-in tool by the name the model uses, what it does, its main parameters and its limits. You see these names in the transcript and in approval prompts, and you use them in permission rules.

Approval

Each tool has a default approval level. It decides what happens in the default ask permission mode: Other modes change this:
  • accept-edits also runs write, edit and notebook_edit without asking.
  • review has the session model review each call that would ask, and asks you only if the review doesn’t approve it.
  • auto runs everything except package installs in which o4 finds install-time scripts, or can’t tell whether a named npm package has them; see Installs with install-time scripts.
  • bypass runs everything.
  • plan blocks everything that isn’t “Never asks”.
Permission rules and hooks can allow, deny or require a prompt for a specific tool. Shell commands also run inside the sandbox, whatever the approval. In every mode, including bypass, o4 refuses a package install whose package name is one or two characters away from a popular package’s name, and the model gets a Supply-Chain Gate: BLOCK message. o4 reads the command as the shell does, so an install that is only mentioned (in quotes, a commit message or a heredoc’s text) isn’t checked. Before o4 0.4.31, such words were read as package names and could block a command that installs nothing. Every tool’s text output is capped at 100,000 characters. Longer output keeps the first and last 10,000 characters with a note in between.

Files

The file tools work inside the project directory and your home directory. They refuse credential locations in your home directory, such as ~/.ssh, ~/.aws, ~/.config/gh, ~/.netrc and o4’s own ~/.o4/settings.json. When you pass -C, --add-dir, --sandbox read-only or --sandbox workspace-write, they work only inside the working directory and the added directories, and --sandbox read-only also refuses every write. See Sandbox.
  • file_path (required): absolute path to the file.
  • offset: 1-based line to start from.
  • limit: number of lines to read. Default 2000.
Lines longer than 2000 characters are cut. Text files up to 25 MB can be read. SVG files are read as text.
  • file_path (required): absolute path to the file.
  • content (required): the full new content.
Writes up to 50 MB. Each write can be reversed with undo or /undo.
  • file_path (required): absolute path to the file.
  • old_string (required): the text to replace. It must match exactly one place in the file unless replace_all is set.
  • new_string (required): the replacement.
  • replace_all: replace every occurrence.
Works on files up to 25 MB. The approval prompt shows a preview of the change.
  • notebook_path (required): path to the .ipynb file.
  • new_source (required): the new cell content.
  • cell_id: the cell to edit. Leave it out to insert a new cell.
  • cell_type: code or markdown.
  • insert_after: insert the new cell after this cell ID.
o4 has no search tool of its own since 0.4.34. The model searches by running ripgrep (rg) with the bash tool: rg <pattern> for file contents, and rg --files -g '<glob>' to find files by name. A search is a shell command, so it asks for approval like any other command unless one of your permission rules allows it. A released o4 carries its own copy of ripgrep and puts it first on the PATH of every bash command, so rg works on a machine with none installed. It unpacks that copy to ~/.o4/bin on first use. On Linux this also holds for commands that run in the sandbox.
  • path (required): the folder to list.
Lists at most 10,000 entries.
  • subcommand (required): status, diff or log.
  • ref: a ref or range, such as HEAD~3 or main..feature, for diff and log.
  • path: limit diff to a file or folder.
  • count: number of commits for log. Default 10.
It never changes the repository.

Shell and code execution

  • command (required): the command to run.
  • timeout: milliseconds. Default 600,000 (10 minutes), maximum 1,800,000 (30 minutes). 0 turns the timeout off.
  • working_directory: folder to run the command in.
  • run_in_background: start the command as a background task and return a task ID right away. For dev servers, watchers and other long-running commands.
  • description: what the command does, in a few plain words, such as “Run the parser tests”. It becomes the task’s title in /agents and the task list when the command runs in the background. Without it, the title is the command itself on one line, without leading VAR=value settings, cut to 60 characters.
  • justification: one sentence shown on the approval prompt explaining why the command is needed.
The working directory carries over between calls; shell variables and other shell state don’t. Output is limited to 100,000 characters. Commands run inside the sandbox. A command that runs past its time limit can be moved to the background instead of failing; see Todos and background tasks.
  • language (required): python (runs python3) or node.
  • code (required): the code to run.
Variables persist between calls in the same session. Each call times out after 30 seconds.
  • pattern: only run tests whose names match.
  • file: run the tests for one file.
  • timeout: seconds. Default 300, maximum 1,800; 0 turns it off.
  • impacted_only: run only the tests affected by the current changes, falling back to the full suite when unsure.
  • impact_set: a precomputed set of impacted tests to use with impacted_only.
It detects the project type from Cargo.toml, package.json, pyproject.toml, setup.py or go.mod, and returns each test’s name, status, duration, location and failure message.
  • file_path (required): the file to format.
  • timeout: milliseconds. Default 120,000.
Available only when you’ve configured at least one formatter. See Language servers and formatters.

Web

  • url (required): the URL.
Times out after 30 seconds and reads at most 10 MB. Only public addresses are allowed; private and internal addresses are refused.
  • url (required): a public URL.
  • prompt (required): the question to answer about the page.
The page content is cut to about 20,000 characters.
  • query (required): the search terms.
  • count: number of results. Default 5, maximum 10.
Uses the Brave Search API if you’ve saved a brave key in /config > Providers or set BRAVE_API_KEY, otherwise Tavily with a tavily key or TAVILY_API_KEY, otherwise DuckDuckGo on a best-effort basis. With both keys, it tries Tavily when a Brave search fails. See Environment variables.
fetch and web_search follow the sandbox’s host rules, so in the guarded tier a request to a host that isn’t allowed prompts you first. See Sandbox.

Planning and goals

See Plan mode and Goals.

Todos and background tasks

See Todos and background tasks.

Agents and teams

  • prompt (required): the task for the subagent.
  • agent: the agent definition to use, such as Explore, Plan, General or one of your own. Leave it out to fork the current conversation.
  • description: a short label for the display.
  • model: a provider:model reference to use instead of the current model.
  • background: run it in the background and return a task ID right away.
  • name: a name other agents can use to reach it with send_message.
  • isolation: worktree runs it in its own git worktree.
  • structured_output_schema: a JSON Schema. The subagent then gets a StructuredOutput tool and must call it once with a result that matches.
  • contract: a task contract with task, context, done_when (a shell command and the result that proves the work is done), touch_only (the files it may change) and on_failure. When touch_only names more than one file, o4 checks done_when itself by default.
  • verify: a shell command that replaces that check, or false to turn it off. A failing check goes back to the subagent, up to 2 retries.
See Subagents.
  • description (required): the overall goal.
  • workers (required): the workers, each with a role (the agent to use) and a task, and optionally a model.
  • strategy: parallel (the default), sequential, map_reduce or collaborative.
  • timeout_secs: a time limit per worker. No limit if left out.
  • auto_approve: accepted, but o4 0.4.23 doesn’t use it.
See Campaigns.
  • summary (required): the report, up to 100,000 characters.
  • files: paths to attach, up to 1 MB each and 5 MB in total.
Outside a subagent, it returns the report directly.

Code intelligence

codebase_query takes an operation (such as callers_of, find_symbol or changed_together) and a target. The index lives in .o4/index/codebase.db and is built in the background when a session starts. lsp takes an operation, a filePath, and a 1-based line and character. It needs a language server for that file type installed; by default o4 looks for rust-analyzer, typescript-language-server, pyright-langserver and gopls. In o4 0.4.23 o4 doesn’t send the server the initialize request, so standard servers such as rust-analyzer answer with an LSP error -32002. See Code intelligence and Language servers and formatters.

Memory

Each memory tool takes a scope: project (the default, stored in .o4/memory/memory.db) or global (stored in ~/.o4/memory/global.db). The global store is available only in a trusted workspace. See Memory.

Workflows

With workflow.enabled set to false, none of these tools is offered, and helpers inside a workflow can’t use them. In print mode a workflow runs only in the auto and bypass permission modes. See Dynamic workflows.

Skills

See Skills.

MCP

If your built-in and MCP tools add up to more than 64, o4 doesn’t send the MCP tools to the model up front. It adds tool_search instead, and the model loads MCP tools as it needs them. See MCP servers.

Worktrees

The new branch starts from the remote’s main branch as of the last git fetch, or from the checked-out commit when the project has no remote. It doesn’t track main, so a plain git push from it can’t land on main. o4 doesn’t move into the worktree. The session keeps working in your project folder, and works in the worktree by its path, so other tabs aren’t affected. A session can have several worktrees. When you close the tab or quit o4, it removes the worktrees the session made, except ones with uncommitted changes or commits that aren’t pushed anywhere. exit_worktree won’t merge when your project folder’s branch doesn’t contain the commit the worktree started from, because the merge would also bring in newer commits from main. Push the branch and open a pull request instead.

Other tools

CodeMode

See CodeMode.

Where each tool is available

Not every tool is offered in every kind of session:
  • Plan mode. The model can only use read, ls, fetch, task_create, task_update, task_list, enter_plan_mode and exit_plan_mode. Other tools stay in its tool list, but o4 refuses a call to one. See Plan mode.
  • Print mode (o4 -p). There’s no one to ask, so ask_user_question isn’t offered, and neither are undo, todo_write, the plan_*, checkpoint_* and goal tools, lsp, format, list_mcp_resources, read_mcp_resource and tool_search. The task_* tools are offered, and a bash command that runs past its timeout or past auto_background_ms (2 minutes by default) moves to the background, as in a session. MCP server tools are still offered. See Print mode and scripting.
  • Sessions in the daemon. A session that runs in the o4 daemon has no format tool.
  • Subagents. A subagent gets read, ls, write, edit, bash, fetch, web_search, git_info and your MCP server tools, narrowed by its agent definition, plus agent when its definition allows it, and StructuredOutput when it was started with a structured_output_schema. Inside a subagent, MCP server tools ask every time. A subagent started without an agent type, a fork, gets the same tools as the session that started it. See Subagents.
  • Daemon runs. When a client of the o4 daemon starts a run with an output schema, the model also gets a structured_output tool whose input is that schema. A call that doesn’t match the schema returns an error to the model, and a run that ends without a valid call fails with model did not produce valid structured output.
  • Configuration. format needs at least one formatter, and tool_search appears only when MCP tools were held back.

Plugin tools and turning tools off

Installed plugins can add their own tools. Plugin tools ask for approval every time. A plugin tool with the same name as a built-in tool isn’t added, and neither is one named like CodeMode’s exec or wait, ignoring case and punctuation. To leave tools out of the model’s tool set in a project, built-in or MCP, list their names under disabled_tools in the [scout] section of .o4/config.toml; /scout can write this for you. This applies to the interactive interface. See the configuration reference.

Browse the tools in a session

Run /tools, or choose Open tools browser on the Tools tab of /config, to open the Tools browser. It lists every tool the model can call in the current tab, with the first line of its description and where it comes from: built-in, mcp · <server> or plugin · <name>. The All, Built-in, MCP and Plugin tabs split the list by source; type to filter it. A ● marks a tool sent with every request, and a ○ an MCP tool held back for tool_search. Tools that disabled_tools leaves out aren’t listed. Press Enter on a tool to see its description, whether plan mode allows it, and a table of its parameters with their type and whether they’re required. Show full description shows the whole text the model gets when it’s long, and Show raw schema the JSON Schema of its input. Esc goes back one screen; on the list it closes the browser, or returns to /config if you opened it there. The browser is read-only.