Help us improve
Share bugs, ideas, or general feedback.
From sourcegraph
Use when the user needs to search or navigate code with Sourcegraph MCP tools. Provides disciplined search workflows for finding implementations, understanding systems, debugging issues, fixing bugs, and reviewing code.
npx claudepluginhub sourcegraph-community/sourcegraph-claudecode-plugin --plugin sourcegraphHow this skill is triggered — by the user, by Claude, or both
Slash command
/sourcegraph:searching-sourcegraphThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Search before you build. Existing patterns reduce tokens, ensure consistency, and surface tested solutions.
Explores internal code implementations, patterns, and architecture across organization repositories using Glean code search tools.
Enables semantic search, grep, artifact fetching, call graph tracing, and Q&A across CodeAlive-indexed codebases, repos, docs, and dependencies.
Searches code across GitLab projects using semantic (Duo-enabled) or keyword search. Returns snippets with file paths, line numbers, context, project links, and relevance scores.
Share bugs, ideas, or general feedback.
Search before you build. Existing patterns reduce tokens, ensure consistency, and surface tested solutions.
Start here:
keyword_searchnls_searchdeepsearch → deepsearch_readfind_referencesgo_to_definition → read_fileget_contributor_repos| Goal | Tool |
|---|---|
| Concepts/semantic search | nls_search |
| Exact code patterns | keyword_search |
| Trace usage | find_references |
| See implementation | go_to_definition |
| Initiate a deep search | deepsearch |
| Read deep search results | deepsearch_read |
| Read files | read_file |
| Browse structure | list_files |
| Find repos | list_repos |
| Search commits | commit_search |
| Track changes | diff_search |
| Compare versions | compare_revisions |
| Find repos a user has worked on | get_contributor_repos |
repo:^github.com/ORG/REPO$ # Exact repo (preferred)
repo:github.com/ORG/ # All repos in org
file:.*\.ts$ # TypeScript only
file:src/api/ # Specific directory
file:.*\.test\.ts$ -file:__mocks__ # Tests, exclude mocks
Start narrow. Expand only if results are empty.
Combine filters: repo:^github.com/myorg/backend$ file:src/handlers lang:typescript
When the user provides a file path or error message:
When the user asks "how does X work":
deepsearch to initiate the search, then deepsearch_read to retrieve resultsread_file on key files mentioned in the responseWhen the user asks who worked on something or what repos a contributor has touched:
get_contributor_repos with one or more usernames to discover their active repositoriesWhen the user is implementing a new feature:
When troubleshooting an error, build failure, or runtime exception:
find_referencesdiff_search and commit_search early — regressions are commonWhen fixing a bug:
find_referencesdiff_search and commit_search early — regressions are commonFor detailed step-by-step workflows, see:
workflows/implementing-feature.md — when building new featuresworkflows/understanding-code.md — when exploring unfamiliar systemsworkflows/debugging-issue.md — when troubleshooting errors, build failures, stack traces, support issues, or runtime exceptionsworkflows/fixing-bug.md — when fixing bugs with extensive Sourcegraph searchworkflows/code-review.md — when reviewing a pull request or changesetMinimise tool calls:
keyword_search over nls_search when you have exact terms (faster, more precise)Batch your understanding:
deepsearch + deepsearch_read for "how does X work" instead of multiple keyword searchesAvoid common token waste:
deepsearch for simple "find all" queries — keyword_search is faster| Intent | Query |
|---|---|
| React hooks | file:.*\.tsx$ use[A-Z].*= \( |
| API routes | file:src/api app\.(get|post|put|delete) |
| Error handling | catch.*Error|\.catch\( |
| Type definitions | file:types/ export (interface|type) |
| Test setup | file:.*\.test\. beforeEach|beforeAll |
| Config files | file:(webpack|vite|rollup)\.config |
| CI/CD | file:\.github/workflows deploy |
For more patterns, see query-patterns.md.
Search results:
Code explanations:
Recommendations:
| Mistake | Fix |
|---|---|
| Searching all repos | Add repo:^github.com/org/repo$ |
| Too many results | Add file: pattern or keywords |
| Missing relevant code | Try nls_search for semantic matching |
| Not understanding context | Use deepsearch_read |
| Guessing patterns | Read implementations with read_file |