
Skeletongraph
io.github.yashdoke7由 GitHub 帳號 yashdoke7 發布v0.2.0更新於 Oct 24, 2026
Zero-LLM structural code retrieval for AI coding agents, served over MCP.
概覽
SkeletonGraph 以 tree-sitter 為程式碼倉庫建立索引,並透過 MCP 向編碼助理提供排序後的相關函式。
- 可以做什麼
- 它不呼叫任何 LLM,就把倉庫解析成函式層級結構、跨檔案呼叫圖與 PageRank 中心度,再用 BM25、程式碼嵌入與結構確認三種訊號經倒數排名融合對候選函式排序。它向助理暴露七個 MCP 工具:sg_overview、sg_search、sg_get、sg_expand、sg_constraint、sg_log 與 sg_decision。回傳結果包含檔案與行號、函式主體片段、摘要以及一跳呼叫者,另有命令列提供 route、prepare、dry-run 與呼叫供應商執行。
- 適用情境
- 適合在支援 MCP 的編碼 IDE 中使用,希望助理首次檢索更常命中正確檔案,或助理在搜尋與閱讀程式碼上花費大量回合時。專案自身的研究報告稱首次檢索更好、在探索較多的助理上有 token 節省,但對前沿助理的解題率幾乎沒有提升。
- 執行需求
- 以 Python 套件形式透過 stdio 在本機執行(pip install skeletongraph)。索引、MCP 伺服器與命令列檢索指令都不需要 API 金鑰。首次使用會透過 sentence-transformers 下載兩個嵌入模型,因此第一次需要連網;其中一個以 trust_remote_code=True 載入。選用附加元件提供 litellm 以呼叫供應商,以及檔案監看常駐程式。呼叫供應商需要諸如 ANTHROPIC_API_KEY 的金鑰,或本機 Ollama 服務。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Skeletongraph,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[PyPI] [Python versions] [Preprint] [MIT License] [MCP server] [MCP Registry] [Zero-LLM index]
Works with [Cursor] [Claude Code] [GitHub Copilot] [Codex] [Antigravity] [Windsurf] [Cline] [Any MCP client]
Parses [Python] [JavaScript] [TypeScript] [Go] [Rust] [Java] [C#] [C++] [Ruby] [PHP]
SkeletonGraph indexes your repository with tree-sitter — no LLM — and hands a coding agent a ranked list of the functions relevant to its task, over MCP. It is also the instrument of a study of what better code retrieval actually buys an agent that has to fix the code, across two production agents, two Claude behavioral regimes, and two benchmarks. The short answer is below; it is more useful, and less flattering, than a token ratio.
[SkeletonGraph walkthrough on a real django/django task: tree-sitter parses the repo into function nodes joined by call edges with no LLM; the agent calls sg_search with the issue text; BM25, code embeddings and the call graph each rank the same symbols differently; reciprocal-rank fusion puts the right function first with its file and line.]Index once with tree-sitter (no LLM) → three signals rank the same symbols → reciprocal-rank fusion returns ranked functions with file and line, served to your agent over MCP.
What we found
We ran the same retriever in every setting we could: without an agent, in a controlled agent loop on an open-weight model, and inside Claude Code (exploratory and lean regimes) and Codex CLI, on SWE-bench Verified and the decontaminated SWE-rebench — 3,433 agent runs, every patch verified by running the project's tests, plus 500 agent-free retrieval evaluations, with every agent comparison paired by task. The evaluation covers Python repositories.
1. It finds code better than every agent's own search
Without an agent, on 100 SWE-bench Verified tasks (file level):
Inside the agents, over all tasks, SkeletonGraph's first search returned a file the fix changes on 80–92% of tasks, against 61–90% for the agents' own first search (87–96% against 60–93% on the tasks where the agent actually called it). The largest margin was Codex, where the right file came first on 71% of the tasks where it was called, instead of 32%.
2. But the agents already found the right code — so that gain doesn't reach the fix
With or without SkeletonGraph, the production agents read code from the right file on 96–100% of tasks — on SWE-bench Verified usually with their very first tool call — and edited it on 88–97%. At the level of functions, where they are far from perfect (63–69% edited a function the fix changes), SkeletonGraph did not move them either. Of the 69 tasks whose outcome differed between arms, 61 were tasks where both arms had already edited the right file: they differ in whether the change was correct, not in where it was made. No production-agent setting showed a statistically detectable solve-rate improvement from retrieval. Only an agent that often failed to find the code on its own — the controlled loop, whose search-free arm edited the right file on 65% of tasks — gained (35 → 42 solved, not statistically significant).
3. What it changes is cost — and the agent decides the direction
Where an agent spends a lot searching, reading and re-checking, SkeletonGraph replaces that work and saves; where it already finds the code in one or two calls, the retriever is added on top and costs a little more. The penalty is small and bounded; the saving grows with how much the agent would have spent.
4. Agents change underneath you
Across two Claude Code windows three weeks apart—exploratory through 2.1.274 and lean at 2.1.278, on the same tasks and prompt—the built-in agent went from 10.9 to 4.7 tool turns per task, read a fifth as much, ran code after editing on 2 tasks instead of 40, and its own first search put the right file first on 85 tasks instead of 59. The same retrieval backend, under a leaner integration, went from saving 93k tokens a task to costing 66k. The product release, available tools, account-loaded skills, integration, and possibly the served model changed together. We can describe the two regimes, not attribute the break to the version number alone. That volatility is part of the result: the meaningful unit of evaluation is the complete, versioned agent environment.
What this means if you use it
- Expect better first searches, not more solved tasks. The bottleneck for current frontier agents is turning located code into a correct fix, which retrieval does not address.
- The saving depends on the complete agent environment. It is largest with agents and tasks that explore a lot, and it can turn into a small overhead with lean ones. Measure it on your own setup.
- Integration instructions cost tokens. On Codex, the shipped integration added 53k tokens a task against 8k for the plain one, with no detectable difference in solve rate.
Every result with its confidence interval and caveats is in
docs/RESULTS.md; how to reproduce it is in
eval/README.md. The July 2026 preprint reported the first Claude Code
release window only.
SkeletonGraph has two product surfaces:
- SG IDE: MCP context server for Cursor, Claude Code, Copilot, Codex, Antigravity, Windsurf, and other agentic IDEs.
- SG CLI: terminal pipeline for route, prepare, dry-run, provider execution, and cost-aware model selection.
How it works
SkeletonGraph parses a repository into function-level structure, a cross-file call graph, and PageRank centrality with zero LLM calls — deterministic, cheap, and instant to rebuild after every edit. At query time it resolves the symbols an issue names, walks the call graph outward, and ranks candidates by three signals — BM25, code embeddings, and structural confirmation — fused with reciprocal-rank fusion.
sg-rerank, the product default, skips the dense leg for a lighter index; sg-fusion
adds it and ranks best in our retrieval benchmark (table above).
Install
Quick Start: SG IDE
Use this path when you already work inside Cursor, Claude Code, Copilot, Codex, Antigravity, or another MCP-capable coding environment.
sg init writes the MCP config and the agent instruction file for the selected
IDE. SG IDE does not require an API key. Your IDE subscription/model still does
the reasoning and editing; SkeletonGraph supplies the retrieval.
Supported IDE setup targets include:
Quick Start: SG CLI
Use this path when you want a terminal-first context and model-routing pipeline.
sg route, sg prepare, and sg run --dry-run do not need an API key.
To call a provider:
To test locally without a paid provider key:
Local execution is intended for cheap pipeline testing. Use provider models for quality benchmarks unless the benchmark is specifically for local models.
Model Dependency, Prewarming, and Keeping the Index Fresh
SG downloads two small embedding models on first use, both via
sentence-transformers (a hard dependency, not optional):
jinaai/jina-embeddings-v2-base-code(SG_DENSE_MODEL) — the semantic leg offusion/sg_search. Loaded onsg warmor on an agent's first dense-retrieval query. Loads withtrust_remote_code=True(Jina ships custom modeling code on the HF Hub) — this executes code from that model repo, same as anytrust_remote_codemodel.all-MiniLM-L6-v2(SG_EMBED_MODEL) — a smaller, separate model used only as a confidence-score tiebreaker at index time. Downloads automatically on the firstsg build, not onsg warm.
Both need internet access the very first time each is used on a machine — after
that, both are cached locally (Hugging Face's model cache, plus SG's own
content-hash caches: .skeletongraph/dense_cache for the dense leg,
.skeletongraph/embeddings.npz for the confidence tiebreaker) — so later builds
are incremental: only functions whose text actually changed get re-embedded.
Prewarm before launching an agent, so that cost lands during setup instead of on the agent's first real search:
Without this, the first sg_search call an agent makes pays the cold-encode
cost inline — on a large repo this can exceed the dense retrieval leg's
internal timeout (SG_DENSE_TIMEOUT_S, 20s by default), in which case it
silently degrades to a 2-signal (lexical + structural) result rather than
failing outright. Prewarming avoids relying on that fallback altogether.
Keeping the index current as files change — two options, pick based on how you work:
sg watch is the hands-off option for active development — it debounces
rapid saves and calls the same incremental update path as sg update, so
editing a file is reflected in the index without a manual rebuild.
Model Routing
SkeletonGraph separates IDE-facing model labels from CLI provider model names.
For IDEs, model tiers are recommendations:
For CLI execution, SkeletonGraph can route to provider model names:
Dynamic routing uses task mode, confidence, candidate count, token size, and complexity. Code-changing work keeps an MLM floor by default so cost savings do not come from making weak models edit code unsafely. Retrieval planning can use small models to propose targets over AST/summaries before the heavy model runs.
IDE Integration
After sg init and sg build, register SG as an MCP server and write IDE hooks:
codex and antigravity are accepted as aliases and currently route through the
Copilot-style MCP installer.
For any other MCP-capable client, or to configure it by hand, see
mcp.example.json for the raw server config
(sg serve --path /path/to/your/project). The "plain" integration measured above is
the server started with SG_MCP_PLAIN=1, which removes the guidance text from tool
descriptions and results, registered without the rules and hooks sg install writes.
After install, restart your editor. SkeletonGraph runs as a background MCP server
(sg serve --path .) that the IDE connects to automatically.
MCP Tools
Seven tools are exposed to the agent:
Smart context routing. On each UserPromptSubmit, SG classifies the prompt
(architecture / explain / decision / debug / test / review / general) and
includes the matching MD file from .skeletongraph/ — e.g. architecture.md
only for design/refactor queries, project.md only for "what is this codebase"
queries. Constraints + session digest + relevant functions are always injected.
Cold start. If no .skeletongraph/ index exists when an MCP tool is called,
SG auto-builds on first invocation (see auto_build_on_query in config).
CLI Reference
Indexing & status
Retrieval
Constraints & session
Summarization
Model routing & execution
Background indexing
Provider output from sg run --execute is written to .skeletongraph/runs/.
Python API
Repository layout
Reproducing the results
Everything — task sets, drivers for every agent, verification, and the scripts behind
every number and figure — is in eval/. The per-run records and
transcripts are several gigabytes and are published with the tagged release rather than
in git. eval/results_summary.json holds the computed results, so the figures
regenerate without them:
License
SkeletonGraph is released under the MIT License — free to use, modify, and distribute, for commercial and private projects alike.
Citation
If SkeletonGraph is useful in your research, please cite the preprint:
來源:README.md,提交 c4ae93b
工具
0版本歷史
2- v0.2.0最新Sep 25, 2026
- v0.1.1Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分