Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Sourcegraph 8 min read Research mediumAdept

Why coding agents fail in large codebases (and what to do about it)

Across 1,281 scored agent runs on 40+ large open-source repos (CodeScaleBench), coding agents fail in five repeatable ways: getting lost in exploration, picking the wrong file or symbol, partial completion, tool thrashing, and context overflow. Indexed code search with keyword, semantic and find-references tools helps most in the 400K–2M LOC range (+0.259 reward delta) but slightly hurts below 400K LOC (−0.080). In one refactoring task it cut tool calls from 96 to 5. Augmented agents were 30% cheaper and 38% faster on average, which supports the claim that these are context-infrastructure problems rather than model-capability problems. The recommended fixes are structural navigation, hybrid retrieval for coverage, and task-aware context management.

Related posts

  • How to evaluate Sourcegraph on your own codebase

    Sourcegraph mediumAdept

    In a 288-task evaluation of the Sourcegraph MCP server, structured code retrieval raised file-level F1 from 0.091 to 0.240 and recall from 0.120 to 0.272, yet aggregate task completion was effectively unchanged. Cost moved with how hard the work was to localize: 15–51% savings when the baseline agent searched broadly, about $0.15 more when it found the code in seven searches or fewer. Observed search burden in baseline traces, not codebase size, predicted benefit (r = -0.57 across 113 paired tasks). The post gives nine controls for a fair evaluation: pin revisions for parity, strip tasks that name the answer's location, hold the agent constant, run at least three repeats, segment by localization difficulty, and audit actual tool calls. It closes with a CodeProbe workflow for running the comparison on your own repositories.

  • CoderForge-Preview: SOTA open dataset for training efficient coding agents

    Together AI hardMaster

    CoderForge-Preview is an open dataset of 258K test-verified coding agent trajectories (155K passing) covering 51K tasks across 1,655 repositories from R2E-Gym, SWE-Smith and SWE-Rebench. The trajectories were generated with Qwen3-Coder-480B in OpenHands Docker environments, filtered by rejection sampling and permissive-license audits, and cost about $130K to produce at a ~90% prompt cache hit rate. Fine-tuning Qwen3-32B on the passing trajectories, using Ulysses sequence parallelism, multipacking and token-level loss normalization at 128K context, reaches 59.4% pass@1 on SWE-Bench Verified, and a 4B model reaches 43.0%. Ablations show a repetition penalty helps only early checkpoints, so later checkpoints should be run without one.

  • Agent-driven development in Copilot Applied Science

    GitHub Engineering mediumAdept

    A Copilot Applied Science researcher built eval-agents, a set of Copilot SDK-based agents that automate analysis of coding-agent trajectories from benchmarks like TerminalBench2 and SWEBench-Pro, and developed it primarily through coding agents. Three principles made this work: conversational, verbose prompting in plan mode; continuous refactoring, documentation and dead-code cleanup so the repo is easy for agents to navigate; and a "blame process, not agents" approach backed by strict typing, linters, and human-only contract tests that prevent agents from rewriting regression tests. With this setup five contributors added 11 agents and four skills in under three days, using a loop of /plan, /autopilot, automated Copilot Code Review iterations, and human review, plus weekly agent-run audits for missing tests, duplication and doc gaps.

  • Better tools made Copilot code review worse. Here’s how we actually improved it.

    GitHub Engineering mediumAdept

    Swapping Copilot code review's bespoke exploration tools for the shared Copilot CLI tools (grep, glob, view) initially raised review cost and reduced useful comments, because the tool instructions encouraged broad, repo-browsing behavior instead of diff-anchored investigation. Benchmark traces exposed the browsing loop, and rewriting tool guidance around a reviewer's workflow (form questions from the diff, narrow with grep/glob, batch discovery, view only known ranges, recover from failed searches with simpler queries or glob) cut average review cost about 20% in production without a quality regression. The same focused instructions did not help the interactive CLI, so tool prompting must match the product's job.

  • Sourcegraph MCP server and a cheaper model beat a Mythos-class model alone

    Sourcegraph easyNovice

    On nine discovery-heavy CodeScaleBench tasks, Claude Sonnet 4.6 using the Sourcegraph MCP server with no source on disk scored a mean reward of 0.698, beating Claude Fable 5 with a full local checkout (0.568) and winning six of nine tasks at $1.02 versus $1.83 per quality point. The gap concentrates on cross-repository discovery such as vulnerability tracing and cross-organization dependency following, while tasks both setups already solve tie and Fable won one cross-org task. The sample is small because Fable 5 access was restricted shortly after release, so it is an early signal: cheaper models with good code retrieval can outperform frontier models on navigation-heavy agent work.

The quest for software engineering knowledge.

Look:
Layout: