Codebase Index
One code-search vocabulary over swappable engines — query, trace, and reindex without naming an engine.
1 skill · 8 tools
Find code by describing what it does, or by asking who calls what — through one vocabulary that works on whichever engine the project selected.
What it does
- One surface, two engines — the facade answers on the selected engine and
returns a structured
unsupportedenvelope for a capability that engine lacks - Search and locate — find code by meaning, then read the authoritative definition of the symbol you found
- Trace structure — callers and callees around a symbol, and the blast radius of a change
- Stay indexed — one
reindex-codebaseverb, whatever engine is behind it
An agent never names an engine. codebase_index_provider in
.devbot.global.jsonc decides which one is wired, and making the other an
implementation detail is the whole point of this module.
Verbs
| Verb | Answers |
|---|---|
reindex-codebase |
Rebuild or refresh this checkout’s index |
search-codebase <query> |
Find files, symbols or definitions by meaning |
read-codebase-symbol <symbol> |
The definition body of one symbol |
trace-codebase-calls <symbol> |
Callers and callees around a symbol |
report-codebase-status |
Index health and coverage |
detect-codebase-changes |
A change mapped to its blast radius |
summarize-codebase-architecture |
Languages, packages, entry points, hotspots |
query-codebase-graph <cypher> |
Read-only multi-hop graph queries |
Every verb takes --project <dir>, defaulting to the working directory.
Scoping — workspaces and workflows
- Polyrepo — index and query the owning project of the files in play
(
devbot tool project-for-path <path>), never the polyrepo root. - Worktrees (the default workflow) — one index per checkout path. Two sessions in different worktrees cannot see each other’s graph, and creating a worktree primes it in the background rather than copying the main checkout’s index.
- Trunk — the single checkout is indexed once and refreshed incrementally.
Selecting the engine
| Provider | Engine |
|---|---|
codebase-memory |
Tree-sitter knowledge graph, native binary, no Ollama (default) |
opencodebase-index |
Ollama nomic-embed-text embeddings |
The two are mutually exclusive: whichever is not selected is disabled automatically, so exactly one is wired. See Configuration.
See also
- Codebase Memory — the default engine
- Opencodebase Index — the embeddings engine
- Polyrepo sessions — how modules scope themselves to the owning project
- Graphify — structural knowledge graph of the toolkit itself
Contents
| Type | Name | Purpose |
|---|---|---|
| Skill | codebase-index |
Use when finding code by structure or meaning. Triggers on ‘who calls this function’, ‘how do these parts connect’, ‘what does this diff affect’. |
| Tool | reindex-codebase |
Rebuild or refresh the code index for this checkout, using whichever code engine is selected. Incremental where the engine supports it; run it at session start or after large edits. |
| Tool | search-codebase |
Find code by meaning through the selected code engine — the stable way to locate files, symbols or definitions before editing. Describe the intent in natural language rather than guessing identifiers. |
| Tool | read-codebase-symbol |
Read the authoritative definition of a symbol (function, method, class) — the source body, not a guess at where it lives. |
| Tool | trace-codebase-calls |
Trace the call graph around a symbol: who calls it (callers) and what it calls (callees), to whatever depth the engine supports. |
| Tool | report-codebase-status |
Report the code index health for this checkout: coverage, node counts and whether the index is current. |
| Tool | detect-codebase-changes |
Map a change to its blast radius — the symbols a diff touches and the callers that depend on them. |
| Tool | summarize-codebase-architecture |
Summarize the indexed architecture: languages, packages, entry points, hotspots and clusters. Answer an unsupported envelope when the selected engine cannot build one. |
| Tool | query-codebase-graph |
Run a read-only graph query (Cypher) against the indexed code graph for multi-hop relationships the other verbs do not cover. Answer an unsupported envelope when the selected engine has no graph. |