A code search agent for Claude Code, Codex and Cursor
Code Oracle answers one question about where code is, what calls it, how it flows or where to change it, from the workspace's code index. It works from the workspace's code index, decisions and lessons, and the context ContextStream picks for the job.
Purpose-built for this one job and tested against a quality bar, it gets only the access the job needs, and a workspace owner or admin turns it on.
Or run it in the ContextStream web app, signed in with your ContextStream account. Version 0.2.0 · Updated
What does Code Oracle do?
Answers where-is, what-calls, how-does-it-flow and where-to-change questions about indexed code: a cited answer of at most 600 tokens and a read list.
What it declines
It does one job. A task like one of these is declined with a reason:
Changing code, writing patches or tests, or opening pull requests.
Reviewing a diff or a pull request (PR Reviewer does that).
Writing an onboarding guide to a whole repository (Repo Guide does that).
Plan and task status: what is next, what is blocked, who is on what (Plans & Tasks Keeper does that).
Returning file contents beyond short quotes; it returns a read list instead.
Questions that are not about the indexed code.
What can Code Oracle access, and is it safe to turn on?
Code Oracle gets a short-lived token for one workspace that lets it do only this: search the workspace's code index; read the workspace's decisions and lessons; read the lessons, preferences and decisions ContextStream picks for its job; and call models through ContextStream's model proxy, within a cap set for the run. It works in one project, only for that run, and declines any task outside its job. Code Oracle is read-only: it changes nothing in your workspace. A workspace owner or admin turns it on.
Model agent. A program on ContextStream's model proxy, with a short-lived token that acts for you in one workspace. It is stopped after 1 min.
Scope
What it lets a run do
search.read
Search the workspace's code index
memory.read
Read the workspace's decisions and lessons
context.read
Read the lessons, preferences and decisions ContextStream picks for its job
model.invoke
Call models through ContextStream's model proxy, within a cap set for the run
How is Code Oracle tested?
Code Oracle is tested on 212 cases, each with a known right answer: code questions mined from real Claude Code sessions, callers questions generated from the code, and requests outside its job it must decline. A case passes only if the run ends the way the case expects, declining what is not its job, and every check holds: the right file is among its first three, or for a callers question every call site is exact; every citation resolves to the code index; and the answer stays within 600 tokens. Each code question replays a recorded run of the live model on ContextStream's code index: the searches' real results and the model's real reply, graded against the code. Version 0.2.0 passes 202 of the 212.
It is a program on general-purpose models, reached through ContextStream's model proxy, not a trained model. Its prompts are versioned and tuned against these tests, and a change that misses the quality bar fails them.
Tested with the live model
Version 0.2.0, on real code questions against ContextStream's live code index:
right file in the top 3
92%
118 of the 128 locate questions; the right file first for 80%
callers questions exact
75/75
every call site, from exact search of the index
p95 answer time
7.3 s
p50 3.7 s
fewer tokens for the calling agent
74%
668K to 173K on the mined questions; 68% if each miss pays for its own search again
Method. All 203 code questions run with the live model against ContextStream's code index: 128 questions mined from real Claude Code sessions and 75 callers questions generated from the code. Its test suite records each live run and replays it, so its tests reproduce these numbers. Source: Code Oracle's test suite, live run 3, recorded with Code Oracle 0.2.0.
What does a real run of Code Oracle look like?
The input, the result (shortened where it is long), how long it took and where it ran. Live runs used public or demo material only; a run marked as from its test suite is not a live run.
Live run on ContextStream
What calls `index_status_from_data`?
Version
0.2.0
Outcome
succeeded
Ran
2026-10-27 17:18 UTC
Took
3.9 s
ContextStream's Demos workspace (demo material only), in a project that indexes the public repository github.com/contextstream/mcp-server at v1.0.34.
`index_status_from_data` (defined at crates/mcp-server/src/hook_handlers/pre_tool_use.rs:416) has one production caller: `get_index_status` at crates/mcp-server/src/hook_handlers/pre_tool_use.rs:477, which loads index data and falls back to a not-indexed `IndexStatus` when none exists (crates/mcp-server/src/hook_handlers/pre_tool_use.rs:469). The other two call sites are tests, both passing the fixture path `[path]/projects/example-app/src`: crates/mcp-server/src/hook_handlers/pre_tool_use.rs:4119 and crates/mcp-server/src/hook_handlers/pre_tool_use.rs:4138.
{
"project_id": "6aad1065-8086-4114-931e-1b16c1d9b234",
"question": "Where does the MCP server work out which files are exact-search only, and where does index_status show it?"
}
Result
Answer
The MCP server reads index_status in crates/mcp-server/src/hook_handlers/pre_tool_use.rs: `index_status_from_data` (crates/mcp-server/src/hook_handlers/pre_tool_use.rs:416) parses the status payload and `get_index_status` (crates/mcp-server/src/hook_handlers/pre_tool_use.rs:469) fetches it. The exact-search-only breakdown is rendered by `format_exact_search_only` in the mcp-tools project domain (context:251b0446-efae-45f8-860d-b31c61a3d34a), which reads the `exact_search_only` summary's `files` and `by_reason` counts; a test pins that shape (context:4e878000-feda-4f88-9b6e-4a8b4ad3d510). The hits do not show the code that classifies individual files as exact-search-only — that computation is absent from the candidates; crates/mcp-tools/src/domains/search.rs only covers exact-search budget/failure handling (crates/mcp-tools/src/domains/search.rs:2807).
Read next
crates/mcp-server/src/hook_handlers/pre_tool_use.rs:379-409: Parses index_status payload; get_index_status fetches it nearby
crates/mcp-tools/src/domains/search.rs:7307-7337: Exact-search failure/budget handling, not file classification
crates/mcp-server/src/hook_handlers/git_post_checkout.rs:1-26: Ranked 2 by the index search.
Checks: 4 of 4 passed
index_read: 7 of 7 searches answered; 265 hits in 91 files.
citations: Every citation is to an item found in the index or the workspace.
answer_size: About 216 tokens; the limit is 600.
workspace_context: 5 context items from ContextStream for this job, about 234 tokens.
A harder question: the answer says plainly which part it could not find (confidence 0.45).
Task
549b4aa8-274d-4b36-a388-318768d04e03
Which tools does Code Oracle work with?
Claude Code, Codex, Cursor and other MCP clients: ContextStream's MCP gives them an agents tool that finds, runs and follows Code Oracle. It also runs from a terminal or an agent's shell with csa run oracle, and from the ContextStream web app.
Claude Code, Codex, Cursor and other MCP clients: connect ContextStream's MCP once (setup for each editor), then ask your agent to hand the job to Code Oracle.
A terminal or an agent's shell:csa run oracle, installed with ContextStream's command line.
The web app: the workspace's agent library.
How do I turn Code Oracle on?
An owner or admin of your ContextStream workspace turns Code Oracle on in the web app's agent library. Agents are opening workspace by workspace; if yours is not open yet, the library says so.
Sign in to ContextStream: the button below opens the agent library on Code Oracle.
An owner or admin switches Code Oracle on for the workspace.
Pick the project it works in, and run it from the library, from your coding agent or with csa run.
How do I call Code Oracle from Claude Code or Codex?
Ask your coding agent to hand the job to Code Oracle, or call it yourself: csa run oracle in a terminal, or agents(action="run", agent="oracle", input={...}) over MCP.
Connect ContextStream's MCP (it also writes each editor's connection):
The file and lines that define it, and what to read next. Over MCP:
agents(action="run", agent="oracle", input={"question":"Where is the task route allow list defined?","project_id":"00000000-0000-4000-8000-0000000000a1"})
In a terminal (curl -fsSL https://contextstream.io/cs/install.sh | sh installs csa):
csa run oracle question='Where is the task route allow list defined?' project_id=00000000-0000-4000-8000-0000000000a1
Input
Field
Type
What it is
question
string, required
One question about the code: where something is, what calls something, how something flows, or where to make a change.
project_id
string, required
The indexed project (repository) to answer from.
paths
string[]
Path prefixes to prefer, for example ["crates/api/src"].
What does Code Oracle cost?
Code Oracle is free: a run costs no credits. You need a ContextStream account; Starter is free.
Plans & Tasks Keeper answers one question about the status of the workspace's plans and tasks, citing their ids.
Tested on 106 real-world questions with the live model: all 106 passed: right plan, every cited fact checked against the data, and out-of-scope questions declinedv0.2.0
PR Reviewer reviews one pull request's diff for bugs and for breaches of the workspace's decisions, lessons and preferences, citing the line and the constraint for each finding.
Checked on 13 test cases with known answers: all 13 passv0.1.0