repomap

io.github.SylphxAI由 GitHub 帳號 SylphxAI 發布v1.9.0更新於 Oct 29, 2026

A map of your codebase for AI agents: code graph, search, call paths and change impact. No API key.

概覽

AI 產生的概覽

給 AI 助理的本地程式碼庫地圖:程式碼圖、混合檢索、呼叫路徑、變更影響與資料庫結構對應,結果皆標註 file:line。

可以做什麼
  • 梳理儲存庫結構:模組、核心檔案、關鍵符號與進入點,或聚焦某個目錄查看檔案與符號大綱
  • 依識別字、關鍵詞或自然語言問題檢索程式碼,回傳排序後的 file:line 範圍
  • 檢視某個符號或檔案的程式碼、呼叫端、被呼叫端、子型別、成員、匯入關係與相關測試
  • 追蹤兩個符號之間的最短路徑呼叫,或某個符號之上/之下的呼叫樹
  • 評估變更影響:針對指定目標或目前 git diff 給出風險等級、各層呼叫端、匯入檔案與需執行的測試
  • 從遷移腳本或 ORM 模型對應資料表、鍵與索引,並連結到查詢這些資料表的程式碼
適用情境
適合助理在大型或不熟悉的程式碼庫中定位程式碼、理解呼叫關係,或在修改前判斷改動可能影響哪些部分。也適用於檢視 diff,以及把資料庫結構對應到查詢它的程式碼。
執行需求
透過 npx 以 stdio 在本機執行,需要 Node 18+,並提供 macOS、Linux、Windows 預先編譯的執行檔。不需 API 金鑰或帳號。首次搜尋會從 Hugging Face 下載約 33 MB 的嵌入模型,除非設定 REPOMAP_EMBED=0。索引對象為工作區根目錄、目前工作目錄或 REPOMAP_ROOT。對應線上資料庫需以參數或環境變數提供連線字串。
安裝前請注意
僅供讀取,不會修改程式碼。線上資料庫連線依文件為唯讀且只讀取目錄中介資料,但仍需連線字串,建議以環境變數提供而非直接寫在參數中。setup 指令會寫入 MCP 用戶端設定檔,並可選擇安裝 Claude Code 鉤子。首次模型下載是唯一的網路請求。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 repomap,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

repomap

A map of your codebase for AI agents: code graph, search, call paths and change impact. No API key.

Code graph · hybrid search · call paths · change impact · an interactive graph UI.
One Rust binary. Local. No API key. MIT.

bash
npx -y @sylphx/repomap setup

[npm] [npm downloads] [CI] [MCP Registry] [License: MIT] [agent-ready 93/100]

Live demo · Docs · Quickstart · Tools · Graph UI · Benchmarks · Compare

[repomap demo: the map of excalidraw, searching restoreElements, its code and callers, then the impact of changing it]

The real UI on excalidraw (687 files, indexed in under half a second): search, a symbol's code and callers, then the blast radius of a change. Try it in your browser, no install needed.

See it work

Run it on any repository. This is the real output on repomap's own source (v1.5.0, trimmed): ask what breaks if pagerank changes.

text
$ npx -y @sylphx/repomap impact pagerank
# Impact (MEDIUM risk)Changing: function pagerank (crates/repomap-core/src/graph.rs:639)2 direct callers, 4 symbols affected in total across 6 files and 3 modules; 5 files importing the changed files; 1 test file to run.
## Direct callers (will break if the contract changes)- method DbSchema.graph_json — crates/repomap-core/src/db.rs:1981- function link — crates/repomap-core/src/graph.rs:122
## Indirect (depth 2)- function assemble — crates/repomap-core/src/index.rs:700

One local call, no API key, and an answer your agent can cite as file:line.

Quickstart

bash
npx -y @sylphx/repomap setup     # add repomap to Claude Code, Codex, Cursor, VS Code, Claude Desktop, Windsurf, Gemini CLInpx -y @sylphx/repomap serve     # open the graph UI for the current repo

Prefer to wire one client by hand? claude mcp add repomap -- npx -y @sylphx/repomap mcp for Claude Code; the Cursor, VS Code, Codex and Docker snippets follow.

That's it. Add --claude-hooks to also enrich Claude Code's Grep and Glob. setup detects the clients you have, writes their MCP config, and prints every change it made. Run it again and nothing changes. Then ask your agent: "Use repomap to map this repo."

Cursor and VS Code, one click

[Add to Cursor] · Install in VS Code

Requires Node 18+. Confirm the install in your editor, open your project, and enable the server. Both links run npx -y @sylphx/repomap mcp locally; no API key is needed.

