mcpField
P
parecode

parecode

Local
github.com/BasilSkyWalkDeveloper Tools5Updated 19w ago

About parecode

parecode is an MCP server for coding agents that combines token-aware code search with atomic multi-file edits. It returns bounded search context and token estimates, helping agents explore and modify large codebases with fewer tool calls.

Key features

  1. 01ripgrep 搜索并返回上下文窗口
  2. 02估算匹配项与响应的 token 数
  3. 03按需扩展已定位的代码范围
  4. 04模糊匹配并原子化编辑多个文件
  5. 05记录本地会话与 token 节省估值

Use cases

  1. 01追踪符号并查找代码调用点
  2. 02探索大型代码库中的实现
  3. 03对多个文件执行一致性重构

MCP support

作为 MCP 服务向编码 Agent 提供 ParecodeSearch、ParecodeExpand 和 ParecodeEdit 工具。

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"basilskywalk-parecode": {
"command": "npx",
"args": [
"-y",
"parecode"
]
}
}
}
Run commandnpx -y parecode

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmparecode0.7.0

Tools

3

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
pathsarrayNoDirectory or file paths to restrict the search. Defaults to the current working directory.
patternanyYesRipgrep regex pattern, or an array of patterns to dispatch in parallel. Each match reports which input pattern(s) contributed via 'patterns'.
contextLinesnumberNoNumber of context lines to include around matches. Defaults to 2. Also controls window-merge threshold within a file.
relatedSymbolsbooleanNoOpt-in: scan each match's content for likely related symbols (Handle<X>, On<X>, <X>Handler, <X>Listener, <X>Closed/Completed/Started). Returns deduped, lexically sorted, capped at 10 per match.
maxBytesPerFilenumberNoSoft cap on bytes returned per file; above it, output is chunked around match centers and the trimmed lines are reported in omittedLineRanges (widen them with ParecodeExpand).

Details

From the project 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

npm install -g parecode

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


Quick start

Register the server with Claude Code:

parecode init                       # user scope; installs MCP + SessionStart hook + parecode-explore plugin (defaults)
parecode init --scope project       # commit MCP config + hook to the repo
parecode init --no-hook             # register MCP only; skip the SessionStart hook
parecode init --no-plugin           # skip the parecode-explore Claude Code plugin
parecode init --print               # print the equivalent command without running it
parecode 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:

parecode stats --retroactive --since 30d

Sample output:

Parecode — last 30d (retroactive scan)
─────────────────────
Sessions:                   42
Tool calls:                156
Calls batched (est):        89
Tokens 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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.