๐งต Infiniloom
The fastest and most feature-rich way to pack repository context for LLMs
Installation โข Quick Start โข Features โข Unique Features โข Documentation
What is Infiniloom?
Infiniloom transforms your codebase into optimized context for Large Language Models. It extracts code, symbols, and structure from repositories and outputs them in formats specifically optimized for Claude, GPT-4, Gemini, and other LLMs.
# Pack your repo for Claude in under a second
Why Infiniloom?
- Blazing Fast: High-performance pure Rust architecture
- Smart: AST-based symbol extraction with PageRank importance ranking
- Optimized: Model-specific output formats (XML for Claude, Markdown for GPT)
- Secure: Automatic detection and redaction of secrets and API keys
- Flexible: Python and Node.js bindings included
Installation
Quick Install (Recommended)
# npm (easiest, works on macOS/Linux/Windows)
# Homebrew Cask (macOS - fast, pre-built binary)
# Cargo (if you have Rust installed)
All Installation Options
| Method | Command | Notes |
|---|---|---|
| npm | npm install -g infiniloom |
Easiest, cross-platform |
| Homebrew Cask | brew install --cask infiniloom |
Fast, pre-built binary (macOS) |
| Homebrew Formula | brew install infiniloom |
Builds from source, needs Rust |
| Cargo | cargo install infiniloom |
Rust users |
| pip | pip install infiniloom |
Python library |
| npm library | npm install infiniloom-node |
Node.js library |
From Source
# Clone and build
# Binary at ./target/release/infiniloom
Requires Rust 1.91+: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Quick Start
Basic Commands
# Pack repository into XML (optimized for Claude)
# Scan repository and show statistics
# Fast estimation for large repos via sampling
# Generate repository map with key symbols
# Split large repo into chunks for multi-turn conversations
# Chunk with overlap for context continuity
# Priority ordering (core modules first)
# Show repository information
Output Formats
# XML format โ optimized for Claude (with prompt caching hints)
# Markdown format โ optimized for GPT-4/GPT-4o
# TOON format โ most token-efficient (~40% smaller than JSON)
# JSON format โ for programmatic use
# YAML format โ optimized for Gemini
Working with Git
# Include recent commits in output
# Include uncommitted changes with diff content (+/- lines)
# Pack a remote GitHub repository
Diff Context for AI Code Reviews
# Build symbol index for fast diff context
# Keep index fresh with watch mode
# Get context for unstaged changes
# Get context for staged changes
# Get context for a specific commit or range
# Options
# Analyze impact of changes to a file or symbol
Note: diff and impact take the repository path first; any commit/range or target comes after the path.
The --include-diff flag embeds the actual git diff (+/- lines) within the semantic context, giving AI reviewers both WHAT changed and its surrounding context in one view.
The --include-history flag adds recent commit history for each changed file, showing when and why code was previously modified.
File Selection
# Include only specific file types
# Exclude directories
# Set token budget
# Limit to top N most important files (applied after ranking)
# Use compression
Watch Mode
# Continuously regenerate output when files change
# Watch mode respects all pack options (compression, security, etc.)
Pack Extras (Format-Safe)
# Add header/instructions and include token tree + security scan
- XML: extras are inserted inside
<repository>as<extras>...</extras> - JSON/YAML: extras are added as top-level fields (output remains valid)
- Markdown/Plain/TOON: header is prepended; other extras are appended as sections
Copy to Clipboard (macOS)
# Pack and copy directly to clipboard for pasting into Claude/ChatGPT
|
Features
Model-Specific Optimization
| Model | Format | Optimizations |
|---|---|---|
| Claude | XML | Prompt caching hints, CDATA sections, structured tags |
| GPT-4/4o | Markdown | Tables, code fences, hierarchical headers |
| Gemini | YAML | Query at end, hierarchical structure |
| Any | TOON | ~40% smaller than JSON, tabular metadata, minimal syntax |
| JSON | JSON | Full metadata, programmatic access |
AST-Based Symbol Extraction
Infiniloom uses Tree-sitter to parse source code and extract symbols from 21 languages:
| Language | Symbols Extracted |
|---|---|
| Python | Functions, Classes, Methods, Decorators |
| JavaScript/TypeScript | Functions, Classes, Interfaces, Types |
| Rust | Functions, Structs, Enums, Traits, Impl blocks |
| Go | Functions, Methods, Structs, Interfaces |
| Java | Classes, Interfaces, Methods, Enums |
| C/C++ | Functions, Structs, Classes |
| C# | Classes, Methods, Interfaces, Properties |
| Ruby | Classes, Modules, Methods |
| PHP | Classes, Functions, Methods |
| Kotlin | Classes, Functions, Interfaces |
| Swift | Classes, Structs, Functions, Protocols |
| Scala | Classes, Objects, Traits, Functions |
| Haskell | Functions, Types, Data, Typeclasses |
| Elixir | Modules, Functions, Macros |
| Clojure | Functions, Macros, Vars |
| OCaml | Functions, Modules, Types |
| Lua | Functions, Tables |
| R | Functions, Classes |
| Bash | Functions |
PageRank Symbol Ranking
Important symbols are ranked using PageRank algorithm based on:
- Reference count (how often a symbol is used)
- Import centrality (position in dependency graph)
- File importance (entry points, main modules)
Security Scanning
Automatically detects and redacts:
- API keys and tokens
- Passwords and secrets
- Private keys (RSA, SSH)
- Database connection strings
- Cloud credentials (AWS, GCP, Azure)
Note: Comment lines (starting with //, #, /*, etc.) are automatically skipped to reduce false positives from example code and documentation.
Compression Levels
| Level | Token Reduction | What's Removed |
|---|---|---|
none |
0% | Nothing |
minimal |
10-20% | Empty lines, trailing whitespace |
balanced |
30-40% | Comments, redundant whitespace |
aggressive |
50-60% | Docstrings, inline comments |
extreme |
70-80% | Everything except signatures |
Language Bindings
Python
# Pack a repository
=
# Get repository statistics
=
# Count tokens
=
Node.js
const = require;
// Pack a repository
const context = ;
// Get statistics
const stats = ;
console.log;
Performance
Infiniloom is designed for speed and efficiency, significantly outperforming existing solutions through its pure Rust architecture. Typical processing times for medium-sized repositories (100-500 files) are under 100ms.
Unique Features
Infiniloom offers capabilities not found in other repository packing tools:
Repository Map Generation
Generate a concise map of your codebase showing the most important symbols, ranked by importance:
The map uses PageRank algorithm to identify key entry points, heavily-used functions, and central abstractions โ giving LLMs a bird's-eye view of your architecture.
Map output sections:
- Summary (repo stats, primary language, key modules)
- Key symbols (ranked list with file + line)
- Module graph (directory dependencies)
- File index (top files by importance)
Intelligent Token Budgeting
Set a token budget and Infiniloom will intelligently select the most relevant files:
Files are prioritized based on:
- Symbol importance (PageRank scores)
- File centrality in the dependency graph
- Recent modification time
- Configuration file detection (package.json, Cargo.toml, etc.)
Multi-Model Token Counting
Accurate token counts for 20+ LLM models:
# OpenAI models (exact tokenization via tiktoken)
# Other vendors (calibrated estimation)
Secret Detection & Redaction
Automatically scans for and redacts sensitive information before output:
- AWS access keys and secrets
- GitHub tokens (classic and fine-grained PATs)
- Private keys (RSA, EC, DSA, OPENSSH)
- API keys and generic secrets
- Database connection strings (MongoDB, PostgreSQL, MySQL, Redis)
- JWT tokens
- Slack and Stripe tokens
- Custom patterns via configuration
Note: With a config file (from infiniloom init), scanning is enabled by default.
Security configuration options:
fail_on_secrets: Exit with error if secrets are detected (CI/CD integration)allowlist: Patterns to exclude from detectioncustom_patterns: Additional regex patterns for company-specific secrets
Native Language Bindings
Use Infiniloom directly in your applications โ no shell commands needed:
- Python: PyO3-based native extension
- Node.js: NAPI-RS bindings with TypeScript types
Configuration
.infiniloomignore
Create a .infiniloomignore file to exclude files (in addition to .gitignore):
# Build artifacts
target/
dist/
build/
# Dependencies
node_modules/
vendor/
# Large files
*.bin
*.dat
data/
# Generated
*.generated.*
Environment Variables
Environment variables use double underscore (__) to separate nested config keys:
| Variable | Description | Default |
|---|---|---|
INFINILOOM_OUTPUT__MODEL |
Default tokenizer model | claude |
INFINILOOM_OUTPUT__FORMAT |
Default output format | xml |
INFINILOOM_OUTPUT__COMPRESSION |
Default compression | balanced |
INFINILOOM_OUTPUT__TOKEN_BUDGET |
Default token budget | 0 (no limit) |
INFINILOOM_SCAN__INCLUDE_HIDDEN |
Include hidden files | false |
INFINILOOM_SCAN__RESPECT_GITIGNORE |
Respect .gitignore | true |
INFINILOOM_SECURITY__SCAN_SECRETS |
Enable secret scanning | false |
INFINILOOM_SECURITY__REDACT_SECRETS |
Redact detected secrets | true |
Note: CLI default for --max-tokens is 0 (no limit). Config files can override this.
Configuration File
Run infiniloom init to create a configuration file. Supports YAML, TOML, and JSON:
Example .infiniloom.yaml:
output:
format: xml
model: claude
compression: balanced
token_budget: 100000
line_numbers: true
show_file_summary: true
scan:
include:
- "*.rs"
- "*.py"
- "*.ts"
exclude:
- "tests/*"
- "docs/*"
- "*.test.*"
security:
scan_secrets: true # Enable secret scanning
fail_on_secrets: false # Exit with error if secrets found
redact_secrets: true # Replace detected secrets with [REDACTED]
allowlist: # Patterns to ignore (won't be flagged)
- "EXAMPLE"
- "test_key"
custom_patterns: # Additional regex patterns to detect
- "MY_SECRET_[A-Z0-9]{32}"
- "CUSTOM_TOKEN_\\w+"
Both flat and nested formats are supported for backward compatibility:
# Flat format (also works)
include:
- "*.rs"
exclude:
- "tests/*"
include_tests: false
include_docs: false
Documentation
| Document | Description |
|---|---|
| Architecture | System design and architecture |
| Output Formats | Detailed format specifications |
| Release Plan | Publishing and distribution |
Development
Project Structure
infiniloom/
โโโ cli/ # Rust CLI application
โโโ engine/ # Core Rust engine
โ โโโ src/
โ โ โโโ parser.rs # Tree-sitter AST parsing
โ โ โโโ repomap/ # PageRank symbol ranking
โ โ โโโ output/ # Format generators
โ โ โโโ security.rs # Secret detection
โโโ bindings/
โ โโโ python/ # PyO3 bindings
โ โโโ node/ # NAPI-RS bindings
โโโ docs/ # Documentation
Building
# Build everything
# Run tests
# Run clippy
# Run benchmarks
Running Tests
# All tests
# Specific crate
# With output
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing) - Make your changes
- Run tests (
cargo test) and lints (cargo clippy) - Commit with clear messages
- Push and open a Pull Request
See CONTRIBUTING.md for detailed guidelines.
License
MIT License โ see LICENSE for details.
Acknowledgments
- Tree-sitter for fast, reliable parsing
- tiktoken-rs for token counting
- Aider for the repo-map concept
Alternatives & Inspiration
These projects inspired Infiniloom and are great alternatives:
Made with ๐งต by Topos Labs