Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问clear审计提醒

repomixrepomix 工具

Agent Skill

repomix 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,077

周安装

44

GitHub Stars

61

下载量

345
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:repomix(repomix 工具)
来源仓库:https://github.com/julianobarbosa/claude-code-skills
仓库路径:skills/repomix
安装命令:
npx skills add https://github.com/julianobarbosa/claude-code-skills --skill repomix
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/julianobarbosa/claude-code-skills --skill repomix

简介

repomix 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于根据关键词或任务场景进行信息检索,帮助 Agent 聚焦相关内容。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用该技能。
  • 安装前需确认权限范围、维护状态,避免触发联网或文件读写操作。
  • repomix 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Repomix - Codebase Packing for AI

Pack your entire repository into a single, AI-friendly file optimized for LLMs like Claude, ChatGPT, Gemini, and more.

When to Use This Skill

  • Feeding codebase to AI for analysis or refactoring
  • Generating comprehensive code reviews
  • Creating documentation from code
  • Preparing context for AI-assisted development
  • Analyzing remote repositories without cloning
  • Token counting for LLM context limits

Quick Start

# Pack current directory (no install required)
npx repomix@latest

# Pack specific directory
npx repomix path/to/directory

# Pack with compression (~70% token reduction)
npx repomix --compress

# Copy output to clipboard
npx repomix --copy

Default output: ./repomix-output.xml in current directory

Examples

Example: Prepare codebase for Claude review

User: "Pack my src folder for Claude to review the architecture"
→ npx repomix --include "src/**/*" --style xml --copy
→ Output copied to clipboard, ready to paste into Claude

Example: Analyze remote repo without cloning

User: "I want to understand how shadcn/ui implements its button"
→ npx repomix --remote shadcn-ui/ui --include "**/button/**/*" --compress
→ Generates focused output of button component

Example: Prepare PR diff for review

User: "Pack only the files I changed for a code review"
→ git diff --name-only main | npx repomix --stdin --compress
→ Packs only modified files with compression

Example: Check token usage before sending to AI

User: "Is my codebase too large for GPT-4?"
→ npx repomix --token-count-tree
→ Shows token breakdown per file/directory

Example: Generate skills reference from library

User: "Create a Claude skill from the zod repository"
→ npx repomix --remote colinhacks/zod --skill-generate zod-reference
→ Generates AI-optimized reference documentation

Output Formats

# XML (default) - best for Claude
npx repomix --style xml

# Markdown - human readable
npx repomix --style markdown

# JSON - programmatic processing
npx repomix --style json

# Plain text
npx repomix --style plain

Token Optimization

LLM Context Limits Reference

ModelContext WindowTypical Repo Fit
Claude 3.5/Opus200K tokensLarge monorepos
GPT-4 Turbo/4o128K tokensMedium projects
Gemini 1.5 Pro1M tokensVery large codebases
Gemini 1.5 Flash1M tokensVery large codebases

Token Analysis

# Show token count tree
npx repomix --token-count-tree

# Filter by minimum tokens (show files with 1000+ tokens)
npx repomix --token-count-tree 1000

# Split output for large codebases
npx repomix --split-output 1mb

File Selection

Include Patterns

# Include only TypeScript files
npx repomix --include "**/*.ts"

# Include multiple patterns
npx repomix --include "src/**/*.ts,**/*.md"

# Include specific directories
npx repomix --include "src/**/*,tests/**/*"

Ignore Patterns

# Ignore test files
npx repomix --ignore "**/*.test.ts"

# Ignore multiple patterns
npx repomix --ignore "**/*.log,tmp/,dist/"

# Combine include and ignore
npx repomix --include "src/**/*.ts" --ignore "**/*.test.ts"

Stdin Input

# From find command
find src -name "*.ts" -type f | npx repomix --stdin

# From git tracked files
git ls-files "*.ts" | npx repomix --stdin

# Interactive selection with fzf
find . -name "*.ts" -type f | fzf -m | npx repomix --stdin

# From ripgrep
rg --files --type ts | npx repomix --stdin

Common Workflows

PR Review Preparation

# Pack only changed files for review
git diff --name-only main | npx repomix --stdin --compress

# Pack with diff context included
npx repomix --include-diffs --compress

Architecture Analysis

# Pack structure without implementation details
npx repomix --compress --include "src/**/*" --ignore "**/*.test.*"

# Focus on specific layer
npx repomix --include "src/api/**/*,src/services/**/*" --compress

Documentation Generation

# Pack with full context for docs
npx repomix --include "src/**/*,**/*.md" --style markdown

# Include git history for changelog
npx repomix --include-logs --include-logs-count 50

Dependency Analysis

# Pack only config and dependency files
npx repomix --include "package.json,tsconfig.json,**/*.config.*"

Remote Repositories

# Pack remote repository
npx repomix --remote https://github.com/user/repo

# GitHub shorthand
npx repomix --remote user/repo

# Specific branch
npx repomix --remote user/repo --remote-branch main

# Specific commit
npx repomix --remote user/repo --remote-branch 935b695

