- Home
- Resources
- Integrations
- Sourcegraph
Claude Sourcegraph connectorWhat Claude can do in your Sourcegraph account.
The Claude Sourcegraph connector exposes 13 tools. 12 read code, history and repositories, 1 writes by starting a Deep Search conversation, and 0 are undocumented. Below: what Claude can reach, what your admins control, and where it stops.
Verified Trustpilot reviews · AI, automation & growth agency
What changes when Claude can query Sourcegraph
Instead of copying files into the chat, you let Claude search your Sourcegraph instance directly: code, commit history, diffs and symbol references, private repositories included, as far as your own permissions go. Claude picks the right search on its own, reads the files it needs and answers with the actual lines in front of it.
An answer grounded in your code. keyword_search and nls_search find the place, read_file brings back the exact lines, and go_to_definition with find_references follow a symbol in both directions.
The story behind a change. commit_search, diff_search and compare_revisions dig into history, so a question like who introduced this call, and when, gets a sourced answer.
Long questions handed to Deep Search. deepsearch opens a Deep Search conversation inside Sourcegraph, and deepsearch_read reopens one that already exists.
What it will not do: no listed tool edits a file, opens a pull request or pushes a commit. The only write is the Deep Search conversation itself. Claude also sees only repositories you can already open in Sourcegraph. Nothing runs on its own: no search fires when code is merged. For flows that react to events, the Integrations hub covers automation tools, a different job, and the Claude connectors page lists the rest.
Five words before you connect
The vocabulary around this connector, in one minute.
- Connector
- A link you set up once between Claude and an account you already have, so Claude can work in that account while it answers you.
- Tool
- One named action the connector gives Claude. Claude picks the tools it needs on its own, and the directory sheet lists them by name.
- Authorization
- The sign-in screen of the service itself, where you grant the access Claude uses afterwards. Given once per person, and revocable.
- Approval
- The confirmation Claude waits for before it goes ahead with something that changes your account, shown in the conversation.
- MCP
- The shared standard connectors are built on: it is what lets an assistant like Claude talk to an outside service such as Sourcegraph.
Connect the Claude Sourcegraph connector in three steps
- 01
Find Sourcegraph in Claude
Open Claude's settings, go to Customize then Connectors, and look Sourcegraph up in the list. On a Team or Enterprise workspace, an Owner or Primary Owner enables the connector before members can each sign in.
- 02
Start the connection
Click Connect on its row, then sign in to Sourcegraph in the browser window it opens. If the link breaks, Disconnect and connect again. The window belongs to Sourcegraph, not to Claude.
- 03
Read the authorization screen
Check what the screen asks for before accepting. It belongs to Sourcegraph and sets what the access covers. You can later take that access back from the Sourcegraph side too.
The 13 tools, split by what they do
Sourcegraph gives Claude 13 tools: 12 that read your account, 1 that change something in it.
Two groups here: what Claude reads, and the one tool that creates something. Tool names stay exactly as Claude shows them.
- 12 read
- 1 write
Tools index
What Claude reads (12)
12 toolsTwelve tools that search, list and read code and history without changing anything in your repositories.
commit_search
Searches commit history and lets Claude narrow it by commit message, author, changed content, files touched and date range, then returns the matching commits.
compare_revisions
Compares two specific revisions of the code and returns what differs between them, so Claude can explain what moved from one to the other.
deepsearch_read
Reads an existing Deep Search conversation and returns its questions and answers as markdown text, which Sourcegraph presents as a way to reopen or summarize earlier results.
diff_search
Looks for specific patterns inside the diffs of past commits, across repositories, rather than in the current state of the files, and returns the commits where those patterns show up.
find_references
Starting from the place where a symbol is defined, finds every reference to it in the code that Sourcegraph indexes, so Claude can see where it is used.
get_contributor_repos
Finds the repositories in which a given contributor has made commits, according to Sourcegraph's documentation of the tool, and returns that list of repositories to Claude.
go_to_definition
Goes from a place where a symbol is used to the place where it is defined, across repositories, with what Sourcegraph calls compiler-level accuracy.
keyword_search
Runs an exact keyword search over code, with Boolean AND and OR operators and exact matching of the terms you give, then returns the places where they appear.
list_files
Lists the files and directories found at a given path inside a repository.
list_repos
Searches repositories by a substring of their name and lists the ones that match, which gives Claude the exact repository names to use in later searches.
nls_search
Performs a semantic search with flexible linguistic matching and stemming, which brings back broader results than an exact keyword search over the same code.
read_file
Returns the contents of a file with line numbers, and can target a specific range of lines or a specific revision.
What Claude creates (1)
1 toolOne tool that starts a Deep Search conversation in Sourcegraph. It does not touch code. No source spells out its confirmation, so the general rule below applies.
deepsearch
Approval: see the ruleCreates a new Deep Search conversation inside Sourcegraph to work through a complex question about your codebase, the kind of multi-step research that can span one or many repositories.
What Claude checks with you first
By default, Claude stops and asks before each action it takes on an account for someone. The prompt appears in the conversation when it matters.
On Team and Enterprise workspaces, owners decide whether a member may let some actions through without a prompt each time. They can also limit what a connector may do for the whole organization, for instance keeping reading on and writing off. That choice binds everyone. Claude works with your rights and nothing beyond: Sourcegraph says users only read data from repositories they could already access.
Which plans include it
None of the 819 sheets in the official directory shows plan availability, so the answer for this connector is published nowhere.
The published rule is general: remote connectors are open to all users on Claude, Cowork, Claude Desktop and mobile. On Team and Enterprise, an Owner or Primary Owner opens a connector for the organization before members can connect. Sourcegraph applies its own conditions to its server, set by its offers rather than by Claude. For the live state, check the connector's sheet in the official directory.
Where this connector stops
A connector is not an automation. Claude calls these tools while it answers you, so no search starts when code is merged or a build fails.
Everything specific here comes from Sourcegraph's own documentation of its server: no Claude help article covers this connector. A tool list that is mostly reading is a floor, not a promise. The verified badge in the directory is not a security audit either, and Anthropic states on every sheet that it neither picks the tools a publisher exposes nor guarantees how they behave. Sourcegraph's documentation also restricts its server to some of its own offers, which is worth checking with your Sourcegraph admin.
Need help connecting Sourcegraph to Claude?
A person reads every message.