
Forensic Deepdive
io.github.Dhevenddra由 GitHub 帳號 Dhevenddra 發布v0.10.0更新於 Oct 27, 2026
Persistent code knowledge graph + 9 composite MCP tools for AI coding agents.
概覽
為程式碼庫建立持久化知識圖譜,並透過 9 個 MCP 工具讓助理查詢結構、影響範圍、歷史與跨層呼叫鏈。
- 可以做什麼
- 以原始 Cypher 或自然語言檢索圖譜,並附上來源與信心標記
- 分析影響範圍、呼叫流程,以及從前端呼叫到端點再到處理器的跨層追蹤
- 一次呼叫查看符號的定義、呼叫者、被呼叫者、成員、近期提交與主要作者
- 讀取 Git 考古資訊:變更頻率、主要作者、巴士因子、共同變更叢集與缺陷鄰近度
- 記錄並召回關於符號的已驗證洞察,並產生有界的 Mermaid 鄰域圖
- 適用情境
- 適合助理需要反覆在大型或不熟悉的程式碼庫中工作、希望取得持久的結構化脈絡而不必每次重新摸索架構的情境。特別適用於多語言儲存庫中的影響分析、上手文件撰寫或跨邊界追蹤。
- 執行需求
- 以 stdio 本機程序執行,來自 PyPI 套件 forensic-deepdive(可用 uv tool install 或 uvx),因此需要 Python 工具鏈。須先用 extract 指令對目標儲存庫建立圖譜,再讓伺服器指向該儲存庫啟動。擷取過程不需要 API 金鑰或網路存取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Forensic Deepdive,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
forensic-deepdive
forensic-deepdive gives an AI coding agent forensic understanding of an unfamiliar codebase — a persistent knowledge graph, an MCP server, and five durable markdown artifacts, so your agent stops re-discovering the same architecture from scratch every session.
Why this is different: every edge and every emitted claim carries a confidence tag —
EXTRACTED (deterministic fact) / INFERRED (a heuristic resolved cleanly) / AMBIGUOUS
(multiple candidates, shown, not guessed) — so your agent knows what to trust before it
acts on it. Nothing else in this category tags confidence at all.
Why not GitNexus / CodeGraphContext / DeepWiki / Sourcegraph
GitNexus is the runaway leader in this category — but its PolyForm Noncommercial
license locks every commercial user out. forensic-deepdive is the Apache-2.0
alternative: same persistent-graph-plus-MCP shape, plus honest confidence tags, git
archaeology, persistent agent memory, and the 5 markdown artifacts as a fallback for any
agent that doesn't speak MCP — with a license your employer's legal team will actually
sign off on.
What it produces
forensic-deepdive analyzes any codebase (9 languages, polyglot) and produces:
- A persistent embedded graph at
<repo>/.deepdive/graph.lbug— File, Symbol, Module, Commit, Author, Endpoint, and DbTable nodes plus DEFINES, MEMBER_OF, IMPORTS, CALLS, EXTENDS, IMPLEMENTS, TOUCHED_BY_COMMIT, AUTHORED_BY, CO_CHANGES_WITH, and the cross-boundary HANDLES / CALLS_ENDPOINT / ROUTES_TO / INJECTS / PERSISTS_TO edges. Every edge carries a confidence tag (EXTRACTED/INFERRED/AMBIGUOUS) — no hidden heuristics. The singleEndpointjoin node unifies five cross-boundary protocols (HTTP, MCP tools, registry-dispatch, gRPC, messaging/AMQP), so a frontend call resolves to its backend handler across the stack as oneROUTES_TOedge. - An MCP server (
forensic serve) exposing 9 composite tools (impact,context,archaeology,flow,query,record_insight,recall_insights,visualize,trace) consumable by Claude Code, Cursor, Codex, Continue, Cline, Windsurf — and any other MCP-aware agent. - Five durable markdown artifacts under
<repo>/docs/codebase/, regenerated from the graph on every extract:MAP.md— what's where, ranked by centrality.HOTPATHS.md— the dependency hot spots, with a per-row confidence-mix column so you see exactly how cleanly each symbol resolves.ARCHAEOLOGY.md— why the code looks the way it does (git history, top authors with %, bus factor, co-change clusters, defect proximity).MENTAL_MODEL.md— the doc the original author would write to onboard a new hire.AGENT_BRIEF.md— ≤5 KB of assertive Never/Always rules with per-rule confidence tags. Drop-inCLAUDE.mdfor any project.
- Ten shims into the target repo — 4 editor rule files (
CLAUDE.md,AGENTS.md,.cursor/rules/codebase.mdc,.continue/rules/codebase.md), 5 single-intent Claude skills under.claude/skills/codebase-{exploring,debugging,impact-analysis,refactoring,onboarding}/, and a.claude-plugin/plugin.jsonmanifest. All write-if-absent — hand-edited files are never overwritten. - An agent-insight layer —
record_insight/recall_insightsMCP tools backed by<repo>/.deepdive/insights.jsonlby default (zero dependencies, human-readable, git-friendly). The optional[graphiti]extra upgrades to a temporal knowledge graph backend above a 2-of-5 repo-size threshold.
Extract also regenerates ARCHITECTURE.md — a system-level Mermaid view of the cross-boundary graph (ROUTES_TO / INJECTS / PERSISTS_TO, confidence-styled), a separate human-validation surface (not one of the five contract artifacts, exactly like forensic visualize and serve --ui). Regenerate it on its own with forensic diagram --repo <repo>. Use it to sanity-check the graph — a wrong edge there is a wrong edge everywhere.
Add --emit-vault to also write an Obsidian-friendly vault under <output>/vault/ — every artifact gets summary:/tags: frontmatter, cross-references become [[wikilinks]], and an INDEX.md MOC ties them together (with a .obsidian/ config). A local-first second brain for humans (graph view, backlinks) and agents (triage by summary: without opening files, a traversable index). Opt-in; off by default.
Status
v0.10.0 "The Upgrade Path" — an integrity release. v0.9 shipped correct, and then its findings run caught --refresh-shims being structurally unable to refresh half its targets, with 909 tests green over it. The cause wasn't the fix — it was that every test in the suite wrote into an empty directory, so only the first run had ever been tested. Everyone who isn't a new user lives on the untested path.
So 0.10 adds almost no surface. It makes the guarantees already made real: running Deepdive over a repo that already carries a previous release's output now provably converges (and provably leaves your hand-edited files alone), extract tells you when generated shims are stale instead of waiting for you to know the flag exists, and a stale examples/ fails CI rather than being caught by eye mid-release. New: forensic extract --timings, per-phase wall clock.
It also contains a cancelled feature, which is the more useful story. The planned performance work targeted PageRank. The profile required before touching it measured PageRank at 0.04 % of a large extract, and the already-batched store writes at 79–87 %. The optimization was disproven before it was written — see docs/findings/v0.10/PROFILE.md. Confirming a known technique had been applied had been mistaken for confirming it was fast.
The engine, the graph, the contract layer and the 5-artifact + 9-MCP-tool contract are unchanged from 0.9, and emitted content is byte-identical but for the version footer.
⚠ If you installed 0.8.0 or 0.9.0 and
forensic servestopped working — this is why. Those releases declaremcp>=1.27.1with no upper bound.mcp2.0.0 removedmcp.server.fastmcp, which the MCP server imports, so a fresh install of 0.8.0 or 0.9.0 today resolves tomcp2.0.0 and fails on import. Our development lockfile pinned 1.27.1, so every local check stayed green and only the clean-environment wheel smoke in CI could see it. Fix: upgrade to 0.10.0 (which capsmcp<2), or pinmcp<2yourself. Nothing else about those releases is affected.
What's proven, and what isn't — the honest-framing section moved to
docs/findings/HONEST.md (unchanged content, DEC-119). Short
version: proven usable with real agent auto-discovery; not proven to make
autonomous issue resolution measurably faster end-to-end (hardware-gated). This is an
assisted-analysis tool, and it is not overclaimed as more.
Quick start
Install from PyPI
Published as forensic-deepdive —
no clone needed:
Optional extras: uv tool install "forensic-deepdive[semantic]" (offline ONNX NL
query), [interactive] (the forensic repl query console, the forensic browse
TUI graph browser, and the deepdive session shell), [openapi] (YAML spec
parsing), [graphiti] (temporal insight backend).
Upgrading from 0.8
Re-run extract with --refresh-shims once. The generated shims and skills under
.claude/, .cursor/ and .continue/ are written only if absent, so a plain
re-extract leaves your 0.8-era copies in place, and two of the skill files still cite
internal decision IDs that 0.9 removed:
Only files Deepdive generated are rewritten. A shim you have hand-edited is never
touched.
pip install forensic-deepdive works too if you're not on uv.
Use it as an MCP server
forensic serve is a stdio MCP server exposing the 9 composite tools to any
MCP-aware agent (Claude Code, Cursor, VS Code/Copilot, Codex, Continue, Cline,
Windsurf). First build the graph once (forensic extract <repo>), then wire the
server. Three ways, easiest first:
1. Claude Code plugin (self-hosted marketplace — no PyPI step):
2. From the MCP Registry — indexed as
io.github.Dhevenddra/forensic-deepdive, so registry-aware clients and discovery hubs
(PulseMCP, MCPJungle, the VS Code @mcp index) can find and install it directly.
3. Manual config — generate a client snippet with forensic mcp-config, or paste:
Per-client copy-paste blocks (Cursor, VS Code, Codex, the uvx-not-found GUI gotcha)
are in docs/install.md.
The 9 supported languages
Python, C, Dart, Swift, TypeScript, JavaScript, Java, Go, Rust.
The 9 MCP tools
Tool descriptions are individually ≤200 tokens so the 9-tool envelope stays comfortably inside Anthropic's per-turn skill metadata budget.
The confidence taxonomy
Every edge and every emitted claim carries EXTRACTED / INFERRED / AMBIGUOUS:
EXTRACTED— deterministic from AST orgit log. Facts.INFERRED— a heuristic resolved cleanly (import-graph walk, receiver-type inference, single same-name candidate cross-file). High-trust but derived.AMBIGUOUS— multiple candidates surfaced; the resolver couldn't disambiguate. You see every candidate, not a silent guess.
HOTPATHS shows a per-row confidence-mix column so at a glance you can tell Logger (4 EXTRACTED + 1458 INFERRED — mostly clean) from ChatToolResponse (449 AMBIGUOUS — same-name cross-file collision).
Honest-mode (pure-static, zero LLM, zero network)
forensic extract works end-to-end with no ANTHROPIC_API_KEY, no OPENAI_API_KEY, no Ollama, no network. Graphiti is opt-in via the [graphiti] PyPI extra plus a 2-of-5 repo-size threshold (≥50 k LOC, ≥25 contributors, ≥18 mo old, ≥200 PRs/12 mo, ≥100 issues with discussion). The JsonlInsightStore is the always-available floor.
(The GitNexus/CodeGraphContext/DeepWiki/Sourcegraph comparison table is up top — it's the headline, not a footnote.)
Local development
Read CLAUDE.md, DECISIONS.md (81 active DECs), and PROGRESS.md before making changes. This repo dogfoods its own pattern: every session starts with the protocol in CLAUDE.md, every architectural choice is captured as a DEC-N entry, and the artifact-name contract (MAP, HOTPATHS, ARCHAEOLOGY, MENTAL_MODEL, AGENT_BRIEF) is part of the public API.
Acknowledgments
- Aider (Paul Gauthier) for the PageRank-on-Tree-sitter repo-map pattern. Algorithm ported with attribution; we do not depend on
aideras a package. - Graphify (safishamsi) for the EXTRACTED / INFERRED / AMBIGUOUS confidence taxonomy. Productized in DEC-015 across every emitter.
- GitNexus (abhigyanpatwari) for the multi-repo registry pattern (
~/.deepdive/registry.json, DEC-018), the composite-MCP-tool shape, and being the licensing wedge that makes this project's Apache-2.0 differentiation matter. - Kuzu (now Apple-archived) for the embedded graph engine; LadybugDB for the live community fork that v0.2 ships against (DEC-013).
- Zep / getzep for Graphiti — the temporal knowledge graph that powers the above-threshold insight backend (DEC-019).
- Anthropic for the Skills format, Claude Code, and the MCP protocol that makes this whole product shape possible.
- Astral for
uvandruff. - Repomix (yamadashy) for the original v0.1 flatten-the-repo pattern, now demoted to
--legacy-repomix(DEC-017) but still available for legacy use cases.
Contributing
Contributions are welcome — see CONTRIBUTING.md for the dev
setup, the verification gate, and the architectural invariants (the 5-artifact contract,
the Endpoint keystone, the confidence taxonomy). By contributing you agree your work
is licensed under Apache-2.0.
License
Apache-2.0. See LICENSE.
If you redistribute, modify, or build on this project, the Apache-2.0 terms apply: you
must retain the copyright notice, the LICENSE text, and the NOTICE file, and
state any changes you made (License §4). Attribution is required; the project is
Copyright 2026 Dhevenddra (see NOTICE). The boilerplate header in the
LICENSE appendix (Copyright [yyyy] [name of copyright owner]) is a template for
applying the license to source files — it is not itself a requirement, and the LICENSE
file is kept verbatim as the official Apache-2.0 text.
來源:README.md,提交 ddef84f
工具
0版本歷史
1- v0.10.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分