
culprit
io.github.noordeen123由 GitHub 帳號 noordeen123 發布v0.4.0更新於 Oct 24, 2026
Deterministic, offline root-cause analysis and pre-commit fix verification for coding agents.
概覽
為編碼代理提供確定性的離線根因分析,並在提交前驗證修正是否完整。
- 可以做什麼
- 在本地 git 儲存庫上執行唯讀分析並回傳結構化 JSON。工具包括 analyze 完整根因分析、find_suspects 排序引入缺陷的提交、verify_fix 提交前檢查差異、check_completeness 找出未改動的呼叫點、get_blast_radius 檢視相依與涵蓋測試、get_risk_score、get_test_impact、classify_change、get_evolution、get_intent,以及從堆疊追蹤分析的 from_trace。另附命令列工具與可選 HTML 報告。
- 適用情境
- 適合代理需要找出缺陷由哪次提交引入、在提交前判斷自己的修正是否完整,或評估變更可能影響什麼時使用。它是代理自身 git 排查的加速器而非替代品,適用於任何 git 可讀取的儲存庫。
- 執行需求
- 以 uvx 從 PyPI 套件 culprit 啟動的本地程序;MCP 伺服器需要 Python 3.10+ 與 uv(命令列工具支援 3.9+)。核心分析無需 API 金鑰或網路;可選的 GITHUB_TOKEN 或 GITLAB_TOKEN 可提高 PR 中繼資料 API 限額,範例 CI 工作流程使用 GH_TOKEN。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 culprit,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
culprit
[CI] [PyPI] [Python versions] [License: MIT]
Root-cause analysis for agent-driven development.
Your coding agent finds what introduced a bug, and verifies its own fix is complete before it commits.
Quick start · Tools · Accuracy · Architecture · MCP registry
[An agent's fix scores partial with two missed call sites, then complete after patching them]
A real run. The fix patched one caller of parse_config and missed two, so it scores partial.
Why an agent needs this
An agent can dig through git history to find what broke, and it is good at it. What it will not reliably do is spend a dozen tool calls on that every time, or stop and check whether the helper it just changed has three other callers before it commits. culprit turns both into one deterministic call that returns structured JSON it can act on:
- ⚡️ Instant. No test runs, no bisect. Benchmarked at 41% fewer agent tool calls.
- 🔒 Read-only and offline. Never writes to your repo or PR. No API key, no network.
- 🔌 MCP-native. 11 tools over stdio, on the official MCP registry, plus a one-command plugin.
- 🗣️ Language-agnostic. Suspects work anywhere git does. Blast radius reads 12 language families.
Does it actually work?
Benchmarked against 50 real regressions, 25 from git and 25 from
systemd, where the introducing commit is known from each
fix's Fixes: trailer (author-verified ground truth). Given only the fix commit, culprit blames
the removed lines to rank the commits that introduced the bug.
Deterministic and offline, on large C codebases the engine has never seen. Reproduce with
python benchmarks/run.py, which clones the repos and scores every case.
But an agent can run git blame itself
It can, and it is good at it. So the honest question is not whether culprit is accurate, but whether it beats or helps an agent that has git and no culprit. Same 10 regressions, three arms, isolated so no arm can read the answer from the fix commit:
The agent wins on accuracy, and culprit does not make it more accurate. What culprit does is get it there in roughly half the steps for about 8,000 fewer tokens per investigation. Tool calls dropped in 10 of 10 cases, tokens in 7 of 10. On the hardest case the agent needed 42 tool calls and 124k tokens alone, against 16 calls and 84k with culprit.
Those savings are already net of reading culprit's output, which is counted in the third column. culprit's own run is one deterministic call, no model, under a second.
So culprit is an accelerator for an agent, not a replacement for one, and not a smarter
blamer than one. Method, caveats (n=10, and this slice is easier than the full 50), and
reproduction: benchmarks/agent/.
Quick start
Claude Code plugin (installs the MCP server plus a skill that tells the agent when to use it):
Any MCP client (Cursor, Windsurf, VS Code, Codex CLI, Zed, Continue, Cline, Amazon Q, Goose):
CLI, no agent required:
Needs Python 3.10+ and uv for the MCP server. The CLI runs on 3.9+.
The tools
verify_fix, the pre-commit gate
The agent runs this on its own diff before committing:
verdict:completewhen no untouched call site is left behind,partialwhen one was missed,riskywhen risk is high. The verdict is the completeness axis; test coverage is the separate confidence axis onrisk_level.untouched_references: the exact files that still use the changed symbol. This is the list the agent goes and patches.skipped_symbols,adds_test,notes: what was too widely used to check, whether a test shipped, and what to do next.
Loop until complete, then commit. That is the whole idea.
CLI and CI
CI gate: risk via exit code only, no PR comments, no writes. Copy
examples/github-actions/culprit-pr.yml into
.github/workflows/:
HTML report
--html writes one self-contained file. No CDN, opens offline, attaches to CI. It opens with the
verdict: a scored QA risk with the factors behind it, and the prime suspect with how long the bug
lived.
Then it reconstructs how the bug got there. Every commit that touched the buggy line, from creation through the commit that broke it (red, with the exact diff) to the fix (green):
Every node expands to its diff. See the full report.
vs git bisect
--bisect "<cmd>" runs a real bisect as an optional confirmation layer, in a throwaway
git worktree so your checkout is never touched. When the first failing commit matches the
blamed suspect, the report stamps it confirmed by git bisect.
Architecture
One normalized context in, one structured JSON result out. The only non-deterministic step is the optional LLM narrative, isolated behind an adapter so the engine runs with no API key.
Two lanes, one engine. Every module writes one slice of the result, so nothing cares whether
the target came from gh, the REST API, local git, or a pasted stack trace. Full module map:
docs/ARCHITECTURE.md.
Configuration
The base branch resolves in order: the --base flag, then CULPRIT_BASE, then .culprit.toml
(base = "origin/main"), then HEAD~1. --last forces the latest-commit view.
PR titles and labels use the GitHub CLI when present, or the unauthenticated REST API for public
repos (set GITHUB_TOKEN or GITLAB_TOKEN to raise limits). Deep links cover GitHub, GitLab,
Bitbucket, and Gitea. Blast radius reads imports across JS/TS, Python, Go, Java/Kotlin, Ruby,
C/C++, C#, PHP, Rust, Scala, and Swift.
Contributing
Module map and data shapes: docs/ARCHITECTURE.md. Publishing the MCP
server to the registries: docs/PUBLISHING.md. MIT licensed.
來源:README.md,提交 5f426e5
工具
0版本歷史
1- v0.4.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分