Your agent rediscovers your codebase on every task. Hand it the map instead.

SourceIndex hands your agent a per-task roadmap of the code — the exact files and functions, with line ranges verified against the AST. Across 16 task × model pairs it came out cheaper every single time — from 1.1× on the weakest to 5.2× on the best measured.

How It Works

SourceIndex is the bridge between your codebase and your coding agent — it watches one side and answers the other.

Your Codebase
your-repo/
├─ src/api/routes.py
├─ src/auth/login.py
└─ src/core/models.py

Run sourceindex init once. Git hooks re-index on every commit, so the map never goes stale.

The Bridge

SourceIndex

Stays in sync with your repo and answers every agent request with a targeted roadmap.

Your Coding Agent
> implement rate limiting
✓ sourceindex subagent
→ editing routes.py:41–77

Works with Claude Code and OpenCode. SourceIndex registers as a subagent — replacing Claude Code's built-in Explore — so your agent gets the roadmap and starts building immediately.

What your agent actually receives

Not a search box — a compiled roadmap of the exact code the task touches, handed over before the first turn.

The roadmap 5 files · 6 read windows · 11 functions
beetsplug/discogs/__init__.py edit target L1–L52imports L85–L265
  • DiscogsPlugin.__init__L85–L108Configure Discogs API credentials and plugin options
  • DiscogsPlugin.item_candidatesL188–L197Get candidate tracks by searching matching releases
  • DiscogsPlugin.album_for_idL199–L226Fetch Release by Discogs ID; handle 401 reset auth; validate fields
  • DiscogsPlugin.get_search_query_with_filtersL235–L259Normalize query text and add fixed release-type filter
  • DiscogsPlugin.get_search_responseL261–L265Call discogs_client.search and return raw IDResponse data
beets/library/models.py L841–L886
  • Item.__getitem__L841–L852Field value, falling back to album if missing
  • Item.getL875–L886Field value with optional album fallback
test/plugins/test_discogs.py L363–L502
  • DGSearchQueryTestL363–L502Tests for search query and filter construction
beets/util/config.py L1–L26
  • sanitize_choicesL9–L26Filters, dedupes, and expands '*' in choice lists
beets/plugins.py L223–L245
  • BeetsPlugin.__init__L223–L245Plugin name/config, log filter, config verifier

Each window covers exactly the functions beneath it — no padding, no whole-file reads. The extra L1–L52 on the edit target is that file's imports block, so new imports land in the right place.

What it does to the run — coding agent

With SourceIndex
1task → sourceindex subagent
2read .sourceindex/sourceindex-output.txt
3read ×6 — every roadmap entry, at the listed ranges, in one turndiscogs/__init__.py 1–52 · 85–181 · library/models.py 841 · util/config.py 1 · test_discogs.py 363 · plugins.py 223
4todowrite
5edit discogs/__init__.pyfirst edit, 4 turns in
6edit discogs/__init__.py
7edit discogs/__init__.py
8todowrite
9bash pytest test_discogs.py
10bash pip install python3-discogs-client
11grep _make_release_from_positions
12bash pytest test_discogs.py
13bash pytest test_discogs.py
14todowrite
18turns $0.46cost

No file read twice. Tests green.

Without
1task → Explore subagentits own turns, its own tokens
2read ×2 discogs/__init__.py (whole file) · test_discogs.py 363
3grep ×2 "def plurality" · "get_search_query_with_filters"
4read ×2 util/__init__.py 811 · metadata_plugins.py 340
5grep "^from beets|^import beets"
6read test_discogs.py 1
7todowrite
8edit discogs/__init__.pyfirst edit, 7 turns in
9edit discogs/__init__.py
10edit discogs/__init__.py
11edit discogs/__init__.py
12edit discogs/__init__.py
13edit discogs/__init__.py
14edit discogs/__init__.py
15read discogs/__init__.py 57re-read — already had this file
16read discogs/__init__.py 244re-read
17todowrite
18bash pytest test_discogs.py
19bash pip install python3-discogs-client
20bash pytest test_discogs.py
21read test_discogs.py 363re-read
22bash pytest DGSearchQueryTest
23bash pytest test_discogs.py
24bash pytest DGSearchQueryTest
25bash git stash pop
26grep _make_release_from_positions
27read test_discogs.py 40re-read
28read test_discogs.py 92re-read
29read test_discogs.py 360re-read
30edit test_discogs.py
31bash pytest test_discogs.py
32todowrite
74turns $2.39cost

Six re-reads of two files. Tests green.

Real logs from beets, a popular GitHub repo. Task: add extra_tags support to the Discogs plugin — on Opus 4.6 through OpenCode. The roadmap saves turns, and keeps correctness. Check the benchmark for more results.

Try it on your repo
  1. pip install sourceindex
  2. cd /path/to/your/repo
  3. sourceindex init
Once per repository — git hooks keep the index fresh after that. Full setup guide →

See It in Action

Index once, then watch your agent go straight to the right files instead of hunting for them.

Built for Real Codebases

Fast to set up, precise to the line, invisible in your day-to-day workflow.

40+ Languages

Python, TypeScript, Rust, Go, Java, C/C++, Ruby, PHP, Swift, Kotlin, and more.

Fewer Turns, Same Answers

Every graded run passed its tests in both arms, and no SourceIndex run used more turns than its baseline. The savings come out of exploration, not correctness.

Zero Workflow Change

After sourceindex init, day-to-day you do nothing. Your agent finds and uses the index on its own, and git hooks re-index only the files each commit touched.

Nothing to Configure

One SourceIndex key is all you need. Our hosted backend makes the indexing and search calls — no provider accounts, no model picking, no extra bills.

AST-Grounded

Line ranges validated against tree-sitter AST. Precise read windows for the agent.

Claude Code & OpenCode

First-class integration with both, auto-detected per repo. More agents on the way.

Get Early Access

SourceIndex is in private beta — we're onboarding our first small cohort of testers now. Tell us about yourself and we'll get you set up with an access key.