[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-82311":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":15,"starSnapshotCount":15,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},82311,"carto","theanshsonkar\u002Fcarto","theanshsonkar","Structural intelligence for AI coding tools. Gives AI architectural context, blast radius analysis, domains, routes, and codebase impact awareness.","https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fcarto-md",null,"JavaScript",61,5,1,0,6,21,28,18,2.33,"MIT License",false,"main",[25,26,27,28,29,30],"agents","agents-md","ai","cli","developer-tools","nodejs","2026-06-12 02:04:25","# carto\n\n[![CI](https:\u002F\u002Fgithub.com\u002Ftheanshsonkar\u002Fcarto\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ftheanshsonkar\u002Fcarto\u002Factions\u002Fworkflows\u002Ftest.yml)\n[![npm version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fcarto-md)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fcarto-md)\n[![MIT License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue)](LICENSE)\n[![npm downloads](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdm\u002Fcarto-md)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fcarto-md)\n\n**The structural intelligence layer for AI coding tools.**\n\nYour AI coding tool sees files. Carto sees architecture — domains, blast radius, import graph, routes. Every AI tool you use stops guessing about your codebase and starts knowing it.\n\n```bash\nnpm install -g carto-md\ncd your-project\ncarto init\n```\n\nThat's it. Carto auto-wires itself into every AI tool you have installed. Restart your AI tool and it now knows your codebase architecturally.\n\n**Works with:** Cursor · Claude Code · Kiro · Claude Desktop · Windsurf · VS Code Copilot · JetBrains · Zed\n\n---\n\n## Use it with your AI tool\n\n`carto init` auto-wires the MCP server into every AI tool it detects. If yours wasn't detected, here's the manual config — **one block, copy-paste, done.**\n\n### Cursor\n\n`carto init` writes this for you. Manual: `~\u002F.cursor\u002Fmcp.json`\n```json\n{ \"mcpServers\": { \"carto\": { \"command\": \"carto\", \"args\": [\"serve\"], \"cwd\": \"\u002Fyour\u002Fproject\" } } }\n```\n\n### Claude Code (CLI)\n\nOne command from your project root:\n```bash\nclaude mcp add carto -- carto serve\n```\nOr create `.mcp.json` at the project root:\n```json\n{ \"mcpServers\": { \"carto\": { \"command\": \"carto\", \"args\": [\"serve\"] } } }\n```\n\n### Kiro\n\n`carto init` writes this for you. Manual: `~\u002F.kiro\u002Fsettings\u002Fmcp.json`\n```json\n{ \"mcpServers\": { \"carto\": { \"command\": \"carto\", \"args\": [\"serve\"], \"cwd\": \"\u002Fyour\u002Fproject\" } } }\n```\n\n### Claude Desktop\n\n`carto init` writes this for you. Manual: `~\u002FLibrary\u002FApplication Support\u002FClaude\u002Fclaude_desktop_config.json`\n```json\n{ \"mcpServers\": { \"carto\": { \"command\": \"carto\", \"args\": [\"serve\"], \"cwd\": \"\u002Fyour\u002Fproject\" } } }\n```\n\n### VS Code Copilot\n\n`.vscode\u002Fmcp.json` in your project root, or Command Palette → `MCP: Add Server`\n```json\n{ \"servers\": { \"carto\": { \"command\": \"carto\", \"args\": [\"serve\"], \"cwd\": \"\u002Fyour\u002Fproject\" } } }\n```\n\n### Windsurf\n\n`~\u002F.windsurf\u002Fmcp.json`\n```json\n{ \"mcpServers\": { \"carto\": { \"command\": \"carto\", \"args\": [\"serve\"], \"cwd\": \"\u002Fyour\u002Fproject\" } } }\n```\n\n### Zed \u002F JetBrains \u002F VS Code (full agent mode)\n\nCarto also runs as a full **ACP agent** — not just a passive MCP server, but an active coding agent with architectural awareness. See [ACP Agent](#acp-agent-zed--jetbrains--vs-code) below.\n\n---\n\n## What changes for your AI\n\nWithout carto, your AI greps text and guesses. With carto, it queries structural facts:\n\n> *\"Add rate limiting to \u002Fapi\u002Fusers\"*\n\n**Without carto:** AI grep-searches your codebase, finds 12 files mentioning \"users\", picks 3 at random, hopes for the best.\n\n**With carto:** AI calls `get_change_plan(\"add rate limiting to \u002Fapi\u002Fusers\")` and gets back:\n- The exact route handler file\n- All 7 files that import it (blast radius)\n- The AUTH domain it lives in\n- Similar middleware patterns already in the codebase\n- Cross-domain dependencies that could break\n\nYour AI's response goes from \"here's a guess\" to \"here's the right change with the architectural context.\"\n\n### In the wild\n\n![Claude Code reviewing the supabase repo through carto's MCP server](docs\u002Fscreenshots\u002Fclaude-code-supabase.png)\n\n*Claude Code analyzing the [supabase](https:\u002F\u002Fgithub.com\u002Fsupabase\u002Fsupabase) repo via carto. Real session, no editing — 5,974 files indexed in ~780ms, 86 routes, 4,839 import edges, 7 domains. The agent's own verdict at the bottom: \"useful, especially for a large codebase like supabase. The blast radius + cross-domain tools are the most valuable.\"*\n\n---\n\n## Languages and frameworks\n\n### Import graph + symbols (any repo)\n\n| Language | Extensions |\n|----------|-----------|\n| JavaScript \u002F TypeScript | `.js` `.jsx` `.ts` `.tsx` `.mjs` `.cjs` |\n| Python | `.py` |\n| Go | `.go` |\n| Rust | `.rs` |\n| Java | `.java` |\n| C \u002F C++ | `.cpp` `.cc` `.cxx` `.h` `.hpp` |\n| C# | `.cs` |\n| Ruby | `.rb` |\n\n### Route extraction (framework-aware)\n\n| Framework | Language |\n|-----------|---------|\n| Express, Next.js (App + Pages), tRPC, React Router | TypeScript \u002F JavaScript |\n| FastAPI, Flask, Django | Python |\n| Gin, Echo, Chi, net\u002Fhttp | Go |\n| Actix-web, Axum, Rocket | Rust |\n| Spring MVC \u002F Boot, JAX-RS | Java |\n| ASP.NET Core | C# |\n| Rails, Sinatra | Ruby |\n\n### Model extraction\n\n| ORM \u002F Schema | Language |\n|-------------|---------|\n| Prisma, Zod, Drizzle, TypeScript interfaces | TypeScript \u002F JavaScript |\n| Pydantic, SQLAlchemy | Python |\n| Go structs | Go |\n| Rust structs | Rust |\n| JPA `@Entity`, Java records | Java |\n| EF Core, C# records | C# |\n| ActiveRecord | Ruby |\n\n### TypeScript path aliases\n\nReads `tsconfig.json` \u002F `jsconfig.json` `paths` config. `@\u002Fcomponents\u002FButton` resolves to the actual file in the import graph — blast radius works correctly for Next.js and Vite projects.\n\n---\n\n## ACP Agent (Zed \u002F JetBrains \u002F VS Code)\n\nBeyond MCP, Carto runs as a full **ACP agent** — an active coding agent with built-in architectural awareness.\n\n```\nUser: \"Add rate limiting to \u002Fapi\u002Fusers\"\n  ↓\nCarto auto-queries its own SQLite:\n  - Blast radius of relevant files\n  - Domain context (AUTH)\n  - Similar patterns in codebase\n  ↓\nBuilds rich prompt with structural context\n  ↓\nSends to LLM (your API key) → streams answer + diffs back to editor\n```\n\n### Setup in Zed\n\n`~\u002F.config\u002Fzed\u002Fsettings.json`:\n```json\n{\n  \"agent_servers\": {\n    \"Carto\": { \"command\": \"carto\", \"args\": [\"agent\"] }\n  }\n}\n```\n\n### Bring Your Own Key\n\nCarto supports any LLM provider — configure in your editor:\n\n| Provider | Models |\n|----------|--------|\n| Anthropic | Claude Sonnet 4, Haiku |\n| OpenAI | GPT-4o, GPT-4o-mini, o1, o3 |\n| Google Gemini | Gemini 2.5 Pro, 2.5 Flash |\n| Ollama | Any local model (free) |\n| OpenRouter | Any model via single API |\n| Groq | Ultra-fast inference |\n| Together AI | Open-source models |\n| Azure OpenAI | Enterprise deployments |\n\n---\n\n## The 16 MCP tools\n\nOnce carto is wired in, your AI tool can call any of these mid-task. You don't need to memorize them — your AI will pick the right ones.\n\n| Tool | What it returns |\n|------|----------------|\n| `get_architecture()` | 500-word project overview: domains, entry points, stack, key patterns. **Use this first.** |\n| `get_change_plan(intent)` | Given \"add rate limiting to \u002Fapi\u002Fusers\" → files to touch, domains affected, blast radius, similar patterns |\n| `get_blast_radius(file)` | All files affected by changing a given file, with hop distance |\n| `get_context(file)` | Everything about a file: domain, blast radius, neighbors, routes, models |\n| `get_file_summary(file)` | What a file does, its role, key deps and dependents |\n| `get_similar_patterns(file)` | Files with same domain, route shape, or shared deps — find conventions before writing new code |\n| `get_routes()` | All API endpoints with file mapping |\n| `get_structure()` | Import graph, entry points, high-impact files, tech stack |\n| `get_domain(name)` | All routes, models, functions for a domain. Lazily regenerated when stale. |\n| `get_neighbors(file, hops)` | Import graph neighbors: nodes and edges |\n| `get_cross_domain()` | Import edges that cross domain boundaries |\n| `search_routes(query)` | Search API routes by path or method |\n| `get_models(domain?)` | All data models, optionally filtered by domain |\n| `get_high_impact_files(n)` | Top N files by blast radius |\n| `get_env_vars(domain?)` | All env vars with domain mapping |\n| `get_domains_list()` | All detected domains with file, route, model counts |\n\n**All MCP queries:** **\u003C5ms** on every benchmarked repo.\n\n---\n\n## Domain detection\n\nCarto uses **Leiden+CPM graph clustering** — files that import each other heavily cluster together. Domain names are inferred from path tokens, with keyword hints for well-known patterns (AUTH, PAYMENTS, DATABASE, etc.).\n\nWorks on any repo — not just SaaS apps. vscode gets AUTH\u002FEVENTS\u002FDATABASE. zed (Rust) gets DATABASE\u002FAUTH\u002FEVENTS. A game engine would get RENDERER\u002FPHYSICS\u002FAUDIO.\n\nCustom domains via `carto.config.json`:\n```json\n{\n  \"domains\": {\n    \"EDITOR\": [\"editor\", \"monaco\", \"text\"],\n    \"WORKBENCH\": [\"workbench\", \"layout\", \"panel\"]\n  }\n}\n```\n\n---\n\n## CLI commands\n\n| Command | What it does |\n|---------|-------------|\n| `carto init` | Detect project, index codebase, generate AGENTS.md, auto-wire MCP into every AI tool found |\n| `carto sync` | Full re-index (skips unchanged files via mtime+size cache) |\n| `carto watch` | Incremental live re-index on every file save (\u003C50ms) |\n| `carto serve` | Start MCP server (called by your AI tool — usually you don't run this directly) |\n| `carto agent` | Start ACP agent mode (for Zed \u002F JetBrains \u002F VS Code) |\n| `carto impact \u003Cfile>` | Blast radius: risk level, affected files, routes at risk |\n| `carto check` | Cross-domain violations, high-risk uncommitted changes, domain health |\n| `carto remove` | Remove AGENTS.md and .carto\u002F from project |\n\n---\n\n## Benchmarks\n\nMeasured on real open-source repos. Apple M-series, 8 CPUs, 8GB RAM.\n\n| Repo | Language | Source Files | Indexed | First Run | Second Run | DB Size | Import Edges |\n|------|----------|-------------|---------|-----------|------------|---------|--------------|\n| [prisma\u002Fprisma](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma) | TypeScript | 3,303 | 3,303 | **1.6s** | **178ms** | 2.2 MB | 3,590 |\n| [supabase\u002Fsupabase](https:\u002F\u002Fgithub.com\u002Fsupabase\u002Fsupabase) | TypeScript | 6,818 | 6,746 | **4.9s** | **725ms** | 4.3 MB | 5,754 |\n| [microsoft\u002Fvscode](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode) | TypeScript | 10,565 | 10,565 | **9.7s** | **1.2s** | 10.6 MB | 19,769 |\n| [zed-industries\u002Fzed](https:\u002F\u002Fgithub.com\u002Fzed-industries\u002Fzed) | Rust | 1,837 | 1,837 | **2.7s** | **83ms** | 4.7 MB | 2,176 |\n\n**Second run** = only changed files re-parsed. mtime+size checked before reading content — if nothing changed, nothing is re-parsed.\n\n### Domains detected\n\n| Repo | Domains |\n|------|---------|\n| prisma | DATABASE · CORE · EVENTS · AUTH |\n| supabase | CORE · AUTH · DATABASE · PAYMENTS · EVENTS · NOTIFICATIONS · TRPC |\n| vscode | CORE · AUTH · EVENTS · DATABASE · NOTIFICATIONS |\n| zed (Rust) | CORE · DATABASE · AUTH · EVENTS · PAYMENTS · NOTIFICATIONS |\n\nvscode at 10,565 files in under 10 seconds. Rust import graph working on zed (2,176 edges from `mod` declarations and `use crate::` paths).\n\n---\n\n## How it works\n\n```\ncarto init \u002F carto sync\n  ↓\nDiscovers all files (no cap — SQLite handles the volume)\nmtime+size check → skip unchanged files\ntree-sitter parse → imports + symbols (0.05–0.2ms\u002Ffile)\nBabel deep parse → routes + models (API handler files only)\nLeiden+CPM graph clustering → auto-detects domains\nComputes reverse deps → blast radius for every file\nWrites AGENTS.md + .carto\u002Fcontext\u002F*.md (lazy, on-demand)\nAuto-wires MCP into every AI tool found\n  ↓\ncarto watch (optional)\n  ↓\nFile saved → debounce 50ms → re-parse 1 file → SQLite write → \u003C50ms\n```\n\n---\n\n## What Carto never does\n\n- **Sends your code anywhere.** Local only. SQLite on disk.\n- **Writes secrets into AGENTS.md.** `.cartoignore` blocks `.env` and credential files by default.\n- **Touches your manual notes.** Writes only between `\u003C!-- CARTO:AUTO:START -->` and `\u003C!-- CARTO:AUTO:END -->`.\n- **Costs money.** MIT license. Free forever.\n\n---\n\n## License\n\nMIT. Free forever.\n\n---\n\n*Your code changes. Carto knows. Every AI you use knows.*\n","Carto 是一个为代码库提供结构化智能的工具，它赋予AI以架构思维的能力。项目的核心功能是通过分析代码库的架构（如领域、影响范围、导入图等），让AI编码工具能够更准确地理解代码结构，从而提高开发效率和代码质量。Carto支持多种流行的AI编码工具，包括Cursor、Claude Code、VS Code Copilot等，并且可以自动配置这些工具来利用其提供的架构信息。适用于需要增强现有AI编码助手对项目整体结构理解和操作能力的场景，特别适合大型复杂项目的维护与开发。",2,"2026-06-11 04:08:21","CREATED_QUERY"]