🔶 Fuse – 加速 Claude Code 在 C# 代码库上的开源 MCP/CLI 工具
英文标题:🔶 Fuse – an open source MCP/CLI tool to speed up Claude Code on C# codebases
Fuse 是一个本地 .NET 工具,通过持久化语义索引、类型化依赖图解析、缩减任务范围源代码和预写入编译器验证,提升编码 Agent 的效率。它在 MSBuild 和 Roslyn 之上构建,将解决方案结构存入 `.fuse/fuse.db` 并跨对话轮次复用,避免重复发现。实验数据显示,其骨架缩减可移除 38%–44% 的 token 同时保留所有公共/受保护类型名,且分支审查的中位响应仅 1,026 token、精度 93.4%。对于 .NET 开发者,Fuse 提供了编译级代码检查、影响分析和重构验证等特性,可安全集成到 Agent 工作流中。
134.0 KB
69.0 KB
中文
Fuse 是一个本地 .NET 工具,为编码 Agent 提供持久化语义索引、类型化依赖图解析、缩减任务范围源代码和预写入编译器验证。它通过 MSBuild 和 Roslyn 索引解决方案,将结果存储在 .fuse/fuse.db 中,并跨 Agent 轮次复用,避免通过反复读取文件和文本搜索重复发现相同结构。
在 .NET 项目目录下执行:
dotnet tool install -g Fuse fuse mcp install --rules
重新加载 MCP 客户端,然后询问:
Resolve IOrderService to its implementation, then check the proposed OrderService.cs edit with fuse_check before writing it.
当 MCP 服务器启动时,其共享的本地守护进程开始在后台预热 .fuse/fuse.db。冷读取会等待有边界的语法优先遍历,并在语义图仍在升级时给出提示。若需在连接 Agent 前执行同步全量索引,可运行 fuse index。fuse mcp install --rules 还会在项目范围内将 .fuse/ 添加到 .gitignore。
分析在本地运行,可离线工作。Fuse 遍历包含 DI 注册、处理器、路由和调用者的类型图,生成所选范围的缩减源代码,并允许编码 Agent 在写入前对提议的单文件内容进行类型检查。不需要任何模型。可选更新检查会连接 NuGet,构建级操作可使用仓库配置的包源。
持久发现与缩减上下文
编码 Agent 可通过文件读取、grep 和正则表达式检查仓库。在大型解决方案上,这些操作可能会在多个轮次中重复发现相同的符号、引用、注册和项目结构。Fuse 通过 MSBuild 和 Roslyn 完成这些发现,将结果持久化,并在文件变更时进行增量重索引。
当项目以语义方式加载时,图中会记录 DI 注册、请求处理器、路由、选项绑定和调用边。若无法加载,Fuse 则降级为该项目的语法级索引并报告所处的模式。
- 解析依赖关系。
fuse_find跟踪服务、请求、路由或配置节,直至其处理代码。文本搜索能找到IOrderService;Fuse 则跟随注册找到实际运行的实现。 - 打包分支上下文。
fuse_review基于 git diff 进行定位,并返回相关的调用者、处理器和测试及其出处。在记录的 69 个拉取请求中,中位响应为 1,026 token,精度达 93.4%(review.json)。 - 返回更少源代码。
fuse_context在 token 预算内缩减所选文件,并记录每个文件被包含的原因。在四个记录的仓库中,骨架缩减移除了 38% 到 44% 的 token,同时保留了所有被测的公共和受保护类型名称(reduce.json)。 - 即取即用。 在记录的 NodaTime 运行中(语义层,14,760 个符号),精确符号查找的中位耗时为 1.8 毫秒,任务定位 15.7 毫秒,审查规划 106.3 毫秒(
performance.json;耗时取决于环境)。
编译器检查与变更验证
fuse_check检查一个文件的提议内容,并返回编译器诊断信息,而不更改工作树。Oracle 等级复用从真实构建捕获的编译器状态。当捕获状态不可用时,Build 等级则对所属项目运行一次限定范围的dotnet build。受支持的 API 形式错误可能包含修复包;在记录的运行中,最佳建议修复了 20 个近似错误的成员和类型错误中的 20 个(diagbench.json)。- 在修改公共方法之前,
fuse_impact会查找调用者、实现和引用类型。给定一个包 ID 和两个版本,它会返回该 NuGet 升级的破坏性变更集合。 - 当必须更改签名时,
fuse_refactor会将重构暂存为 diff,并仅在编译器未报告新诊断时才返回它。 - 编辑后,
fuse_test会选择并运行涉及已更改符号的测试类型,而不是从整个测试套件开始。
每个答案都标明了其产生方式。Fuse 称之为验证等级:oracle 等级基于从真实构建捕获的编译进行检查,build 等级运行限定范围的 dotnet build,当两种编译器路径都无法回答时,Fuse 会放弃并说明缺失的前置条件,而非猜测。
记录的结果涵盖哪些方面
以下每个结果均来自 tests/benchmarks/results,并在基准测试页面上提供了复现命令。
- 在记录的 OrderingApp 测试应用中,对 1,000 个编译器标记的编辑(500 个破坏性、500 个中性),
fuse_check报告了零个破坏性编辑为干净,也拒绝了零个有效编辑(checkgate.json)。 - 在同一应用中,Fuse 匹配了所有 24 个预期的 .NET 依赖关系链接,且无额外匹配(
semantics.json)。 - 在 69 个真实拉取请求中,分支审查在构造上保留了所有 git 变更文件,精度 93.4%,中位大小为 1,026 token(
review.json)。 - 在缩减范围的 Agent 循环运行中,Fuse 实验组的编辑在首次尝试时通过了项目自身测试的比例为 89%,而原生工具为 82%,置信区间重叠。Fuse 组在 8 次失败的编辑上声明成功,原生工具组为 9 次。构建和测试调用次数基本持平,分别为 3.1 次和 3.2 次(
loop.json)。 - 在四个记录的仓库中,骨架缩减移除了 38% 到 44% 的 token,同时保留了所有公共和受保护类型名称以及 96.3% 到 99.4% 的方法名称(
reduce.json)。
可选的驻留工作空间在记录的 NodaTime 运行中,对重复的 fuse_check 调用的响应中位耗时为 31.2 毫秒(resident-latency.json)。对于推测性检查,该路径比完整构建更快;它不替代合并前的常规构建或测试。
这些度量有明确的局限。在与其他工具比较或将数据应用于其他仓库前,请阅读完整的方法和结果。
Fuse 读取源代码、编译器状态、git 元数据及其本地的 .fuse/fuse.db 索引。读取、检查、影响、重构和审查操作均不写入工作树。fuse_workspace 在 action=apply 时是唯一明确的树写入路径,并且除非 write=true,否则是试运行。
编译器支持的依赖关系分析仅适用于 .NET。其他语言获得语法级搜索和缩减。
相关代码智能工具
仓库索引、代码图和语言服务器工具已经存在。CodeGraphContext 提供本地多语言图,Serena 提供语言服务器支持的符号工具,Sourcegraph 则涵盖多仓库搜索和代码智能。Fuse 专注于通过 MSBuild 和 Roslyn 进行的本地 .NET 工作:框架依赖关系、缩减范围的上下文、编译器支持的提议文件检查、变更影响以及覆盖测试选择。它可以与编码客户端内置的索引或搜索同时运行。
同行对比记录了一个有限且定期的实验及其抽样限制。它并非代码智能工具的通用排名。
Apache 2.0。版权所有 (c) 2026 Litenova Solutions。请参阅 LICENSE 和 NOTICE。
English / 原文
Fuse is a local .NET tool with a persistent semantic index, typed-graph wiring resolution, reduced task-scoped source, and pre-write compiler verification for coding agents. It indexes a solution through MSBuild and Roslyn, stores the result in .fuse/fuse.db, and reuses it across agent turns instead of rediscovering the same structure through repeated file reads and text searches.
From a .NET project directory:
dotnet tool install -g Fuse
fuse mcp install --rules
Reload your MCP client, then ask:
Resolve IOrderService to its implementation, then check the proposed OrderService.cs edit
with fuse_check before writing it.
When the MCP server starts, its shared local daemon begins warming .fuse/fuse.db in the background. A cold read waits for a bounded syntax-first pass and reports when the semantic graph is still upgrading. Run fuse index when you want a synchronous full index before connecting the agent. fuse mcp install --rules also adds .fuse/ to .gitignore at project scope.
Analysis runs locally and can work offline. Fuse walks a typed graph of DI registrations, handlers, routes, and callers, emits reduced source for a selected scope, and lets a coding agent typecheck proposed single-file content before writing it. No model is required. The optional update check can contact NuGet, and build-grade operations can use the package feeds configured for the repository.
Persistent Discovery and Reduced Context
Coding agents can inspect a repository through file reads, grep, and regex. On a large solution, those operations can rediscover the same symbols, references, registrations, and project structure across several turns. Fuse performs that discovery through MSBuild and Roslyn, persists the result, and incrementally re-indexes files as they change.
When a project loads semantically, the graph records DI registrations, request handlers, routes, options bindings, and call edges. When it does not, Fuse falls back to syntax-level indexing for that project and reports the mode.
- Resolve wiring.
fuse_findtraces a service, request, route, or configuration section to the code that handles it. Text search findsIOrderService; Fuse follows the registration to the implementation that runs. - Pack branch context.
fuse_reviewseeds on the git diff and returns related callers, handlers, and tests with provenance. On 69 recorded pull requests the median response was 1,026 tokens at 93.4 percent precision (review.json). - Return less source.
fuse_contextreduces the selected files under a token budget and records why each file was included. Across four recorded repositories, skeleton reduction removed 38 to 44 percent of tokens while retaining every measured public and protected type name (reduce.json). - Read warm. On the recorded NodaTime run (semantic tier, 14,760 symbols), exact symbol lookup took 1.8 ms at the median, task localization 15.7 ms, and review planning 106.3 ms (
performance.json; timings are environment-dependent).
Compiler Checks and Change Verification
fuse_checkchecks the proposed content of one file and returns compiler diagnostics without changing the working tree. Oracle grade reuses compiler state captured from the real build. Build grade runs a scopeddotnet buildfor the owning project when captured state is unavailable. Supported API-shape errors can include a repair packet; in the recorded run, the top suggestion repaired 20 of 20 near-miss member and type errors (diagbench.json).- Before changing a public method,
fuse_impactfinds callers, implementations, and referencing types. Given a package id and two versions, it returns the break set for that NuGet upgrade. - When a signature must change,
fuse_refactorstages the refactor as a diff and returns it only when the compiler reports no new diagnostic. - After an edit,
fuse_testselects and runs the test types that reach the changed symbol instead of starting with the whole suite.
Every answer names how it was produced. Fuse calls this the verification grade : oracle grade checks against the compilation captured from the real build, build grade runs a scoped dotnet build, and when neither compiler path can answer, Fuse abstains and names the missing prerequisite instead of guessing.
What the Recorded Results Cover
Every result below comes from tests/benchmarks/results and has a reproduction command on the benchmarks page.
- Across 1,000 compiler-labeled edits in the recorded OrderingApp test app (500 breaking, 500 neutral),
fuse_checkreported zero broken edits as clean and rejected zero valid edits (checkgate.json). - In the same app, Fuse matched all 24 expected .NET wiring links with no extra matches (
semantics.json). - Across 69 real pull requests, branch review retained every git-changed file by construction at 93.4 percent precision with a median size of 1,026 tokens (
review.json). - In the reduced-scope agent-loop run, the Fuse arm's edits passed the project's own tests on the first attempt in 89 percent of scored rollouts versus 82 percent for native tools, with overlapping confidence intervals. The Fuse arm declared success on a failing edit 8 times versus 9 for native. Build and test calls were essentially equal at 3.1 versus 3.2 (
loop.json). - Across four recorded repositories, skeleton reduction removed 38 to 44 percent of tokens while keeping every public and protected type name and 96.3 to 99.4 percent of method names (
reduce.json).
The opt-in resident workspace answered repeated fuse_check calls in 31.2 ms at the median on the recorded NodaTime run (resident-latency.json). That path is faster than a full build for speculative checks; it does not replace normal builds or tests before merge.
These measurements have defined limits. Read the full methods and results before comparing tools or applying the figures to another repository.
Fuse reads source, compiler state, git metadata, and its local .fuse/fuse.db index. Read, check, impact, refactor, and review operations do not write the working tree. fuse_workspace with action=apply is the one explicit tree-write path, and it is a dry run unless write=true.
Compiler-backed wiring analysis is .NET-only. Other languages receive syntax-level search and reduction.
Related Code-Intelligence Tools
Repository indexes, code graphs, and language-server tools already exist. CodeGraphContext provides a local multi-language graph, Serena exposes language-server-backed symbol tools, and Sourcegraph covers multi-repository search and code intelligence. Fuse concentrates on local .NET work through MSBuild and Roslyn: framework wiring, reduced scoped context, compiler-backed proposed-file checks, change impact, and covering-test selection. It can run alongside the index or search built into a coding client.
The peer comparison records a bounded, dated experiment and its sampling limits. It is not a general ranking of code-intelligence tools.
Apache 2.0. Copyright (c) 2026 Litenova Solutions. See LICENSE and NOTICE.
