Documentation
CLICommands

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

terminal
$

Every subcommand reads the local CodeDB index. Build or refresh it first with ox index.

Subcommands

CommandDescription
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 insightsShow planning-relevant code insights (hotspots, contention, recent activity)
ox code prsList pull requests ranked for triage (stalled, age, activity)
ox code statusShow code index status
ox code activityRecent GitHub activity (PRs, issues, commits) over a time window
ox code index [url]Index a git repository -- alias for ox index code

Search code

terminal
$

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.

terminal
# Find a symbol definition
$
# Search open PR titles, bodies, and review comments
$
# Find source comments tagged TODO
$
FlagDescription
--limitMax results to return
--snippetMax snippet length per result, in characters
--decisionsOnly results from this repo's decision records (ADRs/DDRs)
--full-jsonFull uncompacted JSON output (~4x more context tokens)
terminal
# Search only Decision Records
$

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.

Each of these commands is a shortcut for an ox code search query.

terminal
# Where is ResolveSession defined?
$
# Where does the text "migration" appear in Go code?
$
# Who calls authenticate?
$
# What does authenticate call, three hops deep?
$
# Which commits touched this file since April?
$
CommandEquivalent 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:

FlagCommandDescription
--depthcalleesTransitive call depth (1-10)
--langrefsRestrict to a language (for example go, ts)
--authorlogRestrict to commits by this author
--afterlogInclude commits after this date (for example 2026-04-01)
--beforelogInclude commits before this date

Planning insights

terminal
$

Reports change hotspots, file contention, and recent activity -- the signals worth reading before planning a change.

FlagDescription
--daysTime window in days
--limitMax rows per section
--jsonStructured JSON output for agents

Triage pull requests

terminal
$

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).

FlagDescription
--sortRanking: stalled | age | activity
--statePR state: open | closed | merged | all
--limitMax number of PRs to return
--prettyPretty-print JSON output

Index status

terminal
$

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 code searches
  • ox query - Search recorded team knowledge beyond code
  • ox decision - Enrich Decision Records with team context