Repository navigation
Shared per-repo code index, injected into every dispatched prompt - #398
Merged
currentbits merged 11 commits intoAug 17, 2026
Merged
Conversation
… Turn any finished thread into an automation (one-click recur
…elligence-index-per-repo--73cf1e
Signatures + on-disk shape only, so the indexer and the prompt-injection side can be built in parallel against one agreed contract. Co-Authored-By: Claude Opus 5 <[email protected]>
…and resubmit any past message
…e-intelligence-index-per--8472d6
…e-intelligence-index-per--e08e8d
Agents reach for grep first, so the map is worthless unless the harness injects it. Add codeIndexNoteFor (gated on repo size and the disable flag, capped at 3500 chars) and wire it at the single dispatch finalization point against the project's main checkout, never the worktree. tryReadCodeIndex swallows a missing or stub index so dispatch never breaks before the indexer lands.
…into coder/shared-code-intelligence-index-per-repo--73cf1e
Fill in electron/codeindex.js: git ls-files scan, line-based top-level symbol extract, git-log rank, incremental JSON persist, and a debounced fire-and-forget refresh. One index per main checkout, never per worktree.
…into coder/shared-code-intelligence-index-per-repo--73cf1e
…e note git log --format=%h --name-only needs the header and its blank line counted out, and the state machine was off by one line: the first file of every commit was read as a hash and never counted. An empty --format makes every non-blank line a path, so there is nothing to count out. Files with no extracted symbols (test fixtures, config) told the agent nothing and were spending the note's char budget. Co-Authored-By: Claude Opus 5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/shared-code-intelligence-index-per-repo--73cf1e
branch
October 3, 2026 16:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #377.
One symbol index per repo, keyed on the project's main checkout and read by every thread — including threads running in worktrees, which do not get their own. Today each thread re-derives the same orientation by grep; this replaces that with a ranked map injected straight into the prompt.
The research behind the issue (Sourcegraph CodeScaleBench, 1,281 runs) is what shapes the design: agents overwhelmingly reach for the simplest tool — 7,993 keyword searches vs 57 deep-search calls across 602 MCP runs. A powerful index nobody invokes is worthless, so the value is entirely in the injection, and there is deliberately no new tool here.
What changed
electron/codeindex.js—git ls-filesscan, line-based top-level symbol extraction (JS/TS, Python, Go, Rust, JS-ish fallback), git-churn rank over the last 300 commits, atomic JSON write, and an incremental refresh that reuses a row whosemtimeMsandsizeboth still match.readIndexis sync, defensive, and never scans;maybeRefreshIndexis debounced per repo, fire-and-forget, and off underCODER_CODEINDEX_DISABLE=1.electron/services.js—codeIndexNoteFor(index), a pure formatter alongside the existing standing notes (planboardNoteFor/selfIdNoteFor/specNoteFor), following the same "return empty string when there is nothing to say" rule. Emits the ranked file→symbols map plus explicit steering: use the map to jump to the file that owns a symbol, grep for literal strings and call sites, read the file before editing.electron/runner.js— wired into the single dispatch finalization point, reading the index forprojectForGate.path(never the thread's worktree, which would defeat the whole issue) and kicking a background refresh. Both calls are guarded so a corrupt index can never break a dispatch.Measured on this repo
398 indexed source files, 1,680 symbols, 134K LOC: full build 170ms, incremental refresh 40ms,
readIndexon the dispatch path 1ms, index file 69KB, injected note 3.4KB. Electron suite: 1076 pass / 1 fail, the failure being the pre-existing web-integration reconnect flake that is baseline on main.Two defects fixed during review
git log --format=%h --name-onlyemits a hash and a blank line before each file list, and the parser's off-by-one read the first file of every commit as a hash — so alphabetically-first paths never scored. An empty--format=makes every non-blank line a path. Regression test added.Deliberate simplifications (documented as
ponytail:comments)node:sqlitewhen find-references / blast radius needs per-symbol queries.Built by two parallel grok workers against a contract commit landed on main first (
051535d), with the review fixes applied on merge.