{"slug": "hermes-agent-codebase-packing-tool-usage-guide-repomix-rs-high-performance", "title": "Hermes Agent Codebase Packing Tool Usage Guide (repomix-rs High-Performance Edition)", "summary": "Repomix-rs, a high-performance Rust rewrite of the original Repomix (TypeScript), packages entire codebases into single AI-friendly files for use with LLMs like Hermes Agent, Claude, ChatGPT, and Gemini. The tool offers millisecond-level parallel file scanning, memory safety, built-in MCP support, and smaller binary size compared to its TypeScript predecessor. Developers can run it via npx or global npm install, and it supports remote repository packing without cloning.", "body_md": "This is the official recommended usage guide for repomix-rs— repomix-rs is a high-performance Rust rewriting of the original Repomix (TypeScript), fully compatible with the original usage pattern, and Faster, Safer, and better suited for AI Agent scenarios.\n\nrepomix-rs is a tool that packages an entire codebase into a single, AI-friendly file. It works seamlessly with all major LLM application scenarios including Hermes Agent, Claude, ChatGPT, and Gemini. Through repomix-rs, your codebase is presented to AI in a structured, token-controllable format, enabling AI to perform code reviews, documentation generation, and vulnerability audits more accurately.\n\nCompared to the original Repomix, repomix-rs rewrites all core logic in Rust, bringing a qualitative leap in performance, security, and embedding capabilities.\n\n| Feature | repomix-rs (Rust) | Original Repomix (TypeScript) |\n|---|---|---|\n| Core Language | Rust | TypeScript |\n| Runtime Speed |\nMillisecond-level (parallel file scanning) |\nSecond-level (single-threaded Node.js) |\n| Memory Safety | Compile-time guaranteed | Runtime checking |\n| Built-in MCP Support | ✅ Official MCP Server included | ❌ Additional configuration required |\n| Secretlint Integration | ✅ | ✅ |\n| Tree-sitter | ✅ 10 languages | ✅ 10 languages |\n| Token Counting | tiktoken-rs (`o200k_base` ) |\ntiktoken (JS) |\n| Remote Repository Packing | ✅ git clone + cleanup | ✅ |\n| Parallel Processing | rayon + tokio | No parallelism |\n\nHave you noticed a trend? **More and more developer ecosystem infrastructure is moving from TypeScript/Node.js to Rust.** This is no accident — Rust's language characteristics are a perfect match for the demands of the AI era:\n\n[Rust-based high-performance runtime Bun](https://blog.csdn.net/weixin_45541665/article/details/161105498) uses Rust to rewrite the JavaScript engine, delivering:\n\nBun's success proves the **feasibility of Rust as a JS engine底层**, and repomix-rs leverages Rust's high-performance characteristics to achieve a repomix rewrite.\n\n[How Vite ditched Webpack and used Rust to refactor frontend builds](https://zhuanlan.zhihu.com/p/2017213814882463972) Webpack was the ruler of frontend builds, but it suffered from:\n\nThe Vue.js team decided to ditch Webpack and rewrite Vite in Rust:\n\nVite's success proves that **Rust is the core choice for the next generation of frontend build engines**.\n\nOpen your terminal, navigate to the project root directory, and execute any of the following:\n\n```\n# Method 1: Run with npx (no global installation needed)\nnpx repomix-rs .\n\n# Method 2: Install globally then run directly\nnpm install -g repomix-rs\nrepomix .\n\n# After the terminal outputs a result, send it to Hermes with: \"Please read this first\"\n```\n\nAfter execution, an output file (default `repomix-output.xml`\n\n) will be generated in the current directory. Drag that file into the Hermes Agent chat window and send the message: **\"Please read this project structure file first\"**.\n\n💡\n\nWhy repomix-rs?In AI Agent scenarios like Hermes Agent, we recommend the Rust version repomix-rs over the TypeScript original:\n\nSmaller image size: Rust binary ~15MB vs Node.js runtime 50+MBFaster startup: Rust ~0.05s vs Node.js ~200msSmaller memory footprint: Rust ~50MB vs Node.js ~150MBBetter native MCP support: repomix-rs includes a built-in MCP Server\n\nThis is a technology choice problem— The success of Bun and Vite has already proven:\n\nIn the AI era, Rust is the better infrastructure choice.\n\nNo cloning required — one command to pack a remote GitHub repository:\n\n```\nnpx repomix-rs --remote https://github.com/username/project-name\n```\n\nSpecify a branch (safer):\n\n```\nnpx repomix-rs --remote https://github.com/username/project-name --branch main\n```\n\nrepomix-rs's remote packing is based on the system\n\n`git`\n\ncommand. The first run pulls the full repository snapshot.\n\nIf git is unavailable, this step is skipped with a warning and the main process continues uninterrupted.\n\nCreate a `.repomixrc`\n\nconfiguration file:\n\n```\n{\n  \"include\": [\"src/**/*\", \"tests/**/*\", \"pyproject.toml\", \"README.md\"],\n  \"exclude\": [\"**/*.log\", \"**/dist/**\", \"**/.git/**\", \"node_modules/**\"]\n}\n```\n\nEnable compression (extracts function signatures, compression ratio up to 50%-90%):\n\n```\nnpx repomix-rs --compress --remove-comments --remove-empty-lines .\n```\n\nInclude only specific language files and ignore test directories:\n\n```\nnpx repomix-rs --include \"*.rs,*.toml,Cargo.*\" --ignore \"target/**,tests/**\" .\n```\n\nrepomix-rs supports four output formats, switchable via the `--style`\n\nparameter:\n\n```\nnpx repomix-rs --style markdown --output output.md .\nnpx repomix-rs --style json --output output.json .\nnpx repomix-rs --style plain --output output.txt .\n```\n\nHermes Agent does not automatically scan attachment content — it must be triggered manually. The correct process is:\n\n`npx repomix-rs .`\n\nto generate the packed file`repomix-output.xml`\n\n(or `.md`\n\n/ `.txt`\n\n) into the Hermes Agent chat windowNote: Hermes only supports\n\n`.md`\n\n/`.xml`\n\n/`.txt`\n\nplain text files.\n\nIf you accidentally send a compressed archive or binary file, the AI side will not be able to parse it.\n\nrepomix-rs includes a built-in MCP Server that can be directly embedded into any AI Agent supporting the Model Context Protocol (including Hermes Agent, Cursor, and Claude Desktop):\n\n```\nrepomix --mcp\n```\n\nAfter startup, the following MCP tools are exposed:\n\n| Tool Name | Purpose |\n|---|---|\n`pack_codebase` |\nPack a local codebase directory |\n`pack_remote_repository` |\nFetch and pack a remote Git repository |\n`read_repomix_output` |\nRead a previously generated repomix output file |\n`grep_repomix_output` |\nSearch content within the output file |\n\nEdit `~/Library/Application Support/Claude/claude_desktop_config.json`\n\n:\n\n```\n{\n  \"mcpServers\": {\n    \"repomix\": {\n      \"command\": \"repomix\",\n      \"args\": [\"--mcp\"]\n    }\n  }\n}\n```\n\nGo to Settings → MCP → Add new global MCP server:\n\n```\nCommand: repomix\nArgs: --mcp\n```\n\n| Scenario | Original Repomix (Node.js) | repomix-rs (Rust) | Speedup |\n|---|---|---|---|\n| Small-to-medium projects (< 500 files) | ~3-8 seconds | ~0.3-0.8 seconds | 5-10× |\n| Medium projects (500-5,000 files) | ~30-120 seconds | ~2-8 seconds | 15-40× |\n| Large projects (5,000+ files) | Risk of OOM | Stable completion | Unbounded |\n| Remote repository packing | Slow (Node.js clone) | Extremely fast (git + rayon) | 10-20× |\n\n`repomix --mcp`\n\ndirectly integrates with Hermes, Claude, Cursor, and more with no additional wrapper layer needed.`tiktoken-rs`\n\nuses OpenAI's official `o200k_base`\n\nencoding, consistent with GPT-4o, with far less counting bias than the JS version.**Q: What's the difference between npx repomix-rs and npx repomix?**\n\nA: `npx repomix-rs`\n\ninvokes repomix-rs (Rust implementation), which is faster and more stable; `npx repomix`\n\ninvokes the original TypeScript implementation. Their command-line parameters are largely compatible.\n\n**Q: Can repomix-rs handle my Node.js project?**\n\nA: Absolutely — it is language-agnostic. repomix-rs identifies file types through file extensions and glob rules.\n\n**Q: How do I verify that exclude rules are working?**\n\nA: After generating the output, run a grep check: `grep -i \"secrets\\|password\\|API_KEY\" repomix-output.xml`\n\n. If sensitive words appear, check whether your glob rules are correct (e.g., `**/.env`\n\n, not `.env`\n\n).\n\n**Q: Does repomix-rs support Windows?**\n\nA: Yes, Windows x64 precompiled binaries have been released. The npm package also covers Linux/macOS/Windows.\n\n👉 [https://github.com/sopaco/repomix-rs](https://github.com/sopaco/repomix-rs)\n\n*This guide is adapted from the original Hermes Agent Repomix usage guide, with all content migrated to repomix-rs.*\n\n*repomix-rs project: https://github.com/sopaco/repomix-rs*\n\n`repomix-rs`\n\n, CLI command: `repomix`\n\n", "url": "https://wpnews.pro/news/hermes-agent-codebase-packing-tool-usage-guide-repomix-rs-high-performance", "canonical_source": "https://dev.to/sopaco/hermes-agent-codebase-packing-tool-usage-guide-repomix-rs-high-performance-edition-3hko", "published_at": "2026-06-22 01:59:35+00:00", "updated_at": "2026-06-22 02:09:22.883973+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models", "ai-agents", "ai-infrastructure", "ai-tools"], "entities": ["repomix-rs", "Repomix", "Hermes Agent", "Claude", "ChatGPT", "Gemini", "Bun", "Vite"], "alternates": {"html": "https://wpnews.pro/news/hermes-agent-codebase-packing-tool-usage-guide-repomix-rs-high-performance", "markdown": "https://wpnews.pro/news/hermes-agent-codebase-packing-tool-usage-guide-repomix-rs-high-performance.md", "text": "https://wpnews.pro/news/hermes-agent-codebase-packing-tool-usage-guide-repomix-rs-high-performance.txt", "jsonld": "https://wpnews.pro/news/hermes-agent-codebase-packing-tool-usage-guide-repomix-rs-high-performance.jsonld"}}