parecode
An MCP server giving coding agents context-window-aware code search and safe, atomic multi-file edits — built to cut token usage on large codebases without sacrificing correctness.
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
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.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:
| repo | task | cost | turns |
|---|---|---|---|
| TypeScript | find 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. Prune with parecode prune <days> or wipe the data dir.
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。