t1k:repomix
| Field | Value |
|---|---|
| Module | t1k-maintainer |
| Version | 2.18.3 |
| Effort | medium |
| Tools | — |
Keywords: codebase, llm-context, pack, repomix, snapshot
How to invoke
Section titled “How to invoke”/t1k:repomix[path] [--format xml|md|txt]Repomix Skill
Section titled “Repomix Skill”Repomix packs entire repositories into single, AI-friendly files. Perfect for feeding codebases to LLMs like Claude, ChatGPT, and Gemini.
When to Use
Section titled “When to Use”Use when:
- Packaging codebases for AI analysis
- Creating repository snapshots for LLM context
- Analyzing third-party libraries
- Preparing for security audits
- Generating documentation context
- Investigating bugs across large codebases
- Creating AI-friendly code representations
Quick Start
Section titled “Quick Start”Check Installation
Section titled “Check Installation”repomix --versionInstall
Section titled “Install”# npmnpm install -g repomix
# Homebrew (macOS/Linux)brew install repomixBasic Usage
Section titled “Basic Usage”# Package current directory (generates repomix-output.xml)repomix
# Specify output formatrepomix --style markdownrepomix --style json
# Package remote repositorynpx repomix --remote owner/repo
# Custom output with filtersrepomix --include "src/**/*.ts" --remove-comments -o output.mdCore Capabilities
Section titled “Core Capabilities”Repository Packaging
Section titled “Repository Packaging”- AI-optimized formatting with clear separators
- Multiple output formats: XML, Markdown, JSON, Plain text
- Git-aware processing (respects .gitignore)
- Token counting for LLM context management
- Security checks for sensitive information
Remote Repository Support
Section titled “Remote Repository Support”Process remote repositories without cloning:
# Shorthandnpx repomix --remote yamadashy/repomix
# Full URLnpx repomix --remote https://github.com/owner/repo
# Specific commitnpx repomix --remote https://github.com/owner/repo/commit/hashComment Removal
Section titled “Comment Removal”Strip comments from supported languages (HTML, CSS, JavaScript, TypeScript, Vue, Svelte, Python, PHP, Ruby, C, C#, Java, Go, Rust, Swift, Kotlin, Dart, Shell, YAML):
repomix --remove-commentsCommon Use Cases
Section titled “Common Use Cases”Code Review Preparation
Section titled “Code Review Preparation”# Package feature branch for AI reviewrepomix --include "src/**/*.ts" --remove-comments -o review.md --style markdownSecurity Audit
Section titled “Security Audit”# Package third-party librarynpx repomix --remote vendor/library --style xml -o audit.xmlDocumentation Generation
Section titled “Documentation Generation”# Package with docs and coderepomix --include "src/**,docs/**,*.md" --style markdown -o context.mdBug Investigation
Section titled “Bug Investigation”# Package specific modulesrepomix --include "src/auth/**,src/api/**" -o debug-context.xmlImplementation Planning
Section titled “Implementation Planning”# Full codebase contextrepomix --remove-comments --copyCommand Line Reference
Section titled “Command Line Reference”File Selection
Section titled “File Selection”# Include specific patternsrepomix --include "src/**/*.ts,*.md"
# Ignore additional patternsrepomix -i "tests/**,*.test.js"
# Disable .gitignore rulesrepomix --no-gitignoreOutput Options
Section titled “Output Options”# Output formatrepomix --style markdown # or xml, json, plain
# Output file pathrepomix -o output.md
# Remove commentsrepomix --remove-comments
# Copy to clipboardrepomix --copyConfiguration
Section titled “Configuration”# Use custom config filerepomix -c custom-config.json
# Initialize new configrepomix --init # creates repomix.config.jsonToken Management
Section titled “Token Management”Repomix automatically counts tokens for individual files, total repository, and per-format output.
Typical LLM context limits:
- Claude Sonnet: ~200K tokens
- GPT-4: ~128K tokens
- GPT-3.5: ~16K tokens
Token Count Optimization
Section titled “Token Count Optimization”repomix --token-count-treerepomix --token-count-tree 1000 # Only show files/directories with 1000+ tokensSecurity Considerations
Section titled “Security Considerations”Repomix uses Secretlint to detect sensitive data (API keys, passwords, credentials, private keys, AWS secrets).
Best practices:
- Always review output before sharing
- Use
.repomixignorefor sensitive files - Enable security checks for unknown codebases
- Avoid packaging
.envfiles - Check for hardcoded credentials
Disable security checks if needed:
repomix --no-security-checkImplementation Workflow
Section titled “Implementation Workflow”When user requests repository packaging:
-
Assess Requirements
- Identify target repository (local/remote)
- Determine output format needed
- Check for sensitive data concerns
-
Configure Filters
- Set include patterns for relevant files
- Add ignore patterns for unnecessary files
- Enable/disable comment removal
-
Execute Packaging
- Run repomix with appropriate options
- Monitor token counts
- Verify security checks
-
Validate Output
- Review generated file
- Confirm no sensitive data
- Check token limits for target LLM
-
Deliver Context
- Provide packaged file to user
- Include token count summary
- Note any warnings or issues
Reference Documentation
Section titled “Reference Documentation”For detailed information, see:
- Configuration Reference - Config files, include/exclude patterns, output formats, advanced options
- Usage Patterns - AI analysis workflows, security audit preparation, documentation generation, library evaluation
Additional Resources
Section titled “Additional Resources”- GitHub: https://github.com/yamadashy/repomix
- Documentation: https://repomix.com/guide/
- MCP Server: Available for AI assistant integration
Tool Size Caps + Security Guards (E6)
Section titled “Tool Size Caps + Security Guards (E6)”When invoking repomix, this skill MUST enforce the following caps on every run:
- Output size cap: default
--max-output-size 8MB(8 × 1024 × 1024 chars). Larger packs do not fit a single LLM context anyway. Override only when the user explicitly requests--no-output-size-cap. - Token-count guard: if the post-pack token estimate exceeds
200_000, refuse to deliver the file inline; instead write the path and report'too large to inline; opened on disk at <path>'. - Security check is FAIL-CLOSED, not fail-open: the historical
--no-security-checkflag is a fail-OPEN default that ships secret-laden packs. This skill MUST pass--security-check(default), and MUST refuse--no-security-checkunless the user types the literal phraseI accept secret leak riskin the same turn. - Guarded write: packed file goes to
os.tmpdir()/t1k-repomix/<sha>.{xml,md,txt}first; only after the security-check passes does the skill copy to the user-specified output path. Failure path leaves nothing in the destination.
These caps protect downstream consumers (LLM context budgets) and prevent the most common failure mode (accidentally packing .env or credential files into a session).