Model or dataset
yamadashy/repomix avatar
yamadashy/repomix

Repomix: Pack Your Repository into a Single AI-Ready File

📦 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.

28,580 stars1,547 forksTypeScriptMIT

At a glance

What is it?
Repomix is a TypeScript CLI tool that serializes an entire code repository into one XML, Markdown, or plain-text file for feeding to LLMs. It respects .gitignore, counts tokens per file, and runs a credential scanner before writing output, making it practical for sharing real codebases with AI assistants.
Who is it for?
Repomix is the right tool when you need to give an LLM the full context of a codebase in a single pass. Its token counting helps you stay within context limits, and Secretlint catches credentials before they leave your machine.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Problem Repomix Solves

When working with an AI coding assistant, sharing individual files is enough for small, isolated tasks. Refactoring a multi-file module, understanding a dependency graph, or asking for an architectural review requires more context than any single file provides. Repomix solves this by walking the repository tree and combining every relevant file into a single document.

The target user is a developer who wants to ask an LLM a question that spans the entire codebase. Repomix produces output in XML (the default), Markdown, or plain text. Each format includes file headers that tell the LLM where each section begins and ends, giving models a structured way to reference individual files by path without the human manually copying and pasting.

The tool is MIT licensed and published as the npm package `repomix` at version 1.18.1.

How Repomix Processes a Repository

Repomix reads three ignore file types before collecting files: `.gitignore`, `.ignore`, and `.repomixignore`. This means whatever your version control system already excludes, Repomix excludes too. A `.repomixignore` file in the repository root provides project-specific exclusions without modifying `.gitignore`.

After file collection, Repomix counts tokens for each file and for the complete output. This count is included in the generated document so the model or the user can see which files are largest.

Credential detection runs via Secretlint before the output is written. Secretlint checks files against known credential patterns, including API keys and private keys in common formats, and omits any matching files from the output. This is a safety net, not a complete audit: it catches files whose contents match Secretlint's built-in rules.

The `--compress` option activates a Tree-sitter-based code compression pass that strips non-essential syntax while preserving structure, reducing token count for the final output.

Installing Repomix and Packing a First Repository

The fastest way to use Repomix without a permanent install is to run it directly with npx:

bash
npx repomix@latest

For repeated use, install it globally:

bash
npm install -g repomix

On macOS or Linux, Homebrew is also supported:

bash
brew install repomix

Running `repomix` in any project directory generates `repomix-output.xml` in the current directory. To pack a specific subdirectory:

bash
repomix path/to/directory

To include only certain file patterns:

bash
repomix --include "src/**/*.ts,**/*.md"

To exclude patterns:

bash
repomix --ignore "**/*.log,tmp/"

Remote repositories can be packed without cloning:

bash
repomix --remote yamadashy/repomix

The output file can then be attached to a prompt, dragged into a chat interface, or referenced by an AI assistant that accepts file uploads.

Output Formats and Token Counting

Repomix produces three output formats. XML is the default and wraps each file in tagged elements that models can parse structurally. Markdown format produces a document with fenced code blocks for each file. Plain text uses a simple delimiter format with no markup.

Token counts appear at two levels: per individual file, and for the entire repository. This matters because LLMs have fixed context windows, and knowing which files consume the most tokens helps prioritize what to include. The `--compress` flag uses Tree-sitter to reduce token count by extracting key code constructs while removing boilerplate.

The website at repomix.com provides a browser-based interface that shows the token count estimate before you download the output. A Chrome extension and a Firefox add-on add a one-click Repomix button to GitHub repository pages, generating output directly from the browser.

Where Repomix Falls Short

Repomix has no retrieval layer. It serializes everything into one document, which works as long as the output fits within a model's context window. For very large repositories, even with compression enabled, the output may exceed the limit. The tool provides no built-in way to split the output into chunks or to answer questions by retrieving only the relevant files.

Secretlint's coverage is limited to its built-in rule set. Proprietary secret formats, internal token patterns, or environment-specific credential structures may not be caught. The README positions it as a safety net rather than a security scanner, so teams should verify coverage against their specific credential formats before running Repomix in automated pipelines.

The tool also has no way to handle binary files meaningfully. They are excluded by default or replaced with a placeholder, so repositories that embed critical configuration in binary formats will miss that context.

Configuration for what to include, exclude, and how to format the output can be stored in a `repomix.config.json` file at the repository root, and the VSCode extension respects this file. The top-level of the Repomix repository itself contains both a `repomix.config.json` and a `repomix-instruction.md` file, which shows the intended pattern for teams that want reproducible output across invocations.

Repomix Versus Gitingest

The README explicitly mentions Gitingest as an alternative for Python and data science workflows. Gitingest is a Python-based tool that serves a similar purpose. The README suggests Gitingest is better suited for the Python ecosystem, implying that Repomix's first-class support is for JavaScript and TypeScript projects where its npm-native distribution is an advantage.

Repomix also provides MCP (Model Context Protocol) server support, listed in the README's feature set under `repomix mcp`. This allows it to be used as a tool-call target from agents that support MCP, extending its utility beyond one-shot file generation. Gitingest does not appear to have this integration.

For teams already in a Node.js environment, Repomix's npx invocation requires no additional setup. For Python-centric teams, particularly those in data science, the README's own guidance points toward Gitingest.

Editorial conclusion

Repomix is the right tool when you need to give an LLM the full context of a codebase in a single pass. Its token counting helps you stay within context limits, and Secretlint catches credentials before they leave your machine. It is the wrong choice for very large repositories where even a compressed XML output would exceed a model's context window, since there is no built-in chunking or retrieval layer. Before using it on a shared or CI machine, verify that the credential scanner covers the credential formats your team uses, since Secretlint's ruleset may not catch every proprietary secret format.

Frequently asked questions

What does Repomix do?

Repomix walks a repository tree and combines all relevant files into a single XML, Markdown, or plain-text document formatted for LLMs. It counts tokens per file, scans for credentials using Secretlint, and respects .gitignore and .repomixignore exclusions.

Is Repomix open source?

Yes. Repomix is MIT licensed and its source code is on GitHub at yamadashy/repomix. The npm package is also freely available.

How to use Repomix with Claude?

Run `npx repomix@latest` in your project directory to generate a repomix-output.xml file, then upload or paste that file into a Claude conversation along with your question about the codebase. The README notes that Claude's Artifacts feature can even output multiple files back, enabling multi-file code generation.

Is Repomix safe to use?

Repomix runs Secretlint before writing output to detect files matching known credential formats and exclude them. It processes everything locally and does not send repository contents to any external service. The Secretlint check is a safety net and does not cover every possible secret format.

How to install Repomix?

Run `npm install -g repomix` for a global install, `brew install repomix` on macOS or Linux via Homebrew, or `npx repomix@latest` to run it without installing. Chrome and Firefox browser extensions are also available for one-click use on GitHub repository pages.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/yamadashy-repomix.svg)](https://hysenlabs.com/projects/yamadashy-repomix)