Repomix is a powerful tool that packages your codebase into a single AI-friendly file, making it easier to feed your code to Large Language Models like Claude, ChatGPT, or other AI assistants. This formatted output helps AI tools better understand and analyze your code structure.
You can use Repomix without installation using npx:
npx repomix@latest
Or install it globally for repeated use:
# Using npm
npm install -g repomix
# Using yarn
yarn global add repomix
# Using bun
bun add -g repomix
# Using Homebrew (macOS/Linux)
brew install repomix
Run Repomix in your project directory to generate an AI-friendly file:
repomix
This creates a repomix-output.xml
file containing your entire repository in an AI-friendly format.
You can target specific files or directories using glob patterns:
# Process specific directory
repomix path/to/directory
# Include only certain file types
repomix --include "src/**/*.ts,**/*.md"
# Exclude specific files
repomix --ignore "**/*.log,tmp/"
Analyze a GitHub repository without cloning it manually:
# Using full URL
repomix --remote https://github.com/yamadashy/repomix
# Using GitHub shorthand
repomix --remote yamadashy/repomix
# Specify branch or commit
repomix --remote yamadashy/repomix --remote-branch main
Optimize your output with various options:
# Compress output (reduce token count)
repomix --compress
# Change output format
repomix --style markdown
# Add git logs for context
repomix --include-logs
# Show token count breakdown
repomix --token-count-tree
You can also run Repomix in a Docker container:
# Process current directory
docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix
# Process remote repository
docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote yamadashy/repomix
For a graphical interface, visit repomix.com.
Browser extensions are also available:
Create a configuration file to customize Repomix:
repomix --init
This generates a repomix.config.json
file with options for controlling:
After generating your packed file, you can upload it to AI assistants with prompts like:
This file contains all the files in the repository combined into one.
Please review the code structure and suggest improvements.
Example AI tasks:
Repomix supports the Model Context Protocol (MCP), allowing AI assistants to directly interact with your codebase:
repomix --mcp
To configure Repomix as an MCP server in VS Code, use:
code --add-mcp '{"name":"repomix","command":"npx","args":["-y","repomix","--mcp"]}'
This allows AI assistants to package your code without manual file preparation.
Repomix includes built-in security checks to prevent sensitive information from being included in the output:
# Run with security checks (default)
repomix
# Disable security checks (use with caution)
repomix --no-security-check
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "repomix" '{"command":"npx","args":["-y","repomix","--mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"repomix": {
"command": "npx",
"args": [
"-y",
"repomix",
"--mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"repomix": {
"command": "npx",
"args": [
"-y",
"repomix",
"--mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect