repomix
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.
Best use case
repomix is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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.
Teams using repomix should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/clawhub/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How repomix Compares
| Feature / Agent | repomix | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for ChatGPT
Find the best AI skills to adapt into ChatGPT workflows for research, writing, summarization, planning, and repeatable assistant tasks.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
SKILL.md Source
# 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
# Specific file types only
npx repomix@latest --include "**/*.{ts,tsx,js,jsx}" --output /tmp/filtered-analysis.xml
```
### Step 2: Check Command Output
The command displays:
- **Files processed**: Number of files included
- **Total characters**: Size of content
- **Total tokens**: Estimated AI tokens
- **Output file location**: Where the file was saved
Note the output file location for subsequent analysis.
### Step 3: Analyze the Output
**Structure overview:**
1. Search for the file tree section (near the beginning of the output)
2. Check the metrics summary for overall statistics
**Search for patterns** (use the output file path from Step 2):
```bash
# Find exports and main entry points
grep -iE "export.*function|export.*class" <output-file>
# Search with context
grep -iE -A 5 -B 5 "authentication|auth" <output-file>
# Find API endpoints
grep -iE "router|route|endpoint|api" <output-file>
# Find database models
grep -iE "model|schema|database|query" <output-file>
```
**Read specific sections** using offset/limit for large outputs.
### Step 4: Report Findings
- **Metrics**: Files, tokens, size from command output
- **Structure**: Directory layout from file tree analysis
- **Key findings**: Based on pattern search results
- **Next steps**: Suggestions for deeper exploration
## Best Practices
1. **Use `--compress` for large repos** (>100k lines) to reduce token usage by ~70%
2. **Use pattern search first** before reading entire output files
3. **Use a temporary directory for output** (`/tmp` on Unix, `%TEMP%` on Windows) to keep the user's workspace clean
4. **Use `--include` to focus** on specific parts of a codebase
5. **XML is the default and recommended format** — it has clear file boundaries for structured analysis
## Output Formats
| Format | Best For |
|--------|----------|
| XML (default) | Structured analysis, clear file boundaries |
| Markdown | Human-readable documentation |
| Plain | Simple grep-friendly output |
| JSON | Programmatic/machine analysis |
## Error Handling
- **Command fails**: Check error message, verify repository URL/path, check permissions
- **Output too large**: Use `--compress`, narrow scope with `--include`
- **Network issues** (remote): Verify connection, suggest local clone as alternative
- **Pattern not found**: Try alternative patterns, check file tree to verify files exist
## Security
Repomix automatically excludes potentially sensitive files (API keys, credentials, `.env` files) through built-in security checks. Trust its security defaults unless the user explicitly requests otherwise.Related Skills
repomix-explorer
Use this skill when the user wants to analyze or explore a codebase (remote repository or local repository) using Repomix. Triggers on: 'analyze this repo', 'explore codebase', 'what's the structure', 'find patterns in repo', 'how many files/tokens'. Runs repomix CLI to pack repositories, then analyzes the output.
website-maintainer
Use this skill when working on the Repomix documentation website in `website/` directory, including VitePress configuration, multi-language content, or translation workflows.
browser-extension-developer
Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.
contextual-commit
Write contextual commits that capture intent, decisions, and constraints alongside code changes. Use when committing code, finishing a task, or when the user asks to commit. Extends Conventional Commits with structured action lines in the commit body that preserve WHY code was written, not just WHAT changed.
agent-memory
Use this skill when the user asks to save, remember, recall, or organize memories. Triggers on: 'remember this', 'save this', 'note this', 'what did we discuss about...', 'check your notes', 'clean up memories'. Also use proactively when discovering valuable findings worth preserving.
compose-multiplatform-patterns
KMP项目中的Compose Multiplatform和Jetpack Compose模式——状态管理、导航、主题化、性能优化和平台特定UI。
java-coding-standards
Spring Bootサービス向けのJavaコーディング標準:命名、不変性、Optional使用、ストリーム、例外、ジェネリクス、プロジェクトレイアウト。
continuous-learning
Claude Codeセッションから再利用可能なパターンを自動的に抽出し、将来の使用のために学習済みスキルとして保存します。
nextjs-best-practices
Next.js App Router principles. Server Components, data fetching, routing patterns.
network-101
Configure and test common network services (HTTP, HTTPS, SNMP, SMB) for penetration testing lab environments. Enable hands-on practice with service enumeration, log analysis, and security testing against properly configured target systems.
neon-postgres
Expert patterns for Neon serverless Postgres, branching, connection pooling, and Prisma/Drizzle integration
nanobanana-ppt-skills
AI-powered PPT generation with document analysis and styled images