The code index
When a session starts, o4 builds or updates a code index in the background. The index lives at.o4/index/codebase.db in your project. The first build
covers every supported file, and later sessions only reindex files that
changed.
The index covers these languages:
o4 skips files your
.gitignore excludes and files larger than 1 MB.
The index records symbols (functions, methods, structs, classes, traits),
the calls between them, and each file’s imports. When the index exists, o4
also adds a short summary of the project’s structure to the model’s context
at the start of a session.
Querying the index
The model queries the index with thecodebase_query tool. It runs without
asking for approval. If the first background build isn’t finished yet, the
query waits up to 60 seconds for it, then runs anyway.
changed_together reads your git history instead of the index, so it works
for any file in a git repository.
Architecture diagrams
Theshow_architecture tool draws a diagram of the codebase from the index as
a Mermaid flowchart. It runs without asking for approval. Ask for one when you
want an overview:
Language servers
Thelsp tool gives the model answers from a language server, which
understands types and scopes that the index doesn’t. It supports:
goToDefinition,goToImplementation, andfindReferenceshover, for type and documentation informationdocumentSymbolandworkspaceSymbolprepareCallHierarchy,incomingCalls, andoutgoingCalls
lsp tool asks for
approval once per session in the default approval mode. It’s available in
interactive sessions, not in print mode.
With no servers configured, o4 uses these, if they’re installed and on your
PATH:
o4 doesn’t install language servers. To add or change servers, see
language servers and formatters.
Workspace Radar
Workspace Radar keeps a list of open items in your project that need attention. In o4 0.2.74, o4 adds items in two cases, both as warnings:- You quit a session with unresolved open threads. When you quit, o4 asks
the model to list them as part of the session debrief (see
/debrief). Each becomes an item titledOpen thread: .... - A background task fails. The item is titled
Task failed: ...with the task’s description, and its details hold the error. If the same task fails again, o4 updates the existing item and counts the failures, as inTask failed ×3: ....
.o4/radar.db in your project. When you start a session
and there are open items, the chat shows a one-line digest, for example
Workspace Radar: 2 warnings active (promise:2) · 1 new · /radar. “New” counts
items added since the previous digest.
Run /radar or press Alt+T to open the Radar pane. Alt+T is the
remappable toggle_radar_pane action. Items are grouped by severity, so in
0.2.74 they all appear under Warnings. The selected item’s details show
below the list.
f and d close the pane and only fill in the prompt, so you can edit the
request before you send it. Workspace Radar has no settings.
Project Scout
Project Scout looks at your project and suggests built-in tools and skills to turn off, and MCP servers to turn on or off, so the model’s context holds only what the project needs. Run:/scout --diff opens the same pane. Scout only runs when you ask for it;
it doesn’t open by itself when a session starts.
Scout looks at the top of the project: manifest files such as Cargo.toml,
package.json, or go.mod, folders such as tests, docs, or
.github/workflows, the test framework, and the git history. From these it
builds suggestions from a built-in set of rules, such as turning off
test_run in a project with no test folder.
The Project Scout pane lists each suggestion with a cost marker, its
estimated token cost per request, the tool, server, or skill it affects, and
the reason. The footer shows the total for your current setup and for the
setup with your selections applied, for example
Current: 6076 tok/req → Projected: 6076 tok/req (−0%) before you select
anything. Suggestions start unselected.
Applying replaces the
[scout] section of .o4/config.toml in your project,
and o4 says Scout recommendations saved to .o4/config.toml; restart session to apply tool, MCP, and skill changes. The changes take effect in your next
session, and only in a trusted workspace, because
o4 reads a project’s .o4/config.toml only there. Print mode (-p) ignores
the section.
The section looks like this. You can also write or edit it by hand:
Scout also writes
first_run, profile_hash, and last_run, which have no
effect in 0.2.74. See configuration for the
full reference.
Related pages
- Language servers and formatters: configure
the servers the
lsptool uses. - Subagents: the
Exploreagent searches the codebase in its own context. - Tools: every tool the model can use.