v1.19.02026-11-08
MCP 服务器迁移到 TypeScript SDK v2,兼容 2026-07-28 协议:客户端关闭 stdin 后进程能干净退出,不再残留 repomix --mcp,安装依赖从 171 个缩到 84 个;工具 schema 改用 JSON Schema 2020-12,校验错误不再带 MCP error -32602: 前缀。packcodebase、packremoterepository、generateskill 支持进度通知与取消,长任务能实时汇报状态,取消或断开即中止并清理半成品输出。
--compress 输出显著更准:修复函数体代码被当声明输出、重复行残留,以及 C/C++ 的 typedef、#define、字段声明等被误删的问题,多语言输出均有变化,依赖旧版结果的流水线会看到 diff。--skill-generate 新增对 Gradle Kotlin DSL 和 PEP 621、Poetry 格式 pyproject.toml 的识别;远程 URL 中被忽略的路径现在会告警并提示 --include 写法。
还修了一批忽略规则的坑:通配符结尾的模式漏过文件、.git/info/exclude 匹配深度不符 Git 行为、否定模式被反向执行、--split-output 的历史文件被打进下一次结果,以及 --remove-comments 把 CSS、SCSS、Less、Vue、Svelte 里的 URL 当注释截断。
v1.18.12026-09-21
Repomix 本次补丁版本修复了一个安全漏洞和多处 bug。
安全方面(GHSA-4p5g-gh74-q524):Repomix 会在目标目录执行 git log、git diff 等命令来排序文件、输出差异与提交历史,而 git 会读取仓库自带 .git/config 中指向可执行文件的配置(如 gpg.program、diff.external、textconv 驱动、core.fsmonitor)。若解压一个内含伪造 .git 的压缩包并在其中运行 Repomix,就可能触发任意命令执行。现在所有 git 命令都会禁用这类设置,正常仓库的输出不受影响。常规 git clone 不携带远端 .git/config,--remote 也会先删除 .git,这些路径原本就安全。
bug 修复包括:Windows 下 .gitignore 混用反斜杠转义与取反规则导致打包崩溃;--remove-comments 误删 Shell 和 YAML 中的 ${name##*/}、$#、URL 片段等结构,现已按各语言注释规则处理;--include-full-directory-structure 与 --include 搭配时不再丢失未纳入文件的目录树;--split-output 的每个分片现在只显示自身文件的目录结构;以点开头仓库名的远程 URL 可正常解析;截断 Base64 时保留完整的 data URI 参数;另有若干 CLI 细节修正,包括拒绝会归零的分片大小、按真实目录边界判断路径归属、从 GitHub URL 提取远程 skill 名称。
更新方式:
```bash
npm update -g repomix
v1.18.02026-08-08
This release introduces sandbox mode for the MCP server, confining it to a single workspace directory, along with a set of security hardening changes across the MCP tool surface and remote repository processing!
What's New 🚀
MCP Sandbox Mode (#1753, #1754)
The MCP server can now be confined to a single workspace directory with the --sandbox flag:
``bash
Confine to the current working directory
repomix --mcp --sandbox
Confine to a specific directory
repomix --mcp --sandbox path/to/project
`
By default the MCP server can read any path the host user can, which is convenient for a trusted local assistant but too broad when the server is exposed to an untrusted client or agent, such as when embedding Repomix in a hosted application. In sandbox mode:
- Every path is relative to the workspace root. Absolute paths, ~, .., and Windows drive/UNC paths are refused, and paths that resolve outside the root (including through symlinks) are dropped.
- Results and error messages are virtualized, so host paths are never exposed.
- Only the read-only, root-confined tools are registered: packcodebase, readrepomixoutput, greprepomixoutput, filesystemreadfile, and filesystemread_directory. Remote packing, skill generation, and attaching external outputs are disabled.
This is an application-level confinement of the tool surface, not an OS-level sandbox: when hosting the server for untrusted clients, still run it under your platform's usual isolation (containers, dedicated users).
See MCP Server – Sandbox Mode for details.
Special thanks to @huy-trn for designing and implementing this feature. Great to have a long-time contributor back! 🎉
Security Hardening 🔒
MCP File System Tools Are Now Sandbox-Only
The filesystemreadfile and filesystemreaddirectory tools are now registered only in sandbox mode. Outside --sandbox they could read any path the process can, while their built-in Secretlint scan was presented as more protection than it provides: it recognizes known secret formats in file content, and nothing else. In sandbox mode the workspace root gives these tools a real access boundary, with the secret scan kept as an additional heuristic safeguard.
If your MCP setup relied on these two tools, add --sandbox [dir] to the server arguments to keep using them, confined to that workspace.
Tool descriptions and documentation have also been reworded across the board to describe the Secretlint scan as what it is: a best-effort content heuristic, not an access boundary.
See the security advisory for details. Thanks to @rafaelfiguereod-stack for the report! 🙏
https://github.com/yamadashy/repomix/security/advisories/GHSA-rpmv-562j-qxrv
Credentials in Repository URLs Are Redacted Before Logging
Remote URLs are routinely written with credentials inline (https://<token>@github.com/owner/repo.git), especially in CI. Repomix previously echoed such URLs as-is into console output, trace logs, error messages (git repeats the full command line in its failure output), and the MCP packremoterepository response, persisting the credential in terminal scrollback, CI build logs, and log aggregation systems. All of these paths now redact userinfo credentials and known credential query parameters (token, privatetoken, accesstoken, and similar) before the URL is written anywhere.
See the security advisory for details. Thanks to @kakashi-kx for the report! 🙏
https://github.com/yamadashy/repomix/security/advisories/GHSA-w8cw-mgw9-74h7
Cloud Metadata Endpoints Are Refused as Clone Targets
Remote packing now refuses to clone from cloud instance metadata endpoints (169.254.0.0/16, fd00:ec2::254, 100.100.100.200, metadata.google.internal), which serve credentials and host no git repository. Through the MCP server an AI agent chooses the URL, so an injected instruction could otherwise aim a clone at an address the user never asked for. Private networks (RFC1918) remain allowed, since cloning from self-hosted git servers is normal.
How to Update
`bash
npm update -g repomix
``
---
As always, if you have any issues or suggestions, please let us know on GitHub issues or our Discord community.
v1.17.02026-07-21
Repomix 这版三个看点。自定义文件处理器(#1720):打包前可调外部命令改写文件,JSON 转 TOON、SVG 压缩都排得上号。配置项为 { pattern, command, timeout?, onError? },{file} 换成文件副本,命令输出即新内容,之后照常过安全检查和 token 统计。出于默认拒绝,只有直接跑 repomix CLI 才会执行,库 API、MCP、托管站一概不碰,远程仓库的处理器需 --remote-trust-config 才生效。信任远程配置前现在会先展示内容并询问(#1747),「不再询问」绑定配置本身,改了就重问;CI 等非交互环境行为不变,--force 也可跳过。MCP 的 packcodebase 与 packremote_repository 新增 outputPatterns(#1719),可按文件选择完整、压缩或仅目录结构,远程仓库无法加载自身配置,这参数正好补位。
v1.16.12026-07-11
Repomix 1.16.1 是一个纯修复版本,主要解决三类问题。
先是修掉了 WebAssembly 内存泄漏:解析生成的 Tree 对象此前用完不释放,批量解析或压缩大仓库时堆内存会持续攀升,现在解析结束即释放,占用保持稳定。其次,--remove-comments 覆盖面扩大,.mjs、.cjs、.mts、.cts 及对应的 JSX 变体 .mjsx、.mtsx 这些模块文件此前会被跳过,如今也能正常去除注释。另外两处针对 token 统计树和目录结构:以 ` 开头的目录(如 tests、mocks__)之前既不出现在 --token-count-tree 输出里,也不计入总数,现已与其他目录同等对待;Windows 下目录树则因路径分隔符处理不当塌成全路径平铺、文件排序退化为字符串比较,规范化后各平台嵌套与排序均恢复正常。
``bash
npm update -g repomix
v1.16.02026-06-29
这次更新的重头是 output.patterns:在配置文件里可按 glob 逐文件指定打包粒度——完整收录、走 Tree-sitter 压缩,或只保留目录结构。首条命中的规则生效,并覆盖全局 output.compress,例如让 docs/ 压缩、website/ 只留骨架:
``json5
{
"output": {
"compress": false,
"patterns": [
{ "pattern": "docs//", "compress": true },
{ "pattern": "website//", "directoryStructureOnly": true }
]
}
}
`
输出路径新增 cwd-relative 风格,按当前工作目录而非目标目录渲染,配置 output.filePathStyle: "cwd-relative" 或传 --output-file-path-style cwd-relative 即可,多根打包时路径更清晰。Skill 生成新增 --skill-project-name,可显式指定项目名。
稳定性方面,--compress 遇到 Tree-sitter 解析不了的文件(含触发 WASM 中止的极端情况)不再中断整包,会降级为不压缩并给出警告,其余照常完成;扩展名匹配改为忽略大小写,.PY、.TS 也能正确处理;修复远程打包后拆分输出文件未被正确复制的问题。更新执行 npm update -g repomix`。
v1.15.02026-06-18
本次更新的三个重点:新增监视模式(-w、--watch),可监听代码库变化并自动重新打包,新增、修改、删除的文件都会被捕获,连续变更做 300ms 防抖,每次重建后打印时间戳,Ctrl+C 退出。该模式遵循常规忽略规则并跳过被忽略目录,仅限本地使用,不能与 --remote、--stdout、--stdin 等参数同时使用。
GitHub 简写自动识别:直接执行 repomix owner/repo 即可,无需再加 --remote。参数匹配 owner/repo 格式且本地不存在同名路径时,会轻量探测 GitHub 并打包远程仓库;本地同名路径优先,需要强制本地处理时加 ./ 前缀。
新增 --token-budget <number>:输出超过 N 个 token 时以非零码退出,内容照常生成。这给 CI 流水线和 Agent 工作流提供了把输出控制在目标模型上下文窗口内的护栏。
另外修复了几处忽略规则的边界问题:被忽略的 .gitignore 规则仍会生效、带尾斜杠的模式不再泄漏文件、名为 .gitignore 的目录其后代会被正确排除;还修了多根目录打包时的重复相对路径,并升级了依赖。
v1.14.12026-05-27
This release patches two security advisories and continues the performance work from v1.14.0 with a persistent token-count cache, plus expanded Dart parsing and Nix support. Updating to 1.14.1 is recommended for all users.
Security 🔒
Argument Injection via --remote-branch (GHSA-9mm9-rqhj-j5mx)
A crafted --remote-branch value could be passed to git as an option rather than a ref, enabling argument injection (CWE-88, High). Repomix now validates refs and inserts --end-of-options before the ref in git fetch and git checkout, so a branch value can never be interpreted as a git option.
Special thanks to @kakashi-kx (Abhijith S) for the responsible disclosure! 🎉
MCP attachpackedoutput Secret-Scan Bypass (GHSA-hwpp-h97w-2h3j)
The MCP attachpackedoutput flow could register an arbitrary local file and read it back through readrepomixoutput / greprepomixoutput without the secret scan that filesystemread_file applies (CWE-200, Moderate). Those tools now run the same secret scan on attach-sourced files before returning content, closing the bypass.
Special thanks to @dodge1218 for the responsible disclosure! 🎉
Improvements ⚡
Expanded Dart Code Parsing (#1515)
The Dart Tree-sitter query now captures mixins, typedefs, getters, setters, and factory constructors. Compressed output (--compress) for Dart files now preserves more of the file's structure.
Content-Addressed Token-Count Disk Cache (#1562, #1580)
Token counts are now cached on disk, keyed by content hash. Re-packing a repository reuses counts for unchanged files instead of re-tokenizing them, and the eager metrics warm-up is skipped when the cache is already populated — speeding up repeated runs on the same repository.
Faster Binary Detection (#1542)
Repomix now attempts a UTF-8 decode before the binary-file check, avoiding a pathological slow path in the protobuf detector on certain inputs.
Node.js Support Update (#1556)
Node.js 20 is no longer supported and Node.js 26 is now supported. Repomix requires Node.js 22 or later.
Available on nixpkgs
Repomix is available in nixpkgs, so Nix users can install it directly:
``bash
nix-shell -p repomix
`
Development 🛠️
Nix Flake with Development Shell (#1525)
Added a flake.nix providing a development shell (Node.js 24 + Git) for contributors using Nix:
`bash
nix develop
`
How to Update
`bash
npm update -g repomix
``
---
As always, if you have any issues or suggestions, please let us know on GitHub issues or our Discord community.
v1.14.02026-04-26
本次更新主打性能:打包耗时从 v1.13.1 的 3.3 秒降到约 1.4 秒,快了约 2.4 倍。提速是数十处优化叠加的结果——token 计数改用纯 JS 的 gpt-tokenizer,省掉约 200 毫秒的 WASM 初始化,也摆脱了对 WASM 的依赖;默认 repomix 动作不再派生子进程,启动开销随之消失;对不可解析的 XML/Markdown/纯文本输出,改为复用各文件的 token 数、只对包裹层重新分词,单这一项就省 13%。流水线各阶段也开始并行:安全检查与文件处理同时跑,输出生成与指标计算重叠,CLI 按需懒加载;安全 worker 关掉 @secretlint/profiler 又带来约 6.5% 收益。
功能方面,--skill-generate 现在会扫描子目录的依赖文件并按包目录分组,monorepo 生成的 tech-stacks.md 为每个 workspace 单列语言、框架、依赖和运行时版本,此前只看根目录。
v1.13.12026-03-26
修复 base64 识别的误报,剪贴板依赖也换成更轻量的方案。
修复:路径字符串被误截断
truncateBase64 之前会把 XPath、路径类字符串(如 postTransactionAmounts/sharesOwnedFollowingTransaction/value)当作 base64 截掉——这类字符串只由字母和 / 组成,正好撞上旧规则。本次两处收紧:独立 base64 的最小识别长度从 60 字符提高到 256;启发式规则新增「必须含数字」——真正的二进制 base64 几乎必带数字,而路径类字符串通常不含。
改进:剪贴板改用 tinyclip
以零依赖的 tinyclip 替换 clipboardy,连带移除 41 个传递依赖,剪贴板相关安装体积从约 4 MB 降到约 24 KB。
```bash
npm update -g repomix