Prompt
What should I use for code search across multiple repos?
Latest observation
If you want code search across multiple repos, the best choice depends on whether you want something hosted, self-hosted, or developer-tooling focused.
Good options
1. GitHub Code Search
Best if your repos are on GitHub and you want the simplest option.
- Searches across multiple repos in your org/account
- Very good syntax and fast indexing
- Easy to use for most teams
Use this if: your code lives mostly on GitHub and you don’t need special internal indexing rules.
2. Sourcegraph
Best “serious” code search across many repos and code hosts.
- Excellent for large codebases and monorepo/multi-repo setups
- Cross-repo, cross-language search
- Powerful structural search and navigation
- Can self-host for privacy/compliance
Use this if: you want the most capable enterprise-grade search, especially across lots of repos.
3. OpenGrok
Good self-hosted search/indexing for codebases.
- Mature and lightweight
- Works well for local/company-hosted repositories
- Strong text search and browsing
Use this if: you want something simpler and self-hosted.
4. Livegrep
Fast regex-based code search for large codebases.
- Very fast
- Good for “grep at scale”
- More basic than Sourcegraph
Use this if: you mainly need fast text/regex search.
5. ripgrep + a repo index
If you need a simple local setup:
- Clone repos locally
- Use
ripgrepfor search - Optionally script indexing/aggregation
Use this if: you’re okay with a DIY approach.
My recommendation
- GitHub-hosted repos: start with GitHub Code Search
- Many repos / enterprise / self-hosted needs: Sourcegraph
- Simple self-hosted text search: OpenGrok or Livegrep
If you tell me:
- where your repos are hosted,
- how many repos you need to search,
- whether you need self-hosting, I can recommend the best fit more precisely.