Skip to content
Canopy is in pre-release. These docs describe the product at its public launch — commands, tool names, and integration examples reflect what you'll see once binaries ship. Join the waitlist →

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.

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:

SourcegraphCanopy equivalent
Code search (literal)canopy search <query> / canopy_search
Code search (regex)Use canopy pattern for AST-aware structural matching, or pipe canopy search output to grep -E '<pattern>' for regex post-filtering. The CLI does not currently expose a --regex flag.
Structural searchcanopy pattern <ast-grep pattern> / canopy_pattern_search
”Find references”canopy_trace_dependents (MCP tool — no CLI peer)
“Go to definition”canopy_search_symbols <symbol> (MCP tool — no CLI peer)
Cross-repo searchIndex each repo separately; search each with separate MCP server
Code navigation in browserUse with Claude Code, Cursor, or Zed for in-editor navigation
Batch changesNot available — Canopy is a read-only intelligence tool
Insights/metricscanopy status for index counts; canopy_architecture_map (MCP) for structural metrics
Terminal window
curl -fsSL $CANOPY_DOWNLOAD_URL/releases/latest/canopy-linux-x86_64 \
-o canopy
chmod +x canopy
sudo mv canopy /usr/local/bin/canopy
canopy --version

See Install Canopy for all platforms and Gatekeeper handling on macOS.

Terminal window
cd /path/to/your/repo
canopy 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.

If you used Sourcegraph’s browser-based code navigation, the closest equivalent is connecting Canopy to your editor via MCP:

Once connected, you can ask your AI assistant to search and navigate using Canopy tools directly.

Literal search:

Sourcegraph: repo:^github\.com/myorg/myrepo$ checkout

Canopy CLI:

Terminal window
canopy search "checkout"

Canopy MCP (in editor):

Use canopy_search with query="checkout"

Regex search:

Sourcegraph: repo:^github\.com/myorg/myrepo$ /createPayment\(.*\)/

Canopy doesn’t expose a --regex flag on canopy search. For pattern-based matching, prefer canopy pattern (ast-grep over the AST — handles all the semantically-equivalent forms regex would have to enumerate). For raw regex over indexed text, pipe through grep -E:

Terminal window
canopy search "createPayment" | grep -E "createPayment\(.*\)"

For function-call shape matching that’s more robust than regex:

Terminal window
canopy pattern "createPayment($$$)" --language typescript

Structural search:

Sourcegraph structural: console.log(...)

Canopy pattern (ast-grep syntax):

Terminal window
canopy pattern "console.log($$$)" --language javascript

Find all references to a function:

Sourcegraph: “Find references” on a symbol in the UI

Canopy MCP:

Use canopy_trace_dependents on src/lib/payments.ts

There is no CLI peer for “find references” — canopy_trace_dependents is exposed only through MCP. From the editor, ask your AI assistant to call it; from the shell, the closest read-only check is grepping import statements:

Terminal window
# Approximate: list files that import the module by string match.
# Misses re-export chains and dynamic imports — use canopy_trace_dependents
# from your editor for the structural answer.
canopy search "from '../lib/payments'"

Canopy Community tier supports 1 repo and basic CLI tools — sufficient for personal projects. For multi-repo support and the full 31 MCP tools, activate a license:

Terminal window
canopy activate <your-license-key>

A 14-day free trial is available at canopy.gulfshieldtech.com. Card required upfront; no charge until day 15.

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.

Search returns too many results Sourcegraph defaulted to repo-scoped search. Canopy searches the entire indexed tree. Use --language to filter by language and --limit to cap the result count — there is no --include glob flag on the CLI:

Terminal window
canopy search "checkout" --language typescript --limit 20

For path-prefix scoping, canopy_search (the MCP tool) accepts path_prefix=src/ — call it from your editor when you need that filter.

“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.