
Parecode
io.github.BasilSkyWalk由 GitHub 账号 BasilSkyWalk 发布v0.7.0更新于 Oct 24, 2026
Token-aware ripgrep code search and atomic multi-file edits for coding agents.
概览
一个本地 MCP 服务器,为编码代理提供感知 token 的 ripgrep 代码搜索、范围扩展和原子化多文件编辑,以减少大型代码库的上下文消耗。
- 可以做什么
- 用 ripgrep 搜索代码,支持一次调用传入多个模式、自动合并上下文窗口、返回每个匹配的 token 估算,并可选提示相关符号和报告被省略的行范围。按已知文件和行范围向外扩展上下文,避免重读整个文件。批量执行多文件编辑,带模糊匹配、冲突检测和原子写入。查看本地会话统计与估算的 token 节省,并可选择回溯扫描过去的 Claude Code 会话。
- 适用场景
- 适合在大型仓库中工作的代理,反复 grep、读取和编辑的往返成本很高时使用,例如查找调用点、多文件重构、对大量文件做相同修改。对单文件或偏重推理的任务价值较小,README 称此时节省会趋近于零。
- 运行要求
- 以本地 stdio 进程运行,从 npm 安装(parecode)。需要 Node.js 20 或更高版本,以及 PATH 中可用的 ripgrep;ripgrep 不随包捆绑。需要受支持的 MCP 客户端,参考目标是 Claude Code。未声明认证、环境变量或请求头。
安装
在 SourceWeft 中
- 打开 控制台中的 Parecode,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
parecode
An MCP server that gives coding agents context-window-aware search and safe, atomic multi-file edits — built to cut token usage on large codebases without giving up correctness.
Requirements
- Node.js 20 or newer (ESM, native test runner, stable
fetch-free runtime). - ripgrep on
PATH(rgon Linux/macOS,rg.exeon Windows). Install via your package manager:- macOS:
brew install ripgrep - Debian/Ubuntu:
apt install ripgrep - Windows:
winget install BurntSushi.ripgrep.MSVCorchoco install ripgrep
- macOS:
- A supported MCP client (Claude Code is the reference target).
Parecode does not bundle ripgrep — it shells out to the system binary so you stay on a single, audited version.
Install
Pure JavaScript — no native dependencies, no C/C++ toolchain required.
Quick start
Register the server with Claude Code:
The SessionStart hook injects a short directive at the start of each session telling Claude to prefer ParecodeSearch / ParecodeEdit over the equivalent native tools. Without it, Claude's first-party Grep / Read / Edit tools typically win by default and Parecode's token savings never land. The hook payload is a static string; parecode hook session-start prints it. Pass --no-hook if you would rather opt in explicitly per session via your own tooling.
The bundled parecode-explore Claude Code plugin adds a read-only subagent (pinned to Haiku, given only ParecodeSearch) and a matching skill, so exploration-style questions ("where is X?", "how does Y work?", "find all usages of Z") get answered in a cheap, isolated context window instead of burning tokens in your main session. init registers a local marketplace pointing at the npm-installed copy and runs claude plugin install parecode-explore@parecode. If your Claude Code build doesn't support the plugin subcommand the step soft-fails with a warning and the rest of init still succeeds; pass --no-plugin to skip it entirely, or --with-plugin to make any plugin-step failure hard-fail.
Then in any session, the ParecodeSearch, ParecodeExpand, and ParecodeEdit tools become available. Run parecode doctor to confirm registration, hook status, and .codegraph/ pairing if present.
What it does
ParecodeSearch— ripgrep-backed search that returns matches with surrounding context windows in a single call, with per-file byte chunking so large result sets do not blow up your context.patternaccepts a single string or an array of strings; arrays dispatch parallel ripgrep runs sharing the samepaths/contextLines, and each match carries apatterns: string[]field listing which input patterns contributed. One call replaces N back-to-back greps for related-keyword flow tracing.- Overlapping or adjacent windows within the same file are merged automatically (gap ≤
contextLines), with bridging lines loaded from disk. - Per-match and response-level
estimatedTokensare returned so the agent can self-budget before consuming results. - Opt-in
relatedSymbols: truesurfaces likely event-flow neighbours (Handle<X>,On<X>,<X>Handler/Listener/Closed/Completed/Started) discovered in each match, capped at 10. - Omitted line ranges are reported so the agent can widen with
ParecodeExpandwithout re-reading the whole file.
ParecodeExpand— widen a known(file, startLine, endLine)range with optionalcontextBefore/contextAfterpadding. Designed as the natural follow-up to aParecodeSearchmatch. Returns the sameestimatedTokensshape so the same self-budgeting heuristic applies. Prefer this over a full-fileReadafter locating a line.ParecodeEdit— batched multi-file edits with whitespace-tolerant fuzzy matching (and an opt-in Unicode-lookalike mode), pre/poststatconflict detection, and atomic same-directory rename writes. Cross-file edits run in parallel.parecode stats— local JSONL session log with token-saved estimates. Zero network. Zero telemetry.
Measured savings
On search-and-edit tasks — finding call sites, multi-file refactors, "do X to every Y" — Parecode cut cost ~40% and assistant turns ~75–83% in matched A/B tests:
Method: the identical task run with Parecode on vs off, a fresh session per run, n=3 per arm with alternated order, Sonnet 4.6. Savings come from collapsing many Grep / Read / Edit round-trips into single ParecodeSearch / ParecodeEdit calls — so the win scales with how much searching and multi-file fan-out a task involves, and shrinks toward zero on single-file or reasoning-heavy tasks. These are measured per-session token and cost numbers, not the estimates in the scan below.
Retroactive Savings Scan
Curious how much Parecode would have saved you if you had installed it earlier? You can scan your past Claude Code sessions:
Sample output:
Privacy disclaimer: This scan runs entirely locally against Claude Code's session transcripts (~/.claude/projects/**). By default, it parses only structured fields (tool names, paths, patterns, and token counts). It does not send any data over the network. The --include-content flag (which allows reading tool input/output) is strictly opt-in and loudly flagged if used.
Privacy
Parecode performs no network calls at runtime. Session logs are written to your OS data directory (resolved via env-paths) with 0600 permissions on Unix. Logs are self-maintaining: each server start prunes session data older than 30 days and caps the envelope log at 5 MB. Prune earlier with parecode prune <days> or wipe the data dir. Update to the latest release (and refresh hooks/plugin) with parecode update.
License
来源:README.md,提交 eb6f8a6
工具
0版本历史
1- v0.7.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
