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.

已驗證STDIO僅桌面檔案與儲存開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,為編碼代理提供感知 token 的 ripgrep 程式碼搜尋、範圍擴充與原子化多檔案編輯,以降低大型程式碼庫的上下文用量。

可以做什麼
以 ripgrep 搜尋程式碼,支援一次呼叫多個模式、自動合併上下文視窗、回傳每個符合項目的 token 估算,並可選擇提示相關符號與回報被省略的行範圍。依已知檔案與行範圍向外擴充上下文,避免重讀整個檔案。批次執行多檔案編輯,具備模糊比對、衝突偵測與原子寫入。檢視本機會話統計與估算的 token 節省,並可選擇回溯掃描過去的 Claude Code 工作階段。
適用情境
適合在大型儲存庫中工作的代理,當反覆 grep、讀取與編輯的往返成本很高時使用,例如尋找呼叫點、多檔案重構、對大量檔案做相同修改。對單一檔案或偏重推理的工作價值較低,README 指出此時節省會趨近於零。
執行需求
以本機 stdio 程序執行,從 npm 安裝(parecode)。需要 Node.js 20 或更新版本,以及 PATH 中可用的 ripgrep;ripgrep 未隨套件綑綁。需要受支援的 MCP 用戶端,參考目標為 Claude Code。未宣告驗證、環境變數或標頭。
安裝前請注意
編輯工具會寫入檔案,包括跨檔案批次修改,應審查變更。init 指令會註冊伺服器,並可能安裝 SessionStart 掛鉤與 Claude Code 外掛,因而修改用戶端設定;可用選項跳過或移除。回溯統計會讀取本機 Claude Code 工作階段紀錄,include-content 選項允許讀取工具輸入輸出,應謹慎使用。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Parecode,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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.

[parecode MCP server]


Requirements

  • Node.js 20 or newer (ESM, native test runner, stable fetch-free runtime).
  • ripgrep on PATH (rg on Linux/macOS, rg.exe on Windows). Install via your package manager:
    • macOS: brew install ripgrep
    • Debian/Ubuntu: apt install ripgrep
    • Windows: winget install BurntSushi.ripgrep.MSVC or choco install ripgrep
  • 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

sh
npm install -g parecode

Pure JavaScript — no native dependencies, no C/C++ toolchain required.


Quick start

Register the server with Claude Code:

sh
parecode init                       # user scope; installs MCP + SessionStart hook + parecode-explore plugin (defaults)parecode init --scope project       # commit MCP config + hook to the repoparecode init --no-hook             # register MCP only; skip the SessionStart hookparecode init --no-plugin           # skip the parecode-explore Claude Code pluginparecode init --print               # print the equivalent command without running itparecode init --remove-hook         # remove the SessionStart hook (MCP stays registered)parecode init --remove-plugin       # uninstall the parecode-explore Claude Code plugin

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.
    • pattern accepts a single string or an array of strings; arrays dispatch parallel ripgrep runs sharing the same paths / contextLines, and each match carries a patterns: 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 estimatedTokens are returned so the agent can self-budget before consuming results.
    • Opt-in relatedSymbols: true surfaces 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 ParecodeExpand without re-reading the whole file.
  • ParecodeExpand — widen a known (file, startLine, endLine) range with optional contextBefore / contextAfter padding. Designed as the natural follow-up to a ParecodeSearch match. Returns the same estimatedTokens shape so the same self-budgeting heuristic applies. Prefer this over a full-file Read after locating a line.
  • ParecodeEdit — batched multi-file edits with whitespace-tolerant fuzzy matching (and an opt-in Unicode-lookalike mode), pre/post stat conflict 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:

repotaskcostturns
TypeScriptfind every call site of a symbol, edit each (17 sites, 8 files)−43%−83%
Unity / C#find every call site of a symbol, edit each (11 sites, 5 files)−41%−76%

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:

sh
parecode stats --retroactive --since 30d

Sample output:

text
Parecode — last 30d (retroactive scan)─────────────────────Sessions:                   42Tool calls:                156Calls batched (est):        89Tokens saved (est):  1,200,000
* Note: Retroactive savings are estimated, not measured.

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

MIT

來源:README.md,提交 eb6f8a6

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.7.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分