|
10 | 10 | [](https://github.com/NeuralRays/codexray/commits/main) |
11 | 11 | [](https://github.com/NeuralRays/codexray) |
12 | 12 |
|
13 | | -**X-ray vision for your codebase** — pre-built semantic knowledge graph that saves AI coding agents **30%+ tokens** and **25%+ tool calls**. |
| 13 | +**X-ray vision for your codebase** — semantic knowledge graph that saves AI coding agents **30%+ tokens** and **25%+ tool calls**. Zero config, zero API keys, 100% local. |
14 | 14 |
|
15 | | -CodeXRay indexes your codebase into a local SQLite graph database with TF-IDF semantic search. When Claude Code (or any MCP client) needs to understand your code, it queries the graph instantly instead of scanning files one by one. |
| 15 | +> **One `codexray_context` call replaces 5-10 file reads.** Your AI agent queries a pre-built knowledge graph instead of scanning files one by one. |
| 16 | +
|
| 17 | +<details> |
| 18 | +<summary><b>See the token savings in action</b></summary> |
| 19 | + |
| 20 | +### Without CodeXRay (typical Claude Code session) |
| 21 | +``` |
| 22 | +You: "Fix the authentication bug in the login flow" |
| 23 | +
|
| 24 | +Claude Code: |
| 25 | + 1. grep "auth" across codebase → 800 tokens |
| 26 | + 2. Read auth/middleware.ts → 1,200 tokens |
| 27 | + 3. Read auth/service.ts → 1,500 tokens |
| 28 | + 4. Read auth/types.ts → 600 tokens |
| 29 | + 5. grep "login" across codebase → 700 tokens |
| 30 | + 6. Read routes/login.ts → 1,100 tokens |
| 31 | + 7. Read utils/jwt.ts → 900 tokens |
| 32 | + 8. Read tests/auth.test.ts → 1,400 tokens |
| 33 | + 9. grep "validateToken" → 500 tokens |
| 34 | + 10. Read middleware/validate.ts → 1,000 tokens |
| 35 | + ───────────────────────────────────────────────── |
| 36 | + Total: 10 tool calls, ~9,700 tokens just to FIND the code |
| 37 | +``` |
| 38 | + |
| 39 | +### With CodeXRay (same task) |
| 40 | +``` |
| 41 | +You: "Fix the authentication bug in the login flow" |
| 42 | +
|
| 43 | +Claude Code: |
| 44 | + 1. codexray_context("authentication login bug") |
| 45 | + → Returns all relevant symbols, code snippets, |
| 46 | + call relationships, and file locations |
| 47 | + ───────────────────────────────────────────────── |
| 48 | + Total: 1 tool call, ~2,000 tokens — ready to fix |
| 49 | +``` |
| 50 | + |
| 51 | +**Result: 80% fewer tokens, 90% fewer tool calls to find relevant code.** |
| 52 | + |
| 53 | +</details> |
16 | 54 |
|
17 | 55 | ``` |
18 | 56 | ┌─────────────────────────────────────────────┐ |
@@ -86,22 +124,31 @@ codexray init --index # Initialize + index |
86 | 124 | cxr init -i # Short alias |
87 | 125 | ``` |
88 | 126 |
|
| 127 | +## Why CodeXRay? |
| 128 | + |
| 129 | +- **Save money** — 30%+ fewer tokens means lower API costs |
| 130 | +- **Faster responses** — AI agents find code instantly via graph queries instead of scanning files |
| 131 | +- **Better accuracy** — semantic search understands *meaning*, not just keywords |
| 132 | +- **Zero config** — `npx codexray` and done. No API keys, no cloud, no ML models to download |
| 133 | +- **Lightweight** — ~50MB vs ~500MB for embedding-based alternatives |
| 134 | +- **Private** — 100% local. Your code never leaves your machine |
| 135 | + |
89 | 136 | ## How It Works |
90 | 137 |
|
91 | 138 | 1. **Index** — Tree-sitter parses your code into ASTs, extracting every function, class, method, type, and their relationships into a SQLite graph with TF-IDF semantic index |
92 | 139 | 2. **Query** — Claude Code queries the graph via 16 MCP tools instead of scanning files |
93 | 140 | 3. **Sync** — Git hooks keep the index up-to-date on every commit |
94 | 141 |
|
95 | | -### Before CodeXRay |
| 142 | +### Without CodeXRay |
96 | 143 | ``` |
97 | | -Claude: "I need to fix auth" → grep "auth" → read 15 files → grep "login" → read 8 more |
98 | | -Result: 60 tool calls, 157k tokens |
| 144 | +AI agent: "Fix auth bug" → grep → read file → grep → read file → read file → ... |
| 145 | + 15+ tool calls just to FIND the relevant code |
99 | 146 | ``` |
100 | 147 |
|
101 | | -### After CodeXRay |
| 148 | +### With CodeXRay |
102 | 149 | ``` |
103 | | -Claude: "I need to fix auth" → codexray_context("authentication") → done |
104 | | -Result: 45 tool calls, 111k tokens (30%+ savings) |
| 150 | +AI agent: "Fix auth bug" → codexray_context("auth bug") → all relevant code + relationships |
| 151 | + 1 tool call — immediately start fixing |
105 | 152 | ``` |
106 | 153 |
|
107 | 154 | ## 16 MCP Tools |
|
0 commit comments