Repomix is an open-source CLI tool that flattens an entire codebase — respecting .gitignore, optionally stripping comments, counting tokens — into one clean, structured file optimized for pasting into an LLM's context window. It supports Claude, ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok and more, and is popular for code review, refactoring, and documentation-generation workflows. MIT-licensed with 27,000+ GitHub stars.
Repomix is a command line tool that flattens an entire repository into one structured file designed to be pasted into a model's context window. It walks the project, respects your .gitignore so build output and dependencies do not end up in the payload, can strip comments to save space, and counts tokens so you know whether the result will actually fit before you try. The output keeps a directory tree and clear file boundaries, which is what lets a model reason about how the pieces relate rather than seeing a pile of loose code. It works with whichever model you prefer, including Claude, ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama and Grok, because the output is just text in a model-friendly layout. It is MIT licensed. The typical use is code review, refactoring planning and documentation generation, where the model needs the shape of the whole project rather than a single file.
Use it when the question you are asking spans files: how does this feature actually work, where would this change ripple, write documentation for this service, review this codebase for a pattern. Pasting individual files gets you answers that miss the connections. It is also handy for handing a model a small repository once, in a chat interface, instead of setting up an agent with filesystem access. Token counting matters here because it turns a guess into a check, and the ignore and comment-stripping options are how you get a large project under a limit. It is the wrong tool if your agent already reads the filesystem directly, and obviously wrong for repositories containing secrets you have not first removed.
MarkItDown solves the adjacent problem for documents rather than code, converting formats like office files and PDFs into clean Markdown a model can read, so the two often sit in the same preparation workflow. Crawl4AI does the same job for the web, crawling pages and returning model-ready text, which is what you want when the context you need lives on a site instead of in a repository. Claude Mem approaches context from the opposite direction, persisting memory across sessions so an agent retains what it learned rather than being re-fed the whole codebase each time. Repomix is the simplest of the group: one command, one file, no service to run.
Compare with: MarkItDown, Crawl4AI, Claude Mem
The catalog records Repomix as free. It is an MIT licensed open-source CLI, so there is no charge for the tool and nothing to sign up for. The cost it influences is your model bill, since a packed repository can be a very large prompt and most providers charge by token. That is precisely why the built-in token counting, ignore rules and comment stripping matter, and why prompt caching on your provider is worth enabling if you send the same packed codebase repeatedly. The permissive license means no obstacle to using it in commercial work.
No notes have been added for this tool yet.
No prompting tips have been added yet.
No reviews yet. Be the first!