Migrate from Sourcegraph
Sourcegraph discontinued the individual/indie tier in July 2025. If you were using Sourcegraph for code search and navigation on a self-hosted or cloud account, this guide walks through replicating that workflow with Canopy.
What changes
Section titled “What changes”The biggest practical difference: Canopy runs entirely locally. There’s no server to run, no Docker container to maintain, no cloud account required. The index lives in .canopy/index/ inside your repo and is updated incrementally as files change.
Feature mapping:
| Sourcegraph | Canopy equivalent |
|---|---|
| Code search (literal) | canopy search <query> / canopy_search |
| Code search (regex) | canopy search <pattern> --regex / canopy_search with regex |
| Structural search | canopy pattern <ast-grep pattern> / canopy_pattern_search |
| ”Find references” | canopy_trace_dependents |
| ”Go to definition” | canopy_search_symbols <symbol> |
| Cross-repo search | Index each repo separately; search each with separate MCP server |
| Code navigation in browser | Use with Claude Code, Cursor, or Zed for in-editor navigation |
| Batch changes | Not available — Canopy is a read-only intelligence tool |
| Insights/metrics | canopy stats, canopy_architecture_map for structural metrics |
Step 1: Install Canopy
Section titled “Step 1: Install Canopy”curl -fsSL https://downloads.canopy.ironpinelabs.com/releases/latest/forge-linux-x86_64 \ -o canopychmod +x canopysudo mv canopy /usr/local/bin/canopycanopy --versionSee Install Canopy for all platforms and Gatekeeper handling on macOS.
Step 2: Index your repo
Section titled “Step 2: Index your repo”cd /path/to/your/repocanopy index . --with-search --with-git--with-search enables full-text search (the Sourcegraph equivalent). --with-git adds git history to canopy_prepare results.
For large repos (>10K files), indexing takes 30–120 seconds. Subsequent incremental runs are much faster — typically under 5 seconds.
Step 3: Connect to your editor
Section titled “Step 3: Connect to your editor”If you used Sourcegraph’s browser-based code navigation, the closest equivalent is connecting Canopy to your editor via MCP:
- Set Up Canopy with Claude Code
- Set Up Canopy with Cursor
- Set Up Canopy with Zed
- Set Up Canopy with VS Code + Continue
Once connected, you can ask your AI assistant to search and navigate using Canopy tools directly.
Step 4: Replicate your searches
Section titled “Step 4: Replicate your searches”Literal search:
Sourcegraph: repo:^github\.com/myorg/myrepo$ checkout
Canopy CLI:
canopy search "checkout"Canopy MCP (in editor):
Use canopy_search with query="checkout"Regex search:
Sourcegraph: repo:^github\.com/myorg/myrepo$ /createPayment\(.*\)/
Canopy CLI:
canopy search "createPayment\(.*\)" --regexStructural search:
Sourcegraph structural: console.log(...)
Canopy pattern (ast-grep syntax):
canopy pattern "console.log($$$)" --language javascriptFind all references to a function:
Sourcegraph: “Find references” on a symbol in the UI
Canopy MCP:
Use canopy_trace_dependents on src/lib/payments.tsCanopy CLI:
# Find all files that import payments.tscanopy health --show-dependents src/lib/payments.tsActivate a license (optional)
Section titled “Activate a license (optional)”Canopy Community tier supports 1 repo and basic CLI tools — sufficient for personal projects. For multi-repo support and the full 21 MCP tools, activate a license:
canopy activate <your-license-key>A 14-day free trial is available at canopy.ironpinelabs.com. Card required upfront; no charge until day 15.
What Canopy doesn’t have
Section titled “What Canopy doesn’t have”Be aware of these gaps before migrating:
- Cross-repo search in a single query — Canopy indexes each repo separately. You can’t search across 50 repos with one query the way Sourcegraph Enterprise supported. Workaround: use a monorepo index if your repos are related.
- Web UI — Canopy has no browser interface. Results come through the CLI or your editor’s AI assistant.
- Batch changes — Canopy is a read-only intelligence tool. It doesn’t write code.
- Saved searches / code monitors — No persistent search subscriptions. Run searches on demand or in CI.
Common pitfalls
Section titled “Common pitfalls”Search returns too many results
Sourcegraph defaulted to repo-scoped search. Canopy searches the entire indexed tree. Add --include to scope results:
canopy search "checkout" --include "src/**/*.ts"“Index not found” after indexing
Canopy stores the index relative to the path passed to canopy index. If you indexed /home/you/repos/myapp, start canopy serve with the same path. Running canopy serve . from a different working directory won’t find the index.