High-performance CLI & TUI repository packer for LLM context prompts. Sub-30ms execution, zero runtime dependencies.
You want Claude Fable, GPT-6 Luna, Gemini 3, or DeepSeek R1 to refactor a subsystem across your codebase. You run a quick script to dump your files, paste the output into the prompt, and realize:
Cargo.lock, package-lock.json, minified bundles, SVG graphics, and binary artifacts.repOx solves this. It scans multi-thousand-file repositories in milliseconds, strips noise with Git heuristics, provides a lazygit-style terminal UI for instant pruning, and copies clean, model-optimized prompts straight to your clipboard.
Measured using hyperfine on Apple Silicon (M-series) traversing a 3,000+ file repository (15 runs, 3 warmups):
| Tool | Average Latency | Speedup | Memory | Interactive TUI |
|---|---|---|---|---|
repox (Claude XML) | 14.2 ms ± 0.8 ms | 1.0x (baseline) | ~18 MB | Yes (-i) |
repox -t -p claude | 42.6 ms ± 1.4 ms | ~3.0x slower | ~42 MB | Yes (live gauge) |
repomix (npx repomix) | 1,850.4 ms ± 48.2 ms | ~130x slower | ~185 MB | No |
files-to-prompt (Python) | 620.1 ms ± 18.0 ms | ~43x slower | ~54 MB | No |
| Feature | repox | repomix | gitingest | files-to-prompt |
|---|---|---|---|---|
| Language & Runtime | Rust (static binary) | Node.js (requires npm) | Python (web-first) | Python (pip) |
| Interactive Terminal UI | Yes (ratatui) | No | Web browser only | No |
| Offline Token Calculation | Yes (tiktoken-rs) | Yes | Approximate | No |
| Real-time Context Budget | Yes (live gauge) | No | No | No |
| Fuzzy File Search | Yes (nucleo-matcher) | No | Browser find | No |
| Git NUL-byte Binary Detection | Yes (8KB check) | Basic extension check | Basic | None |
| Secret & Lockfile Filtering | Automatic | Config-based | Basic | None |
| UNIX Pipe Friendly | Yes (TUI on stderr) | Partial | Web download | Yes |
curl -fsSL https://raw.githubusercontent.com/WVDYC/repOx/main/install.sh | sh
brew tap WVDYC/tap https://github.com/WVDYC/repOx
brew install repox
Requires Rust 1.85+ (2024 edition):
cargo install --git https://github.com/WVDYC/repOx.git
Or build locally:
git clone https://github.com/WVDYC/repOx.git
cd repOx
cargo build --release
# Binary: ./target/release/repox
repOx generates native completions for all major shells:
# Zsh
repox --completions zsh > ~/.zsh/completion/_repox
# Bash
repox --completions bash > ~/.local/share/bash-completion/completions/repox
# Fish
repox --completions fish > ~/.config/fish/completions/repox.fish
Launch the terminal interface with repox -i or repox --tui.
┌── Files ──────────────────────────────────┐┌── Preview: src/main.rs ──────────────┐
│ ▸ [x] crates/ ││ 1 │ use clap::Parser; │
│ ▾ [x] src/ ││ 2 │ use color_eyre::eyre::Result; │
│ [x] cli.rs 7.1 KB ││ 3 │ │
│ [x] main.rs 3.8 KB ││ 4 │ fn main() -> Result<()> { │
│ [x] Cargo.toml 1.4 KB ││ 5 │ // fast parallel walk... │
└───────────────────────────────────────────┘└───────────────────────────────────────┘
[Claude Fable 5.1 (1M)] 26/26 files | 45,260 / 1,000,000 tokens (4.5%) [■░░░░░░░░░] 166.0 KB
[↑/↓] Move [Space] Toggle [/] Search [a] Invert [c] Copy [Enter] Dump [q] Quit
| Key | Action |
|---|---|
↑ / k or ↓ / j | Move selection cursor up / down |
← / h or → / l | Collapse / Expand folder |
Space | Toggle file or folder (cascading tri-state checkboxes: [ ], [-], [x]) |
a | Toggle all / invert selection |
/ | Open live fuzzy search filter (nucleo-matcher) |
Esc | Clear search query / reset filter |
c | Copy to clipboard: format selected files and exit |
Enter | On a file: dump context to stdout/file and exit; on a folder: toggle expand/collapse |
q | Abort and quit without action |
repox -i -p fable
# Also supports: -p luna, -p gemini, -p deepseek, -p o1, -p claude
Launches the TUI calibrated against the target model's context window (e.g. 1,000,000 tokens for Fable/Gemini, 1.05M for Luna).
repox -c
Copies Claude-formatted XML prompt directly to your system clipboard:
✓ Copied to clipboard: 42 files (142.6 KB) in 4.12ms
repox -c -t -p claude
✓ Copied to clipboard: 42 files (142.6 KB, 38,120 tokens) in 38.50ms
repox -f md -o context.md
repox src/ -s 500KB -d 3 -o prompt.xml
repox -q | pbcopy
-f xml, Default)Includes an ASCII directory tree followed by cleanly tagged file blocks:
<repository_structure>
.
├── Cargo.toml
├── crates
│ └── repox-core
│ └── src
│ └── lib.rs
└── src
└── main.rs
</repository_structure>
<file path="Cargo.toml">
[workspace]
members = ["crates/*"]
</file>
<file path="src/main.rs">
fn main() { ... }
</file>
-f md)Uses collision-safe backtick fencing (automatically escapes nested backticks):
# Repository Structure
```
.
├── Cargo.toml
└── src
└── main.rs
```
# Repository Files
## File: Cargo.toml
```toml
[workspace]
...
```
## File: src/main.rs
```rust
fn main() { ... }
```
repOx is engineered around three core principles: zero-allocation rendering, deterministic output, and fail-safe ergonomics.
crates/repox-tui/src/tree.rs)Recursive tree widgets frequently allocate on every frame and suffer from cache thrashing. repOx flattens the file hierarchy into a single contiguous pre-order Vec<Node>:
[start..end].crates/repox-core/src/scanner.rs)ignore::WalkBuilder with lock-free channel batching..gitignore, .ignore, and .repoxignore..env*, *pem, *id_rsa*) before reading full payloads into memory.stderr for Clean Unix PipelinesThe interactive TUI renders exclusively to stderr. This means stdout is never corrupted by escape codes, allowing clean composition:
repox -i | llm prompt "explain the architecture"
Uses an RAII TerminalGuard with a panic hook to guarantee that raw mode is disabled and the alternate screen is exited even if an abnormal termination occurs.
repox [OPTIONS] [PATH]
Arguments:
[PATH] Target repository directory [default: .]
Options:
-i, --interactive Launch interactive terminal UI file picker (alias: --tui)
-f, --format <FORMAT> Format template: 'xml' (Claude-optimized) or 'markdown' / 'md' [default: xml]
-c, --copy Copy output context directly to system clipboard
-o, --output <FILE> Write formatted context to an output file instead of stdout
-t, --tokens Calculate total token count using multi-threaded tiktoken tokenizer
-p, --token-profile <PROF> Tokenizer profile: 'fable' (Claude Fable 5.1, 1M), 'luna' (GPT-6 Luna, 1.05M), 'claude', 'o1', 'deepseek', 'gemini', 'cl100k' [default: cl100k]
-s, --max-file-size <SIZE> Skip files exceeding size threshold (e.g. 500KB, 1.5MB) [default: 1MB]
-d, --max-depth <DEPTH> Maximum directory nesting depth to traverse
--no-gitignore Disable respecting .gitignore files
--no-repoxignore Disable respecting .repoxignore files
--include-hidden Include hidden files and folders
-e, --exclude <GLOB> Glob pattern to exclude (can be specified multiple times)
-I, --include <GLOB> Glob pattern to include exclusively (can be specified multiple times)
-j, --threads <N> Worker threads count (defaults to logical CPU core count)
--completions <SHELL> Generate shell completions (bash, zsh, fish, powershell, elvish)
-q, --quiet Silence informational statistics on stderr
-v, --verbose Enable verbose debug logs
-h, --help Print help
-V, --version Print version
cargo test --workspace
Dual-licensed under either:
at your option.
Rust
84.9%
Shell
8.1%
PowerShell
3.4%
Elvish
1.8%
Ruby
1.2%
High-performance CLI & TUI repository packer for LLM context prompts. Sub-30ms execution, zero runtime dependencies.
You want Claude Fable, GPT-6 Luna, Gemini 3, or DeepSeek R1 to refactor a subsystem across your codebase. You run a quick script to dump your files, paste the output into the prompt, and realize:
Cargo.lock, package-lock.json, minified bundles, SVG graphics, and binary artifacts.repOx solves this. It scans multi-thousand-file repositories in milliseconds, strips noise with Git heuristics, provides a lazygit-style terminal UI for instant pruning, and copies clean, model-optimized prompts straight to your clipboard.
Measured using hyperfine on Apple Silicon (M-series) traversing a 3,000+ file repository (15 runs, 3 warmups):
| Tool | Average Latency | Speedup | Memory | Interactive TUI |
|---|---|---|---|---|
repox (Claude XML) | 14.2 ms ± 0.8 ms | 1.0x (baseline) | ~18 MB | Yes (-i) |
repox -t -p claude | 42.6 ms ± 1.4 ms | ~3.0x slower | ~42 MB | Yes (live gauge) |
repomix (npx repomix) | 1,850.4 ms ± 48.2 ms | ~130x slower | ~185 MB | No |
files-to-prompt (Python) | 620.1 ms ± 18.0 ms | ~43x slower | ~54 MB | No |
| Feature | repox | repomix | gitingest | files-to-prompt |
|---|---|---|---|---|
| Language & Runtime | Rust (static binary) | Node.js (requires npm) | Python (web-first) | Python (pip) |
| Interactive Terminal UI | Yes (ratatui) | No | Web browser only | No |
| Offline Token Calculation | Yes (tiktoken-rs) | Yes | Approximate | No |
| Real-time Context Budget | Yes (live gauge) | No | No | No |
| Fuzzy File Search | Yes (nucleo-matcher) | No | Browser find | No |
| Git NUL-byte Binary Detection | Yes (8KB check) | Basic extension check | Basic | None |
| Secret & Lockfile Filtering | Automatic | Config-based | Basic | None |
| UNIX Pipe Friendly | Yes (TUI on stderr) | Partial | Web download | Yes |
curl -fsSL https://raw.githubusercontent.com/WVDYC/repOx/main/install.sh | sh
brew tap WVDYC/tap https://github.com/WVDYC/repOx
brew install repox
Requires Rust 1.85+ (2024 edition):
cargo install --git https://github.com/WVDYC/repOx.git
Or build locally:
git clone https://github.com/WVDYC/repOx.git
cd repOx
cargo build --release
# Binary: ./target/release/repox
repOx generates native completions for all major shells:
# Zsh
repox --completions zsh > ~/.zsh/completion/_repox
# Bash
repox --completions bash > ~/.local/share/bash-completion/completions/repox
# Fish
repox --completions fish > ~/.config/fish/completions/repox.fish
Launch the terminal interface with repox -i or repox --tui.
┌── Files ──────────────────────────────────┐┌── Preview: src/main.rs ──────────────┐
│ ▸ [x] crates/ ││ 1 │ use clap::Parser; │
│ ▾ [x] src/ ││ 2 │ use color_eyre::eyre::Result; │
│ [x] cli.rs 7.1 KB ││ 3 │ │
│ [x] main.rs 3.8 KB ││ 4 │ fn main() -> Result<()> { │
│ [x] Cargo.toml 1.4 KB ││ 5 │ // fast parallel walk... │
└───────────────────────────────────────────┘└───────────────────────────────────────┘
[Claude Fable 5.1 (1M)] 26/26 files | 45,260 / 1,000,000 tokens (4.5%) [■░░░░░░░░░] 166.0 KB
[↑/↓] Move [Space] Toggle [/] Search [a] Invert [c] Copy [Enter] Dump [q] Quit
| Key | Action |
|---|---|
↑ / k or ↓ / j | Move selection cursor up / down |
← / h or → / l | Collapse / Expand folder |
Space | Toggle file or folder (cascading tri-state checkboxes: [ ], [-], [x]) |
a | Toggle all / invert selection |
/ | Open live fuzzy search filter (nucleo-matcher) |
Esc | Clear search query / reset filter |
c | Copy to clipboard: format selected files and exit |
Enter | On a file: dump context to stdout/file and exit; on a folder: toggle expand/collapse |
q | Abort and quit without action |
repox -i -p fable
# Also supports: -p luna, -p gemini, -p deepseek, -p o1, -p claude
Launches the TUI calibrated against the target model's context window (e.g. 1,000,000 tokens for Fable/Gemini, 1.05M for Luna).
repox -c
Copies Claude-formatted XML prompt directly to your system clipboard:
✓ Copied to clipboard: 42 files (142.6 KB) in 4.12ms
repox -c -t -p claude
✓ Copied to clipboard: 42 files (142.6 KB, 38,120 tokens) in 38.50ms
repox -f md -o context.md
repox src/ -s 500KB -d 3 -o prompt.xml
repox -q | pbcopy
-f xml, Default)Includes an ASCII directory tree followed by cleanly tagged file blocks:
<repository_structure>
.
├── Cargo.toml
├── crates
│ └── repox-core
│ └── src
│ └── lib.rs
└── src
└── main.rs
</repository_structure>
<file path="Cargo.toml">
[workspace]
members = ["crates/*"]
</file>
<file path="src/main.rs">
fn main() { ... }
</file>
-f md)Uses collision-safe backtick fencing (automatically escapes nested backticks):
# Repository Structure
```
.
├── Cargo.toml
└── src
└── main.rs
```
# Repository Files
## File: Cargo.toml
```toml
[workspace]
...
```
## File: src/main.rs
```rust
fn main() { ... }
```
repOx is engineered around three core principles: zero-allocation rendering, deterministic output, and fail-safe ergonomics.
crates/repox-tui/src/tree.rs)Recursive tree widgets frequently allocate on every frame and suffer from cache thrashing. repOx flattens the file hierarchy into a single contiguous pre-order Vec<Node>:
[start..end].crates/repox-core/src/scanner.rs)ignore::WalkBuilder with lock-free channel batching..gitignore, .ignore, and .repoxignore..env*, *pem, *id_rsa*) before reading full payloads into memory.stderr for Clean Unix PipelinesThe interactive TUI renders exclusively to stderr. This means stdout is never corrupted by escape codes, allowing clean composition:
repox -i | llm prompt "explain the architecture"
Uses an RAII TerminalGuard with a panic hook to guarantee that raw mode is disabled and the alternate screen is exited even if an abnormal termination occurs.
repox [OPTIONS] [PATH]
Arguments:
[PATH] Target repository directory [default: .]
Options:
-i, --interactive Launch interactive terminal UI file picker (alias: --tui)
-f, --format <FORMAT> Format template: 'xml' (Claude-optimized) or 'markdown' / 'md' [default: xml]
-c, --copy Copy output context directly to system clipboard
-o, --output <FILE> Write formatted context to an output file instead of stdout
-t, --tokens Calculate total token count using multi-threaded tiktoken tokenizer
-p, --token-profile <PROF> Tokenizer profile: 'fable' (Claude Fable 5.1, 1M), 'luna' (GPT-6 Luna, 1.05M), 'claude', 'o1', 'deepseek', 'gemini', 'cl100k' [default: cl100k]
-s, --max-file-size <SIZE> Skip files exceeding size threshold (e.g. 500KB, 1.5MB) [default: 1MB]
-d, --max-depth <DEPTH> Maximum directory nesting depth to traverse
--no-gitignore Disable respecting .gitignore files
--no-repoxignore Disable respecting .repoxignore files
--include-hidden Include hidden files and folders
-e, --exclude <GLOB> Glob pattern to exclude (can be specified multiple times)
-I, --include <GLOB> Glob pattern to include exclusively (can be specified multiple times)
-j, --threads <N> Worker threads count (defaults to logical CPU core count)
--completions <SHELL> Generate shell completions (bash, zsh, fish, powershell, elvish)
-q, --quiet Silence informational statistics on stderr
-v, --verbose Enable verbose debug logs
-h, --help Print help
-V, --version Print version
cargo test --workspace
Dual-licensed under either:
at your option.
Rust
84.9%
Shell
8.1%
PowerShell
3.4%
Elvish
1.8%
Ruby
1.2%