[{"data":1,"prerenderedAt":484},["ShallowReactive",2],{"blog-\u002Fblog\u002Fwhy-we-abandoned-repository-indexing":3},{"id":4,"title":5,"body":6,"date":474,"description":475,"extension":476,"meta":477,"navigation":478,"path":479,"readingTime":480,"seo":481,"stem":482,"__hash__":483},"blog\u002Fblog\u002Fwhy-we-abandoned-repository-indexing.md","Why We Abandoned Repository Indexing in TheGitAI",{"type":7,"value":8,"toc":462},"minimark",[9,13,16,19,22,25,28,31,34,37,40,43,46,51,54,57,60,63,69,72,75,78,81,84,87,92,110,113,123,126,134,137,140,144,147,150,153,175,178,181,184,187,192,195,200,209,212,216,219,222,225,228,231,234,237,241,244,253,274,277,281,284,287,290,293,296,301,304,307,311,314,317,336,339,342,347,350,353,357,360,363,366,369,372,375,378,381,385,388,391,394,397,405,408,411,414,418],[10,11,12],"p",{},"There is a wonderfully seductive idea at the heart of AI coding tools:",[10,14,15],{},"Before the model touches a repository, build it a perfect map.",[10,17,18],{},"Index the codebase. Find the pieces that appear related to the user's request. Put the most relevant material in front of the model. Then let it work.",[10,20,21],{},"We spent a lot of time thinking about that approach while building TheGitAI. Eventually, we decided repository indexing should not be the foundation of how the product understands code.",[10,23,24],{},"The reason is not that search or retrieval is useless. It is that software engineering is rarely a one-shot retrieval problem.",[10,26,27],{},"It is an investigation.",[10,29,30],{},"A failing test points to a function. The function points to an import. The import leads to configuration. Running the application reveals something that changes the original theory entirely.",[10,32,33],{},"The most useful piece of context five minutes into a task may have been impossible to identify from the user's first sentence.",[10,35,36],{},"That changed how we thought about repository context.",[10,38,39],{},"Instead of trying to predict everything the agent might need before the work begins, we prefer giving it the ability to discover what it needs while it works: search, read, run, observe, and continue from the evidence.",[10,41,42],{},"The model does not need the whole map before it moves.",[10,44,45],{},"It needs a reliable way to find the next useful clue.",[47,48,50],"h2",{"id":49},"similarity-is-not-the-same-as-relevance","Similarity is not the same as relevance",[10,52,53],{},"Modern semantic retrieval is very good at finding code that resembles a query even when the wording is different.",[10,55,56],{},"That is valuable.",[10,58,59],{},"But similarity and relevance are not quite the same thing.",[10,61,62],{},"Suppose someone asks an agent to:",[64,65,66],"blockquote",{},[10,67,68],{},"Fix login.",[10,70,71],{},"A retrieval system could reasonably surface authentication routes, password validation, session handling, browser storage, account tests, middleware, and documentation.",[10,73,74],{},"Every one of those files may be related to login.",[10,76,77],{},"Only one may explain why login is broken.",[10,79,80],{},"The difficult part of debugging is often not finding code about a subject. It is identifying the path the running system actually follows and discovering where reality diverges from expectation.",[82,83],"context-diagram",{},[10,85,86],{},"Imagine a more specific bug:",[64,88,89],{},[10,90,91],{},"OAuth login succeeds, but the user is redirected back to the login page.",[10,93,94,95,99,100,99,103,99,106,109],{},"A preloaded retrieval step, working from surface similarity to \"login\" and \"OAuth,\" might return ",[96,97,98],"code",{},"auth\u002Flogin.ts",", ",[96,101,102],{},"oauth\u002Fcallback.ts",[96,104,105],{},"session.ts",[96,107,108],{},"auth.test.ts",", a middleware file, and an old migration. All of it looks relevant. None of it points at the actual defect.",[10,111,112],{},"A just-in-time investigation works the failure instead of the vocabulary:",[114,115,121],"pre",{"className":116,"code":118,"language":119,"meta":120},[117],"language-text","rg \"callback\"        → find the OAuth callback handler\nread the handler      → it calls createSession() and redirects\nrg \"createSession\"    → inspect the session-creation function\nrun the failing test  → the error references a cookie configuration\nrg \"sameSite\"         → find a production config override blocking the cookie\n","text","",[96,122,118],{"__ignoreMap":120},[10,124,125],{},"The important part isn't any individual search.",[10,127,128,129,133],{},"It is that ",[130,131,132],"strong",{},"each observation changes the next question",".",[10,135,136],{},"The configuration override that ultimately explains the bug would not have looked particularly important judged only against the original sentence about OAuth. After a failing test points toward cookie behavior, it becomes the whole story. No amount of upfront ranking would have surfaced it unless someone had specifically asked for it — the investigation found it because the failing test pointed there.",[10,138,139],{},"That is the distinction that matters to us.",[47,141,143],{"id":142},"capacity-is-not-attention","Capacity is not attention",[10,145,146],{},"The AI industry has spent years increasing context windows.",[10,148,149],{},"It is tempting to treat those windows like storage: if the model can accept more information, why not give it more information?",[10,151,152],{},"Because fitting information into a prompt and using it effectively are different problems.",[10,154,155,156,163,164,169,170,133],{},"The ",[157,158,162],"a",{"href":159,"rel":160},"https:\u002F\u002Farxiv.org\u002Fabs\u002F2307.03172",[161],"nofollow","\"Lost in the Middle\" study"," showed that language models can have difficulty consistently using relevant information in long inputs. More recent work has found that ",[157,165,168],{"href":166,"rel":167},"https:\u002F\u002Faclanthology.org\u002F2025.findings-emnlp.1264\u002F",[161],"longer input can hurt model performance even when retrieval itself is perfect",". Research into retrieval-augmented generation has also examined the ",[157,171,174],{"href":172,"rel":173},"https:\u002F\u002Faclanthology.org\u002F2025.acl-long.892\u002F",[161],"distracting effect of irrelevant passages",[10,176,177],{},"Codebases are particularly good at producing convincing distractions. They contain old implementations, generated files, test doubles, examples, wrappers, migrations, parallel code paths, and similarly named functions that do completely different things.",[10,179,180],{},"More context therefore does not automatically mean more understanding.",[10,182,183],{},"A useful mental model is to think of context as the agent's working desk rather than its warehouse.",[10,185,186],{},"The question isn't:",[64,188,189],{},[10,190,191],{},"How much information can fit on the desk?",[10,193,194],{},"It is:",[64,196,197],{},[10,198,199],{},"What information deserves the agent's attention right now?",[10,201,202,203,208],{},"Anthropic makes a similar point in its discussion of ",[157,204,207],{"href":205,"rel":206},"https:\u002F\u002Fwww.anthropic.com\u002Fengineering\u002Feffective-context-engineering-for-ai-agents",[161],"context engineering for AI agents",", describing context as a finite resource whose signal quality matters.",[10,210,211],{},"That framing makes a lot of sense for coding agents.",[47,213,215],{"id":214},"a-coding-agent-is-not-a-search-box","A coding agent is not a search box",[10,217,218],{},"Retrieval fits naturally into a one-shot interaction: someone asks a question, the system retrieves relevant documents, a model answers.",[10,220,221],{},"But a coding agent has something a one-shot system does not.",[10,223,224],{},"It can change its mind.",[10,226,227],{},"It can search for something, read what it finds, run the project, observe an error, form a better hypothesis, and search again.",[10,229,230],{},"That feedback loop is one of the most powerful things about an agent.",[10,232,233],{},"It also looks remarkably similar to how experienced developers work. Developers rarely begin a bug fix by loading a semantic representation of an entire repository into their heads. We begin with a clue. We search. We follow references. We read the surrounding code. We run something. Then the evidence tells us what to inspect next.",[10,235,236],{},"The intelligence is not necessarily in performing one perfect retrieval at the beginning. It can be in asking a sequence of increasingly useful questions.",[47,238,240],{"id":239},"what-public-coding-agent-workflows-suggest","What public coding-agent workflows suggest",[10,242,243],{},"There are interesting parallels in other modern coding agents, although it is important not to speculate about private implementations.",[10,245,246,247,252],{},"Anthropic has publicly described Claude Code using tools such as glob and grep for just-in-time repository exploration. Its ",[157,248,251],{"href":249,"rel":250},"https:\u002F\u002Fcode.claude.com\u002Fdocs\u002Fen\u002Fhow-claude-code-works",[161],"documentation"," presents coding as an iterative loop of gathering context, taking action, verifying, and adjusting.",[10,254,255,256,261,262,133],{},"OpenAI does not document every internal part of Codex, so it would be inappropriate to call the entire product index-free. What is public is enough to show the broader pattern: ",[157,257,260],{"href":258,"rel":259},"https:\u002F\u002Fopenai.com\u002Findex\u002Fintroducing-codex\u002F",[161],"Codex works directly with repositories, reads and edits files, and runs tests and other development commands",". Its open-source agent instructions also recommend ordinary ",[157,263,266,267,270,271],{"href":264,"rel":265},"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fcodex\u002Fblob\u002Fmain\u002Fcodex-rs\u002Fprotocol\u002Fsrc\u002Fprompts\u002Fbase_instructions\u002Fdefault.md",[161],"repository-search primitives such as ",[96,268,269],{},"rg"," and ",[96,272,273],{},"rg --files",[10,275,276],{},"The interesting point is not that indexing has somehow disappeared. It is that increasingly capable coding models can participate directly in discovering the evidence they need instead of only consuming context selected before reasoning begins.",[47,278,280],{"id":279},"the-hidden-cost-of-speculative-context","The hidden cost of speculative context",[10,282,283],{},"Retrieval has a cost even when everything it returns is genuinely related to the task.",[10,285,286],{},"Every additional piece of context competes with the user's actual request, evidence discovered during the task, errors and test results, the current state of the code, and the agent's evolving understanding of the problem.",[10,288,289],{},"That creates a subtle risk.",[10,291,292],{},"An agent presented with several plausible paths at the beginning may construct a coherent explanation around the wrong one. A confident theory can form before the strongest evidence exists.",[10,294,295],{},"Just-in-time investigation turns uncertainty into an action instead:",[10,297,298],{},[130,299,300],{},"search → read → run → verify.",[10,302,303],{},"This does not magically make the model know more. It makes uncertainty cheaper to resolve. That is an important distinction.",[10,305,306],{},"It also improves traceability. When an agent finds a file through a visible search, you can inspect the path that led there. When it changes its theory after a test failure, you can see the evidence that changed its mind.",[47,308,310],{"id":309},"this-is-not-an-argument-against-indexing","This is not an argument against indexing",[10,312,313],{},"Repository indexing is useful. Semantic retrieval is useful.",[10,315,316],{},"There are environments where they may be exactly the right solution:",[318,319,320,324,327,330,333],"ul",{},[321,322,323],"li",{},"enormous and mostly static code collections;",[321,325,326],{},"search across many repositories;",[321,328,329],{},"low-latency repeated queries over the same corpus;",[321,331,332],{},"knowledge discovery where the correct vocabulary is unknown;",[321,334,335],{},"systems where the model cannot safely inspect the environment itself.",[10,337,338],{},"Hybrid approaches can be useful as well.",[10,340,341],{},"Our conclusion is therefore deliberately narrower:",[10,343,344],{},[130,345,346],{},"A coding agent should not receive speculative repository context merely because more context appears safer than less.",[10,348,349],{},"Every additional source of context has to justify the attention it consumes.",[10,351,352],{},"For an engineering agent, the meaningful outcome is not whether retrieval found semantically similar code. It is whether the agent understood the task, made the correct change, and verified the result.",[47,354,356],{"id":355},"why-we-chose-a-different-direction-for-thegitai","Why we chose a different direction for TheGitAI",[10,358,359],{},"TheGitAI works directly with a developer's repository. It can search and read code, edit files, run commands, work with the actual project, and validate what it changes.",[10,361,362],{},"Those capabilities changed how we thought about repository indexing.",[10,364,365],{},"If an agent can inspect the real environment as the task unfolds, then information gathering itself becomes part of the reasoning process.",[10,367,368],{},"A test failure is context. A command result is context. A file discovered after following a reference is context. And unlike speculative context selected at the beginning, each of those observations has a reason for being there.",[10,370,371],{},"There is a less flattering version of this story, and it is the true one.",[10,373,374],{},"Our own semantic retrieval had been reporting zero results for some time before anyone questioned it. Not degraded — nothing. When we finally chased it down, the useful question turned out not to be \"how do we fix the index\" but \"what did we actually lose while it was returning nothing?\"",[10,376,377],{},"The honest answer was: less than we expected. Sessions had been finding what they needed by searching, reading, and running the project — the path the agent takes anyway. That is what turned a suspicion into a decision.",[10,379,380],{},"So we stopped treating a repository index as something an engineering agent inherently needs. That does not make indexing wrong. It means we think the stronger default for TheGitAI is to let the investigation determine the context.",[47,382,384],{"id":383},"the-map-is-not-the-work","The map is not the work",[10,386,387],{},"AI systems create a peculiar temptation: architectural sophistication can easily look like progress.",[10,389,390],{},"Every additional layer has an elegant diagram. Every layer can have its own benchmark. Every layer can improve its own metric.",[10,392,393],{},"But the user does not ask a coding agent for a better repository map.",[10,395,396],{},"They ask it to fix something. Build something. Understand something. And prove that the result works.",[10,398,399,400,133],{},"That is ultimately why we abandoned repository indexing in ",[157,401,404],{"href":402,"rel":403},"https:\u002F\u002Fthegit.ai\u002F",[161],"TheGitAI",[10,406,407],{},"Give the agent the engineering outcome. Let the evidence tell it where to look next.",[10,409,410],{},"The map is not the work.",[412,413],"hr",{},[47,415,417],{"id":416},"sources-and-further-reading","Sources and further reading",[318,419,420,426,432,438,444,450,456],{},[321,421,422],{},[157,423,425],{"href":205,"rel":424},[161],"Anthropic: Effective context engineering for AI agents",[321,427,428],{},[157,429,431],{"href":249,"rel":430},[161],"Claude Code: How Claude Code works",[321,433,434],{},[157,435,437],{"href":258,"rel":436},[161],"OpenAI: Introducing Codex",[321,439,440],{},[157,441,443],{"href":264,"rel":442},[161],"OpenAI Codex's open-source agent instructions",[321,445,446],{},[157,447,449],{"href":159,"rel":448},[161],"Lost in the Middle: How Language Models Use Long Contexts",[321,451,452],{},[157,453,455],{"href":166,"rel":454},[161],"Context Length Alone Hurts LLM Performance Despite Perfect Retrieval",[321,457,458],{},[157,459,461],{"href":172,"rel":460},[161],"The Distracting Effect: Understanding Irrelevant Passages in RAG",{"title":120,"searchDepth":463,"depth":463,"links":464},2,[465,466,467,468,469,470,471,472,473],{"id":49,"depth":463,"text":50},{"id":142,"depth":463,"text":143},{"id":214,"depth":463,"text":215},{"id":239,"depth":463,"text":240},{"id":279,"depth":463,"text":280},{"id":309,"depth":463,"text":310},{"id":355,"depth":463,"text":356},{"id":383,"depth":463,"text":384},{"id":416,"depth":463,"text":417},"2026-08-23","Why we chose just-in-time repository exploration over trying to predict all useful code context before the work begins.","md",{},true,"\u002Fblog\u002Fwhy-we-abandoned-repository-indexing",9,{"title":5,"description":475},"blog\u002Fwhy-we-abandoned-repository-indexing","spPI8cuFMGq_rjDG9glv0e587sBdKKjXJko3x0c5yr4",1787587978450]