Repomix vs mcp-injector

An honest, feature-by-feature architectural comparison for developers evaluating codebase context tools.

Both Repomix and mcp-injector help developers send their local codebase context to Large Language Models (LLMs) like Claude. However, they approach this problem with entirely different philosophies. Repomix is a simple, one-shot packaging CLI. mcp-injector is a persistent, branch-aware daemon running locally to compress and stream files on-demand via the Model Context Protocol (MCP).

Feature / Aspect mcp-injector Repomix
Integration Model ✅ Native MCP Server
Integrates directly as a tool in Claude Desktop, Cursor, and VS Code. IDE queries it dynamically.
❌ Static File Exporter
Generates a single output file (e.g. repomix-output.txt) that you manually attach or paste into chat.
File Watching ✅ Real-time & Incremental
Daemon watches files (inotify/FSEvents). Instantly indexes changes so the LLM gets current files.
❌ Manual Re-run
You must run the CLI again manually every time you change code to re-bundle the file.
Git Branch Awareness ✅ Automatic on Checkout
Installs a git post-checkout hook. Automatically re-indexes the workspace on branch switch.
❌ None
Branch switching does not affect output unless CLI is manually run again.
Token Compression ✅ AST Body Folding (66-79% reduction)
Folds function/method bodies. Claude sees the signatures/exports first, saving massive token counts.
❌ Plain Text Packing
Aggregates whole files as-is. Performs basic minification/comment stripping but no structural compression.
Prompt Caching (KV) ✅ 100% Deterministic (High cache hit)
Files sorted alphabetically, timestamps/volatile metadata stripped. Maximum KV prompt cache hits.
⚠️ Partial
Orders files deterministically but output fluctuates easily, leading to frequent cache misses.
On-Demand Detail Retrieval ✅ Native CCR (Compress-Cache-Retrieve)
Claude can dynamically fetch full uncompressed file bodies on-demand via the injector_retrieve tool.
❌ All or Nothing
Either the entire file is fully in the prompt context or it is not included at all.
Secret Redaction ✅ Always-On Local Filter
встроенный Shannon entropy filter. Dynamic credential redaction (API keys, JWTs) happens locally.
❌ None
Relies entirely on manual file exclusions to prevent credential leakage.
Licensing & Source ❌ Proprietary Binary
Commercial license. Free tier under 100K lines. Pro tier: $12/month. Source code closed.
✅ Open Source (MIT)
Fully free and open source. Available on npm. Community-driven.
Supported Languages ⚠️ 7 Languages (AST analysis)
Go, Python, TypeScript, JavaScript, Java, C++, Rust.
✅ 30+ Languages
Plaintext packaging supports any file extension.

When to use Repomix

Repomix is an excellent, lightweight CLI utility for one-off tasks. If you want to bundle a small codebase or folder into a single file to copy/paste into a web UI (like Claude.ai web interface, ChatGPT, or Gemini Advanced) for a quick review, Repomix is the right tool. It is open source, free, and works instantly without running daemons.

When to use mcp-injector

mcp-injector is designed for developers who write code inside IDEs (Cursor, VS Code, Claude Code) for hours every day. Because it integrates natively via the Model Context Protocol, the LLM retrieves codebase structure on-demand during active chat. By folding code bodies structurally and ensuring strict byte-by-byte outputs, it leverages Claude's prompt caching to save significant money on API bills while keeping response times fast.

Summary Comparison

Think of Repomix as a manual "zip file exporter" optimized for the web chat UI. Think of mcp-injector as a high-performance local context daemon optimized for professional IDE AI assistant workflows.