# Code Indexing OX indexes your **code** alongside your **notes** — both land in the same knowledge graph, so a single search returns decisions *and* the implementations that satisfy them. ## Your notes AND your repos, in one graph `ox index` walks the repos in `x/code/` together with the vault notes in `o/o/`. File trees, symbols, git metadata, and dependencies all become nodes and edges in the same graph as your knowledge. The result: a note about an "auth migration" links to the actual auth code. When your AI agent searches, it finds the *decision* in `o/` **and** the *implementation* in `x/`, ranked together. ``` o/when/days/2026.March.16.md ──LINKS_TO──▶ o/what/orgs/.../auth-decisions.md │ cross-reference ▼ x/code/.../crm-api/CLAUDE.md ──DESCRIBES──▶ x/code/.../crm-api/auth/middleware.ts ``` ## Why it matters Most tools index either your knowledge **or** your code. OX co-locates them, so the bridge between *why* and *how* is a queryable edge rather than something you reconstruct from memory. Think of it like a code-graph tool (e.g. GitNexus) — but co-located with your knowledge base instead of standing apart from it. ## Selective indexing ```bash ox index # both knowledge and code (default) ox index --kb-only # notes only ox index --code-only # repos only ``` Indexing is incremental (SHA-256 change detection), so re-runs are fast. See the [CLI Reference](https://iamox.ai/docs/cli.md#ox-index) for all flags. ## Next steps - [Knowledge Graph & RAG](https://iamox.ai/docs/knowledge-graph-rag.md) - [MCP Server](https://iamox.ai/docs/mcp-server.md) — let agents query the combined graph