# Repomix

Pack and analyze codebases into AI-friendly single files using Repomix.

- Repository: https://github.com/yamadashy/repomix (29110 stars)
- Category: Git and review
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add yamadashy/repomix --skill repomix -g -a claude-code -y`
Codex: `npx skills add yamadashy/repomix --skill repomix -g -a codex -y`
Cursor: `npx skills add yamadashy/repomix --skill repomix -g -a cursor -y`
Gemini CLI: `npx skills add yamadashy/repomix --skill repomix -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add yamadashy/repomix`

## Description

Pack and analyze codebases into AI-friendly single files using Repomix. Use when the user wants to explore repositories, analyze code structure, find patterns, check token counts, or prepare codebase context for AI analysis. Supports both local directories and remote GitHub repositories.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Repomix, Codebase Packer & Analyzer

Pack entire codebases into a single, AI-friendly file for analysis. Repomix intelligently collects repository files, respects `.gitignore`, runs security checks, and generates structured output optimized for LLM consumption.

## When to Use

- "Analyze this repo" / "Explore this codebase"
- "What's the structure of facebook/react?"
- "Find all authentication-related code"
- "How many tokens is this project?"
- "Pack this repo for AI analysis"
- "Show me the main components of vercel/next.js"

## Quick Reference

### Pack a Remote Repository

```bash
npx repomix@latest --remote <owner/repo> --output /tmp/<repo-name>-analysis.xml
```

Always output to a temporary directory (`/tmp` on Unix, `%TEMP%` on Windows) for remote repositories to avoid polluting the user's working directory.

### Pack a Local Directory

```bash
npx repomix@latest [directory] --output /tmp/<name>-analysis.xml
```

### Key Options

| Option | Description |
|--------|-------------|
| `--style <format>` | Output format: `xml` (default, recommended), `markdown`, `plain`, `json` |
| `--compress` | Tree-sitter compression (~70% token reduction), use for large repos |
| `--include <patterns>` | Include only matching patterns (e.g., `"src/**/*.ts,**/*.md"`) |
| `--ignore <patterns>` | Additional ignore patterns |
| `--output <path>` | Custom output path (default: `repomix-output.xml`) |
| `--remote-branch <name>` | Specific branch, tag, or commit (for remote repos) |

## Workflow

### Step 1: Pack the Repository

Choose the appropriate command based on the target:

```bash
# Remote repository (always output to /tmp)
npx repomix@latest --remote yamadashy/repomix --output /tmp/repomix-analysis.xml

# Large remote repo with compression
npx repomix@latest --remote facebook/react --compress --output /tmp/react-analysis.xml

# Local directory
npx repomix@latest ./src --output /tmp/src-analysis.xml

The rest: https://github.com/yamadashy/repomix/blob/HEAD/.agents/clawhub/SKILL.md
