---
title: "How to evaluate Sourcegraph on your own codebase"
description: "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."
url: "https://swe.quest/articles/how-to-evaluate-sourcegraph-on-your-own-codebase-d93a19b9258d1431"
canonical: "https://sourcegraph.com/blog/how-to-evaluate-sourcegraph-on-your-own-codebase"
source: "Sourcegraph"
published: "2026-07-31"
difficulty: "medium"
kind: "How-to"
reading_minutes: 12
tags: ["evals","ai-coding","ai-agents","search"]
---

# How to evaluate Sourcegraph on your own codebase

A post on [Sourcegraph](https://swe.quest/sources/sourcegraph.md), published 2026-07-31, 12 min read, How-to. Original: [https://sourcegraph.com/blog/how-to-evaluate-sourcegraph-on-your-own-codebase](https://sourcegraph.com/blog/how-to-evaluate-sourcegraph-on-your-own-codebase)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Search](https://swe.quest/tags/search.md) (Backend & APIs)

## Prerequisites

- coding agents ([easy posts on AI agents](https://swe.quest/tags/ai-agents.md?difficulty=easy))
- LLM tool use / MCP ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- precision and recall metrics ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))

## Keywords

Sourcegraph, MCP, CodeProbe, SWE-Bench Pro

## Related posts

- [Sourcegraph MCP server and a cheaper model beat a Mythos-class model alone](https://swe.quest/articles/sourcegraph-mcp-server-and-a-cheaper-model-beat-a-mythos-class-model-alone-62154a407988cfbb.md): Sourcegraph · 2026-06-16 · Easy · 3 min read · AI agents, Evaluation, AI for coding, LLMs, Cost optimization
  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.
- [Why coding agents fail in large codebases (and what to do about it)](https://swe.quest/articles/why-coding-agents-fail-in-large-codebases-and-what-to-do-about-it-67302cc99ae40bda.md): Sourcegraph · 2026-05-08 · Medium · 8 min read · AI for coding, AI agents, Search, Evaluation, RAG & retrieval
  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.
- [Better tools made Copilot code review worse. Here’s how we actually improved it.](https://swe.quest/articles/better-tools-made-copilot-code-review-worse-here-s-how-we-actually-improved-it-d13b0645c05f1e51.md): GitHub Engineering · 2026-07-10 · Medium · 9 min read · AI agents, Code review, LLMs, Evaluation, Cost optimization
  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.
- [Ghostwriter AI & Complete Code Beta](https://swe.quest/articles/ghostwriter-ai-complete-code-beta-eb4c500f5fc252eb.md): Replit · 2022-09-08 · Medium · 9 min read · AI for coding, Inference & serving, LLMs, Developer tools
  Replit's Ghostwriter adds AI code completion, generation, transformation, explanation and semantic search to its IDE, with Complete Code starting in closed beta.
- [Evaluating OpenWiki with WikiBench](https://swe.quest/articles/evaluating-openwiki-with-wikibench-2ce78315e1ed723f.md): LangChain · 2026-08-26 · Medium · 5 min read · Evaluation, AI agents, Documentation, LLMs
  WikiBench evaluates OpenWiki-generated codebase wikis by having a reader agent answer auto-generated coverage and retrieval questions about a pinned repository.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
