ox code
Search this repo's code, symbols, git history, PRs, issues, and comments. ox code reads CodeDB -- the local index built by ox index -- with a Sourcegraph-style query DSL whose filters grep cannot match, and surfaces planning signals like hotspots, stalled PRs, and index status.
Usage
Every subcommand reads the local CodeDB index. Build or refresh it first with ox index.
Subcommands
| Command | Description |
|---|---|
ox code search <query> | Search the CodeDB index using a query DSL |
ox code defs <name> | Where is <name> defined? (symbol search) |
ox code refs <name> | Where is <name> referenced in code text? (text search across the index) |
ox code callers <name> | Who calls <name>? (resolved call graph) |
ox code callees <name> | What does <name> call? (resolved call graph, transitive via --depth) |
ox code log <path> | Commits touching <path> (git history via the index) |
ox code insights | Show planning-relevant code insights (hotspots, contention, recent activity) |
ox code prs | List pull requests ranked for triage (stalled, age, activity) |
ox code status | Show code index status |
ox code activity | Recent GitHub activity (PRs, issues, commits) over a time window |
ox code index [url] | Index a git repository -- alias for ox index code |
Search code
Searches symbols, code, diffs, commits, comments, PRs, and issues. Narrow a query with DSL filters such as type:, file:, lang:, author:, after:, calls:, and calledby:; run ox code search --help for the full grammar.
| Flag | Description |
|---|---|
--limit | Max results to return |
--snippet | Max snippet length per result, in characters |
--decisions | Only results from this repo's decision records (ADRs/DDRs) |
--full-json | Full uncompacted JSON output (~4x more context tokens) |
When the index is unavailable (still building, or not yet created), agent-context invocations return a structured JSON status instead of an error. Check the status field before you treat the output as results.
Navigate symbols and history
Each of these commands is a shortcut for an ox code search query.
| Command | Equivalent search |
|---|---|
ox code defs <name> | ox code search "<name>" type:symbol |
ox code refs <name> | ox code search "<name>" type:code |
ox code callers <name> | ox code search "" calledby:<name> |
ox code callees <name> | ox code search "" calls:<name> depth:<N> |
ox code log <path> | ox code search "" file:<path> type:commit |
refs is plain text search. For the resolved call graph, use callers and callees.
All five accept --limit, --snippet, and --full-json. These flags are specific to one command:
| Flag | Command | Description |
|---|---|---|
--depth | callees | Transitive call depth (1-10) |
--lang | refs | Restrict to a language (for example go, ts) |
--author | log | Restrict to commits by this author |
--after | log | Include commits after this date (for example 2026-04-01) |
--before | log | Include commits before this date |
Planning insights
Reports change hotspots, file contention, and recent activity -- the signals worth reading before planning a change.
| Flag | Description |
|---|---|
--days | Time window in days |
--limit | Max rows per section |
--json | Structured JSON output for agents |
Triage pull requests
Ranks indexed PRs by triage signal -- most-stalled open PRs first by default. Ranking is deterministic and computed from indexed GitHub data (no LLM, no external API).
| Flag | Description |
|---|---|
--sort | Ranking: stalled | age | activity |
--state | PR state: open | closed | merged | all |
--limit | Max number of PRs to return |
--pretty | Pretty-print JSON output |
Index status
Shows what CodeDB has indexed and how current it is. Add --json for machine-readable output.
What's next
- ox index - Build the CodeDB index that
ox codesearches - ox query - Search recorded team knowledge beyond code
- ox decision - Enrich Decision Records with team context

