Introduction
Repomix is a developer tool that packs your entire repository into a single, AI-optimized file. When you need to give an LLM full context of your codebase — for code review, architecture questions, or migration planning — Repomix creates a structured document that fits within context windows.
Key features:
- AI-Optimized Output — Structured formatting designed specifically for LLM comprehension (XML, Markdown, JSON, or plain text)
- Token Counting — Shows exact token count per file and total, so you know what fits in your context window
- Git-Aware — Respects
.gitignoreand supports custom include/exclude patterns - Security Scanning — Built-in Secretlint integration detects API keys, passwords, and secrets before you paste into an LLM
- Remote Repos — Pack any public GitHub repo without cloning:
npx repomix --remote user/repo - MCP Server — Also available as an MCP server for direct AI assistant integration
Works great as a preprocessing step before feeding code to Claude, GPT, or any LLM.
FAQ
Q: How large of a repo can it handle?
A: Repomix can process repos with thousands of files. Use --include and --exclude patterns to focus on relevant directories if the output exceeds your LLM's context window.
Q: What output format should I use?
A: XML format (--style xml) is recommended for Claude as it parses XML structure well. Markdown works great for readability.
Q: Does it leak secrets? A: Repomix includes built-in security scanning via Secretlint. It warns you if API keys, tokens, or passwords are detected in the output.
Q: Can I use it as an MCP server?
A: Yes. Add repomix as an MCP server in your config to let AI assistants pack repos on demand.
Works With
- Claude Code / Claude Desktop / ChatGPT / Any LLM
- npm / npx / Homebrew (
brew install repomix) - MCP-compatible AI assistants (via built-in MCP server)
- Any Git repository (local or remote)