For VS Code from a terminal:

bash
code --add-mcp '{"name":"repomap","command":"npx","args":["-y","@sylphx/repomap","mcp"]}'

Or add the server to .cursor/mcp.json:

json
{  "mcpServers": {    "repomap": {      "command": "npx",      "args": [        "-y",        "@sylphx/repomap",        "mcp"      ]    }  }}

For .vscode/mcp.json, use the VS Code servers format:

json
{  "servers": {    "repomap": {      "type": "stdio",      "command": "npx",      "args": [        "-y",        "@sylphx/repomap",        "mcp"      ]    }  }}
Manual MCP config
json
{  "mcpServers": {    "repomap": { "command": "npx", "args": ["-y", "@sylphx/repomap", "mcp"] }  }}

Claude Code: claude mcp add repomap -- npx -y @sylphx/repomap mcp Claude Desktop, one click: download repomap-<version>.mcpb from the latest release, open it, and pick your project folder. Claude Code plugin: /plugin marketplace add SylphxAI/repomap, then /plugin install repomap@repomap Codex (~/.codex/config.toml):

toml
[mcp_servers.repomap]command = "npx"args = ["-y", "@sylphx/repomap", "mcp"]

Docker (stdio, amd64/arm64):

json
{ "mcpServers": { "repomap": { "command": "docker", "args": ["run", "-i", "--rm", "-v", "/path/to/repo:/workspace:ro", "ghcr.io/sylphxai/repomap"] } } }

The server indexes the client's workspace root (or its working directory, or REPOMAP_ROOT). Every tool also takes root.

Proof: file localization on SWE-bench Verified

One issue-text search finds every fix file in the top 10 for 83.0% of SWE-bench Verified issues (semble: 71.0%). File retrieval, not issue resolution.

[SWE-bench Verified: repomap finds every fix file in the top 10 for 83.0% of 500 issues; semble 71.0%, BM25 55.8%. Full Acc@1, 5 and 10 values follow in the table.]
Chart values and evaluation protocol
SWE-bench Verified: every gold fix file in the top k files
MethodAcc@1Acc@5Acc@10
repomap48.8%74.8%83.0%
semble34.0%61.6%71.0%
BM2520.8%45.4%55.8%

Defaults selected on 300 disjoint SWE-bench test instances, excluding every Verified ID, then frozen before one evaluation on all 500 Verified instances. One search per issue, at its base commit; gold files are used only for scoring. All three methods scored 500/500, with zero errors.

Split definitions, pinned revisions and full results · Committed chart data

Trade-off: on semble's public code-search set, NDCG@10 is 0.845 versus semble's 0.851; semble wins there. This is not a claim of better search on every task. Measured search quality and limitations.

Why

Agents burn most of their context on grep, ls and reading whole files just to work out where things are. repomap gives them the map up front:

  • Where is it? Hybrid search that matches symbol names, the words inside functions and what the code means, with the lines that matched. Ask "where are failed requests retried" or parseConfig.
  • What is this? One call returns a symbol's code, callers with call-site lines, callees, subtypes and the tests that reach it.
  • How does A reach B? The shortest call path, each hop cited file:line.
  • What breaks if I change this? Direct and indirect callers, importing files, modules touched, tests to run, and a risk level. Point it at your git diff before you commit.
  • What does this repo look like? Modules found from real dependencies (not just folders), the most central files, the most used symbols, and entry points.

All of it comes from a local index: tree-sitter parsing, a resolved import and call graph, PageRank, Louvain communities, BM25 over AST chunks, and a small static code embedding model (33 MB, downloaded once from Hugging Face, then offline). Nothing leaves your machine, and no API is called; the model download is the only network request (set REPOMAP_EMBED=0 to skip it).

What your agent gets

Six tools, each with an obvious job:

ToolAsk itReturns
map"Give me the lay of the land" / focus: "src/server"Modules, central files, key symbols, entry points; an outline with line numbers when focused
search"where are failed requests retried", "parseConfig"Ranked file:line ranges (functions, methods, classes) by keywords, names and meaning, with the matching lines
contextSessionStore.refresh, src/auth/token.ts, token.ts:42Code, callers (with call sites), callees, subtypes, members, imports, importers, tests
tracefrom: handleRequest, to: db.queryShortest call path, or the call tree above/below a symbol
impacttarget: verifyToken or changed: trueRisk level, callers by depth, importing files, modules, tests to run
dbtable: users, or url_env: DATABASE_URL for a live databaseTables, keys, indexes, and the code (file:line) that queries each table

