Get carto wired into your AI tool and answering questions about your codebase in under ten minutes.
npm install -g carto-mdCarto ships prebuilt native binaries for macOS arm64/x64, Linux x64 (glibc + musl), and Windows x64. If you're on a platform without prebuilds you'll fall back to compiling from source — see troubleshooting.md if that breaks.
Verify the install:
carto --versioncd ~/your-project
carto initYou'll see something like:
[CARTO] Detecting project...
[CARTO] Detected: nextjs (typescript)
[CARTO] Found 847 JS/TS files (847 total)
[CARTO] Discovered 847 source files
[CARTO] Computing reverse dependencies...
[CARTO] Indexed 847 files in 1.8s
[CARTO] MCP auto-wired into: Cursor, Claude Code, Kiro
[CARTO] AGENTS.md generated.
┌─ Carto · indexed ─────────────────────────────────────────
│ 847 files · 5 domains · 23 routes · 1,204 import edges
│
│ Top domains:
│ CORE (677 files)
│ AUTH (42 files)
│ PAYMENTS (38 files)
│ DATABASE (67 files)
│
│ 💡 Highest-risk file: src/lib/db.ts
│ (34 files depend on it — try `carto why src/lib/db.ts`)
└───────────────────────────────────────────────────────────
What just happened:
- Carto walked the project, parsed every source file with tree-sitter
- Built an import graph, clustered files into domains (Leiden+CPM), extracted routes + models
- Wrote
.carto/containing the SQLite index, the bitmap sidecar, the per-domain context files - Wrote
AGENTS.mdat the project root - Installed 4 git hooks so the index re-syncs on commit/checkout/merge/rebase
- Detected your installed AI tools and wrote MCP config files for each
The MCP wiring lands when the AI tool starts fresh. Kill it and reopen, then verify carto loaded — most tools log MCP server connections.
Open any prompt your AI tool exposes and try one of:
"What's the blast radius of
src/lib/db.ts?"
"Show me the architecture overview."
"What files would I need to change to add rate limiting to /api/users?"
The AI calls Carto's MCP tools (get_blast_radius, get_architecture, get_change_plan) and answers with structural facts instead of grepping.
While you're here:
carto status # one-screen health view
carto why src/lib/db.ts # 3-line summary of a file
carto explain "add rate limiting" # natural-language → plan
carto check # cross-domain violations
carto doctor # diagnose any setup issuesdocs/concepts/blast-radius.md— what "blast radius" means and how it's computeddocs/concepts/domains.md— how the Leiden clusterer infers AUTH/PAYMENTS/etc. without configdocs/concepts/mcp-integration.md— every MCP tool with an example calldocs/guides/adding-feature-safely.md— the workflow this whole thing enablesdocs/guides/ci-integration.md— drop the GitHub Action onto every PR