A TUI (Terminal User Interface) application for interactively chunking text files, specifically designed for preparing content to be sent to Large Language Models like Claude.
- File Explorer: Navigate your filesystem to select files for chunking
- Text Viewer: View file contents and select text for chunking
- Chunk Editor: Edit text chunks before saving
- Token Counter: Real-time token counting using Claude's tokenizer
- Vim Keybindings: Familiar navigation and editing for Vim users
- Progress Tracking: Track chunking progress for each file
# Clone the repository
git clone https://github.com/your-username/packrat.git
cd packrat
# Build the application
cargo build --release
# Run the application
./target/release/packrat- ?: Toggle help panel
- q/Esc: Quit current mode or application
- j/k or Up/Down: Navigate files/text
- Enter or l: Open file/directory
- h or Left: Go to parent directory
- Space: Toggle selection mode in viewer
- e: Edit selected text
- s: Save selection as a chunk
Packrat operates in three modes:
- Explorer Mode: Navigate files and directories
- Viewer Mode: View file contents and select text for chunking
- Editor Mode: Edit selected text before saving as a chunk
Packrat looks for configuration in:
./packrat.toml(current directory)- User config directory (platform-specific)
Generate a default configuration file with:
packrat --generate-configSee packrat.example.toml for configuration options.
Packrat helps break down large text files into manageable chunks for LLM processing. It uses Claude's tokenizer to count tokens in real-time, ensuring chunks stay within model context limits.
This project is licensed under the MIT License - see the LICENSE file for details.