Answers are compact text that cites file:line, so they cost few tokens. Pass format: "json" for structured output.

text
> impact target=decode
# Impact (LOW risk)Changing: function decode (src/auth/token.ts:14)1 direct caller, 3 symbols affected in total across 3 files and 2 modules; 1 file importing the changed files; no tests reach this.
## Direct callers (will break if the contract changes)- function verifyToken — src/auth/token.ts:8
## Indirect (depth 2)- method SessionStore.refresh — src/auth/session.ts:5
## Indirect (depth 3)- function handleRefresh — src/api/router.ts:6
## Importing files- src/auth/session.ts

The same commands work in your terminal: repomap map, repomap search "…", repomap context X, repomap trace A B, repomap impact --changed, repomap db.

The graph UI

bash
npx -y @sylphx/repomap serve            # live, with code previewnpx -y @sylphx/repomap export           # repomap.html: one self-contained file you can publish
[Impact view on tokio: dependents of runtime/task/mod.rs highlighted by depth][Code panel on tokio: harness.rs poll() with its callers and callees]
Impact. Select a file and press i: everything that depends on it lights up by depth, with a list you can click through.Code. Click a symbol to see its source, callers and callees. Open ↗ jumps to your editor or to GitHub.
  • WebGL rendering (Sigma.js) that stays smooth with tens of thousands of files and edges
  • Modules coloured and clustered by their real dependencies, file size by PageRank; tests, examples and docs are muted and one click away
  • / searches files, symbols and code; d shows dependencies; f fits the view
  • Click a module to focus it, Shift-click to hide it; toggle tests, edges and labels
  • export writes one HTML file with deep links (#path/to/file) and GitHub links pinned to your commit. It's a good fit for a README, a wiki or a design review.

Database map

bash
npx -y @sylphx/repomap db                              # from migrations / Prisma / Drizzle / SQLAlchemy / Diesel / Djangonpx -y @sylphx/repomap db --url-env DATABASE_URL       # live Postgres, MySQL or SQLite, read-onlynpx -y @sylphx/repomap db users                        # one table: columns, indexes, who references it, where it is queriednpx -y @sylphx/repomap db --serve                      # the same graph UI, for tables and foreign keys

repomap reads your schema from the repository: SQL migrations (applied in order, with down migrations skipped), schema.prisma, Drizzle pgTable/mysqlTable/sqliteTable, SQLAlchemy and Flask-SQLAlchemy models, Diesel table!, and Django models.py (fields, ForeignKey/ManyToManyField, Meta, implicit join tables). It can also introspect a live database. Each table is linked to the code that queries it: raw SQL (FROM users), Prisma (prisma.user.findMany), Diesel (users::table), Django (Post.objects…), and ORM models or tables used by files that import them.

[repomap db --serve on crates.io: 39 tables, 78 foreign keys, 527 code references]

Live connections are strictly read-only:

  • Postgres runs in a READ ONLY transaction that the server must confirm.
  • MySQL runs in a START TRANSACTION READ ONLY transaction.
  • SQLite is opened read-only with query_only.

Only catalog metadata is read, never table rows. The connection string comes from an argument or an environment variable, and it is never stored or printed. Agents get the same data through the db MCP tool; pass url_env rather than the URL itself.

Agent-readiness score

bash
npx -y @sylphx/repomap score

The score rates how well an AI agent can work in the repository, from 0 to 100. It covers eight checks:

  • agent instructions (AGENTS.md / CLAUDE.md and how useful they are)
  • discoverable build and test commands
  • test coverage
  • CI
  • module boundaries
  • file sizes
  • docs
  • types

Each check that falls short comes with a concrete fix, and the score ends with a badge line for your README. For CI, use --min 70; --update-readme README.md refreshes the badge.

Keep the badge fresh with the GitHub Action:

yaml
# .github/workflows/agent-ready.ymlon: { push: { branches: [main] } }permissions: { contents: write, pull-requests: write }jobs:  score:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - uses: SylphxAI/repomap@v1        with:          update-readme: true   # opens or updates one PR with the fresh badge          min-score: 0          # set e.g. 70 to fail below a bar

Claude Code hook

bash
npx -y @sylphx/repomap setup --claude-hooks

This is opt-in and safe to run again; setup --remove takes it out. It installs a PreToolUse hook: whenever Claude Code runs Grep or Glob, repomap adds where the symbol is defined, who calls it and which module it belongs to. It answers in tens of milliseconds and never blocks the search.

text
repomap (code map) for this search:- function `compose` defined at src/compose.ts:15 (module router); 3 callers: Hono.route (src/hono-base.ts:228), Hono.#dispatch (src/hono-base.ts:452), every (src/middleware/combine/index.ts:102)

Languages

Parsed with tree-sitter for symbols, calls, imports and inheritance: TypeScript, TSX, JavaScript, Python, Go, Rust, Java, Kotlin, Swift, C, C++, C#, Ruby, PHP. Search also covers Markdown, YAML, TOML, JSON, SQL, shell, Protobuf, GraphQL, HTML/CSS, Vue, Svelte, Scala and more.

Modules are found among your core code only. Tests, examples, docs and benchmarks are grouped separately, so they never name or blur a module.

Import resolution understands relative paths, @/ aliases, npm workspace packages, Python packages and relative imports, Go modules, Rust mod/use/workspace crates, Java/PHP namespaces, C/C++ includes and Ruby require. .gitignore is respected, and so is .repomapignore.

Search that understands the question

On semble's public code-search benchmark (63 repositories, 19 languages, 1,251 questions), repomap's search scores NDCG@10 0.845, versus semble 0.851 on the same runner. The previous repomap score was 0.851: stronger issue localization trades about 0.006 here. On our 60 large-repository questions, repomap scores 0.846 versus semble 0.799, but semble still wins on VS Code. The 137M-parameter CodeRankEmbed model's published score is 0.839 and plain BM25's 0.673 (cited, not re-run).

On file localization (500 SWE-bench Verified issues, one search call with the issue text), repomap finds every fix file in the top 10 for 83.0% of issues (Acc@10; 74.8% at 5, 48.8% at 1), versus semble's 71.0% / 61.6% / 34.0%. Before this change, repomap scored 62.2% / 51.8% / 23.6%. Plain BM25 scores 55.8% at 10, and repomap with embeddings off 77.6%. Same-run median index/query costs are 1.682 s / 54.4 ms, versus the old binary's 1.686 s / 59.8 ms and semble's 12.813 s / 354.4 ms. Defaults were selected only on a disjoint 300-instance tuning split, then frozen before one Verified measurement. Agent systems such as LocAgent report higher numbers on a different subset with a language model in the loop; those are cited, not re-run.

This needs no GPU, no vector database and no API key. A 33 MB static code model runs on the CPU, next to BM25 and symbol names.

Fast

The index is built in parallel and cached per file, so after the first run only changed files are parsed again. The MCP server keeps the graph in memory and refreshes it when files change.

Measured on a 4 vCPU GitHub-hosted runner (method and full table):

RepositoryCode filesCold indexWarm indexsearch p50impact p50
kubernetes11,71013.1 s2.0 s74 ms6 ms
vscode6,1269.3 s1.4 s17 ms8 ms
django2,2712.6 s0.5 s24 ms1 ms
rust-analyzer1,5122.1 s0.4 s8 ms2 ms

How it compares

repomapGitNexusSerenaclaude-contextAider repo map
LicenceMITPolyForm NoncommercialMITMITApache-2.0 (inside Aider)
Setupnpx … setup, one binary, or a one-click .mcpbnpx, NodePython + language serversVector DB + embedding API keyPart of Aider
API key / networkNone (model downloaded once)None for the graphNoneRequired (embeddings)None
Code graph (calls, imports, inheritance)✅✅Via LSP references—Ranking only
Change impact / blast radius✅ incl. git diff✅———
Call path between two symbols✅✅———
Search✅ names + BM25 + local embeddings✅✅ symbolsSemantic (vectors)—
Interactive graph UI✅ local + static export✅———
Claude Code Grep/Glob hook✅ opt-in✅———
Database schema map linked to code✅ live (read-only) + migrations/ORMs————
Agent-readiness score + badge✅ + GitHub Action————
Module detection✅ Louvain✅———
Edits code— (read-only)—✅—✅
EngineRustTypeScriptPythonTypeScriptPython

Pick Serena if you want LSP-precise refactoring edits. repomap is for understanding and navigating a codebase with zero setup, including semantic search without a vector database or an API key, and a licence you can use at work. Search quality is measured on public benchmarks in Benchmarks.

Free

Everything repomap does is free under MIT, including the multi-repository workspace (--workspace) and impact in your own CI. There is no licence key and no paid tier.

CLI

text
repomap setup [--client cursor,codex] [--claude-hooks] [--dry-run] [--remove]repomap serve [dir] [--port 7878] [--no-open]repomap export [dir] [--out repomap.html] [--json]repomap map [dir-to-focus] [-C root] [--tokens 1000] [--json]repomap search <query> [--path src/] [--kind function] [--limit 10]repomap context <target> [--code-lines 60]repomap trace <from> [to] [--callers] [--depth 3]repomap impact [targets…] [--changed] [--base main]repomap db [table] [--url-env VAR | --url URL] [--serve | --out db.html] [--json]repomap score [dir] [--json] [--min N] [--update-readme README.md [--insert]]repomap index [dir] [--no-cache] [--json]repomap mcp [--root dir]

Binaries for macOS (arm64, x64), Linux glibc (x64, arm64) and Windows x64 ship as npm optional dependencies. They're also attached to each GitHub release. From source: cargo install --git https://github.com/SylphxAI/repomap sylphx-repomap.

Migrating from Spine, Locus or CodeRAG

@sylphx/spine, @sylphx/locus and @sylphx/coderag are thin aliases of @sylphx/repomap, and their old tool names still work. See the migration guide for the name mapping and how to switch.

Contributing

bash
cargo test --workspace          # engine + CLI testsbun install && bun run build:ui # rebuild the UI bundle (ui/ -> crates/repomap/assets/)cargo run -p sylphx-repomap -- serve .

Issues and PRs are welcome, and new language support is especially useful: add a grammar and a query in crates/repomap-core/src/lang.rs.

Also from Sylphx

  • anymd: Any file (PDF, Word, PowerPoint, Excel, EPUB, HTML, images) to clean Markdown for AI agents.
  • lockdocs: Exact-version library docs from your lockfile. Local, offline, no rate limits.
  • skills: Battle-tested agent skills for Claude Code and Codex, installed in one command.
  • readme-mark: Beautiful README images from one URL: banners, badges, icons and stats cards.

More from Sylphx: https://sylphx.com/open-source

Star history

[Star History Chart]

Privacy

repomap runs on your machine. Indexing, search and every query read your code locally and send nothing anywhere. The one network request repomap makes is a single download of the embedding model from Hugging Face the first time you search; it sends no code. Set REPOMAP_EMBED=0 to skip it and use keyword search only. repomap export files hold paths, symbol names and line numbers, never source. See SECURITY.md for the full boundary.

Support

Questions, a bug, or a team rollout? Email [email protected] or open an issue.


MIT licence. © Sylphx Limited, registered in England and Wales, company no. 16438428. Registered office: 128 City Road, London EC1V 2NX, United Kingdom. Email [email protected]. Privacy · Terms · sylphx.com

來源:README.md,提交 b5c353e

工具

6

map

Map the codebase

Start here. A map of the repository: modules (communities of files that depend on each other), the most central files (PageRank), the most used symbols, and entry points. Pass `focus` (a directory) to zoom in and get an outline of its files and symbols with line numbers.

輸入參數rootfocuslimitformattokens

context

360° view of a symbol or file

Everything about one symbol or file: its code, who calls it (with call-site lines), what it calls, subtypes, members, imports, importers and the tests that touch it. Large fixture trees are skipped until targeted (target one, or pass --include-fixtures). Target forms: `path/to/file.ts`, `file.ts:42`, `Class.method`, `Class::method`, or a bare name.

輸入參數rootformattarget必填code_lines

trace

Trace call paths

With `from` and `to`: the shortest call path between two symbols or files, each hop cited file:line (falls back to the file dependency path). With only `from`: the call tree below it (direction callees) or above it (direction callers).

輸入參數tofrom必填rootdepthformatdirection

impact

Change impact (blast radius)

What breaks if this changes. Give `target` (symbol or file, or a list) or `changed: true` to analyse the current git diff. Returns a risk level, direct and indirect callers with call sites, importing files, modules touched, and the tests to run. Fixture files in deferred trees are not analysed unless targeted; the result says so.

輸入參數baserootdepthformattargetchanged

db

Database map

Map the database: tables, columns, primary and foreign keys, indexes, and the code that queries each table (file:line). By default it reads schema sources in the repo: SQL migrations, Prisma, Drizzle, SQLAlchemy, Diesel and Django models. To inspect a live Postgres, MySQL or SQLite database, pass `url_env` (the NAME of an environment variable holding the connection string). The connection is strictly read-only and the string is never stored or shown. Pass `table` for one table's full detail.

輸入參數urlroottableformaturl_env

版本歷史

9
  1. v1.9.0最新Oct 26, 2026
  2. v1.8.0Oct 4, 2026
  3. v1.7.0Oct 2, 2026
  4. v1.6.0Oct 2, 2026
  5. v1.5.0Oct 1, 2026
  6. v1.4.0Sep 27, 2026
  7. v1.3.2Sep 26, 2026
  8. v1.2.2Sep 25, 2026
  9. v1.1.1Sep 25, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分