Repomix
📦 Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more.
Last verified:
What is Repomix?
Repomix is a powerful open-source CLI tool that packages your entire codebase into a single AI-friendly file, making it easy to share your complete repository context with Large Language Models like ChatGPT, Claude, Gemini, Grok, DeepSeek, and Perplexity. It eliminates the need for manual file exploration by consolidating all files, metadata, and structure into a unified representation optimized for AI consumption.
Key features include multiple output formats (XML default, Markdown, JSON, plain text), support for packing remote GitHub repositories via the --remote flag,--include and --ignore patterns for selective packing, Tree-sitter-based code compression for ~70% token reduction, Secretlint integration for security checks, MCP server support for AI agents, Docker support, GitHub Actions integration, and token counting visualization with --token-count-tree. The CLI can access private repositories since it uses your locally installed git.
Repomix is designed for developers working on code reviews, refactoring assistance, bug investigation, implementation planning, documentation generation, third-party library security checks, architecture reviews, and onboarding. It's particularly valuable when you need to provide complete codebase context to AI tools without worrying about subscription costs, making analysis faster and often more accurate.
The tool runs on Node.js 22 or later and can be instantly tried with npx repomix@latest without installation, or installed globally via npm, yarn, bun, or Homebrew. It supports custom configuration through repomix.config.json for persistent settings including output style, comment removal, line numbers, and custom ignore patterns.
Repomix pricing
Pricing model: Freemium
Repomix is completely free and open source. There is no paid tier or subscription. The CLI tool can be used freely via npm install -g repomix, npx repomix@latest, yarn global add repomix, bun add -g repomix, or Homebrew (brew install repomix). Docker images are available at ghcr.io/yamadashy/repomix. The tool works with any AI subscription service (ChatGPT, Claude, Gemini, Grok) without additional Repomix costs - you only pay for your AI service subscription.
Repomix pros
- Open source and free to use
- Works with any AI subscription service (ChatGPT, Claude, Gemini, Grok) without extra costs
- CLI can access private repositories using local git
- Multiple output formats (XML, Markdown, JSON, plain text)
- Supports packing remote GitHub repositories without cloning
- Tree-sitter code compression reduces tokens by ~70%
- Built-in Secretlint security checks for sensitive data
- MCP server support for AI agents like Hermes Agent and OpenClaw
- Docker support for isolated environments
- GitHub Actions integration for CI/CD workflows
- Token count tree visualization with --token-count-tree
- Glob pattern support for selective file inclusion
- Customizable via repomix.config.json configuration file
- No installation needed with npx repomix@latest
- Supports all programming languages (Node.js runtime required)
- Can pack specific directories, git diffs, and commit logs
- Split output option for large repositories
- Custom instructions support for AI-specific guidance
Repomix cons
- Requires Node.js 22 or later runtime
- Tree-sitter compression support varies by programming language
- No fixed repository size limit but constrained by memory and AI tool limits
- Security checks are safety net only, manual review still required
- Ignore patterns may exclude expected files if .gitignore not understood
- Website/browser extension have different workflows than CLI
- Very large repositories may need output splitting
- --include still respects ignore rules which can be confusing
Frequently asked questions about Repomix
What is Repomix used for?
Repomix packs a repository into a single AI-friendly file so you can give an AI assistant broad codebase context without manually copying files. It is useful for code review, bug investigation, refactoring plans, onboarding, documentation, security analysis, and architecture reviews.
Does Repomix work with C#, Python, Java, Go, Rust, or other languages?
Yes. Repomix can pack repositories written in any programming language because it reads files from your project and formats them for AI tools. Repomix itself runs on Node.js, so you need Node.js 22 or later when using the CLI. Some advanced features, such as Tree-sitter code compression, depend on language parser support and may vary by language.
Does Repomix work with private repositories?
Yes. For private repositories, run Repomix locally in a checkout that your machine can already access using 'repomix'. Repomix uses your local filesystem and git configuration. Review the generated output before sharing it with any external AI service.
Can Repomix process a public GitHub repository without cloning it?
Yes. Use the --remote option with a full URL or owner/repo shorthand: 'npx repomix --remote yamadashy/repomix' or 'npx repomix --remote https://github.com/yamadashy/repomix'. You can also target a branch, tag, commit, or subdirectory from a supported GitHub URL.
Which output format should I choose?
Start with the default XML output if you are unsure. Use XML when you want strong structure for Claude or other models that parse tagged context well. Use Markdown when humans will read or edit the packed file. Use JSON when another program will consume the output. Use plain text when you need the simplest possible format.
What does --compress do?
--compress uses Tree-sitter-based code compression to keep important structure such as imports, exports, classes, functions, interfaces, and method signatures while removing implementation detail. It is useful when the model needs an architectural overview more than exact line-by-line code.
Does Repomix upload my code?
The Repomix CLI runs locally and writes an output file on your machine. The website and browser extension have different workflows, so check Privacy Policy when using hosted or browser-based features.
How does Repomix avoid including secrets?
Repomix includes Secretlint-based safety checks to detect sensitive values before packing. Treat this as a safety net, not a replacement for reviewing the output yourself. Always inspect generated files before sending private code to an AI provider.
Why are files missing from the output?
Repomix respects ignore rules such as .gitignore, default ignore patterns, and custom patterns from your configuration. Check your repomix.config.json, CLI --ignore options, and whether the files are ignored by git.