# Branch URL format
npx repomix --remote https://github.com/user/repo/tree/feature-branch

Code Compression

Tree-sitter powered compression extracts signatures while removing implementation details.

Supported Languages

Tree-sitter compression works with: JavaScript, TypeScript, Python, Ruby, Go, Rust, Java, C, C++, C#, PHP, Swift, Kotlin, and more.

Usage

npx repomix --compress

# Combine with remote
npx repomix --remote user/repo --compress

Before compression:

const calculateTotal = (items: Item[]) => {
  let total = 0;
  for (const item of items) {
    total += item.price * item.quantity;
  }
  return total;
};

After compression:

const calculateTotal = (items: Item[]) => { /* ... */ };

Git Integration

# Include git logs (last 50 commits)
npx repomix --include-logs

# Specify commit count
npx repomix --include-logs --include-logs-count 20

# Include git diffs
npx repomix --include-diffs

# Combine logs and diffs
npx repomix --include-logs --include-diffs

Configuration

Initialize Config

# Create repomix.config.json
npx repomix --init

# Global config
npx repomix --init --global

Configuration File

{
  "$schema": "https://repomix.com/schemas/latest/schema.json",
  "output": {
    "filePath": "repomix-output.xml",
    "style": "xml",
    "compress": false,
    "removeComments": false,
    "showLineNumbers": false,
    "copyToClipboard": false
  },
  "include": ["src/**/*", "**/*.md"],
  "ignore": {
    "useGitignore": true,
    "useDefaultPatterns": true,
    "customPatterns": ["**/*.test.ts", "dist/"]
  },
  "security": {
    "enableSecurityCheck": true
  }
}

Docker Usage

# Pack current directory
docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix

# Pack specific directory
docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix path/to/directory

# Remote repository
docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote user/repo

MCP Server Integration

Run as Model Context Protocol server for AI assistants:

npx repomix --mcp

Configure for Claude Code

claude mcp add repomix -- npx -y repomix --mcp

Available MCP Tools

When running as MCP server, provides:

ToolDescription
pack_codebasePack local directory into AI-friendly format
pack_remote_repositoryPack GitHub repository without cloning
read_repomix_outputRead contents of generated output file
file_system_treeGet directory tree structure

Claude Agent Skills Generation

Generate skills format output for Claude:

# Generate skills from local directory
npx repomix --skill-generate

# Generate with custom name
npx repomix --skill-generate my-project-reference

# From remote repository
npx repomix --remote user/repo --skill-generate

CLI Options Reference

OptionDescription
-o, --output <file>Output file path
--style <style>Output format: xml, markdown, json, plain
--compressEnable Tree-sitter compression
--include <patterns>Include files matching glob patterns
-i, --ignore <patterns>Exclude files matching patterns
--remote <url>Process remote repository
--remote-branch <name>Branch, tag, or commit for remote
--stdinRead file paths from stdin
--copyCopy output to clipboard
--token-count-treeShow token counts per file
--split-output <size>Split output by size (e.g., 1mb)
--include-logsInclude git commit history
--include-diffsInclude git diffs
--no-security-checkSkip sensitive data detection
--mcpRun as MCP server
--skill-generateGenerate Claude skills format
--initCreate configuration file
--helpShow all available options

Troubleshooting

IssueSolution
Output too large for LLMUse --compress or filter with --include
Missing expected filesCheck .repomixignore, .gitignore, and ignore patterns
Secrets detected (blocking)Review flagged files; use --no-security-check if false positive
Memory issues on large reposUse --split-output 1mb to chunk output
Remote repo access deniedCheck URL format; ensure repo is public or use SSH
Compression not workingVerify language is supported by Tree-sitter
Output not in clipboardEnsure clipboard access; try `--output - \pbcopy` on macOS

Ignore Files

Repomix respects multiple ignore sources (priority order):

  1. ignore.customPatterns in config
  2. .repomixignore (Repomix-specific)
  3. .ignore (ripgrep compatible)
  4. .gitignore
  5. Default patterns (node_modules,.git, etc.)

Security

Repomix includes Secretlint for detecting sensitive information:

# Security check enabled by default
npx repomix

# Disable security check (use with caution)
npx repomix --no-security-check

Detected secret types: API keys, tokens, passwords, private keys, AWS credentials, database connection strings, and more.

Best Practices

  1. Use compression for large codebases to reduce token count (~70% reduction)
  2. Filter with --include to focus on relevant files
  3. Use --token-count-tree to identify large files before packing
  4. Split output when hitting AI context limits
  5. Include git logs for evolution context when needed
  6. Use XML style for Claude (optimized for XML tags)
  7. Use Markdown for human-readable output or other LLMs
  8. Check token counts against your target LLM's context window
  9. Review security warnings before sharing packed output

Requirements

  • Node.js 18.0.0 or higher
  • npm or npx available in PATH

Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.12%
按下载量换算97

OpenCode

23.99%
按下载量换算83

Codex

15.32%
按下载量换算53

Gemini CLI

12.12%
按下载量换算42

Antigravity

7.88%
按下载量换算27

Cursor

3.33%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills