A powerful tool for creating comprehensive, LLM-optimized documentation from your codebase. Intelligently bundles multiple source files into a single output with token counting, smart project detection, and interactive selection.
- Interactive File Selection: Navigate and select files/directories with a rich colored UI
- Smart Project Detection: Automatically detects project type (Python, JavaScript, TypeScript, Rust, Go, Java, C++, Ruby, PHP, Swift, Kotlin, Scala) and applies intelligent defaults
- Token Analysis: Real-time token counting for Claude, GPT-4, and Gemini models with cost estimates
- Multiple Ignore Files: Respects .gitignore, .dockerignore, .npmignore, and custom patterns
- State Preservation: Remembers selections between runs with project-specific configurations
- Configuration System: Project-specific
.claude-dumpfiles and global preferences - Template Support: Customizable output formats using Handlebars templates
- Export Formats: Output to Markdown (default), JSON, or HTML
- Manifest Generation: Track dump metadata for incremental updates
- Pattern-Based Selection: Bulk select/deselect files using glob patterns
- Related File Suggestions: Intelligently suggests related files based on imports
- Preview Mode: Review output before saving with token usage breakdown
Clone the repository and install using pipx:
git clone https://github.com/kunaldeo/single-file-project-dumper
cd single-file-project-dumper
pipx install . --force# Run in current directory
project-dumper
# Run in specific directory
project-dumper /path/to/project# Initialize project configuration with smart defaults
project-dumper --init
# This creates a .claude-dump file with project-specific settingsproject-dumper -s # Open state editor (visual file selector)
project-dumper -e # Edit mode (load previous selections)
project-dumper -i # Interactive mode (state editor + advanced options)
project-dumper -o dump.txt # Set output file
project-dumper -f json # Set format (markdown/json/html)
project-dumper -c # Copy output to clipboard
project-dumper -r # Reset saved selectionsFile Selection Modes
-s, --state-editor # Visual tree-based file selector with keyboard navigation
-e, --edit # Open state editor with previously saved selections
-i, --interactive # Combine visual selection with advanced management optionsOutput Options
-o, --output-file FILE # Specify output filename (default: project_code.txt)
-f, --format FORMAT # Export format: markdown, json, or html
-t, --template FILE # Use custom Handlebars template for output
-c, --copy # Copy output to clipboard after generationConfiguration Options
--init # Initialize .claude-dump config with smart defaults
--state-file FILE # Custom state file location (default: .file_dumper_state.json)
--manifest # Generate manifest file with dump metadata
-r, --reset # Clear all saved file selections and start freshFiltering Options
--include PATTERN # Include files matching pattern (can use multiple times)
--exclude PATTERN # Exclude files matching pattern (can use multiple times)
-m, --max-file-size KB # Maximum file size in kilobytes (default: 1000)# Quick visual file selection
project-dumper -s
# Edit previous selection and copy to clipboard
project-dumper -e -c
# Generate JSON output with custom filename
project-dumper -f json -o api-docs.json
# Reset and start fresh selection
project-dumper -r -s
# Include only Python files under 500KB
project-dumper --include "*.py" -m 500Project Dumper offers three ways to select files:
project-dumperAutomatically selects files based on smart project detection and saved state. Only includes source code files (Python, JavaScript, TypeScript, Rust, Go, Java, C++, Ruby, PHP, Swift, Kotlin, Scala, and configuration files).
project-dumper --state-editorVisual tree-based file browser with:
- Hierarchical file tree display showing only source files
- Real-time navigation with arrow keys or vim keys (j/k)
- Directory expansion/collapse with Enter
- Visual selection indicators with checkmarks and colors
- Bulk directory selection - selecting a directory selects all source files within
- Dark terminal optimized color scheme
- Source file filtering - only shows relevant code files
β/βorj/k: Navigate up/downSpace: Select/deselect current file or directoryEnter: Expand/collapse directoriesq: Save selections and generate dumpCtrl+C: Cancel (exit without saving)
project-dumper --interactiveCombines visual file selection with advanced management options:
- State editor for initial file selection
- Interactive edit mode with pattern-based operations, token analysis, preview, and export options
project-dumper --editOpens the state editor with previously saved file selections pre-loaded for quick editing.
{
"include_patterns": ["src/**/*.py", "tests/**/*.py"],
"exclude_patterns": ["**/__pycache__/**", "**/node_modules/**"],
"max_file_size": 1048576,
"max_total_size": 10485760,
"output_format": "markdown",
"template_file": null
}Stored in ~/.config/project-dumper/preferences.json:
- Recent projects tracking
- Default output format
- Preferred token model
- UI preferences
The tool provides real-time token analysis for:
- Claude: Most accurate counting using official tokenizer
- GPT-4: OpenAI tiktoken-based counting
- Gemini: Estimated token count
Includes context window warnings:
β οΈ 80% usage: Warning- β 100% usage: Error (output will be truncated)
Optimized for LLM prompts with:
- Project structure tree
- Formatted code blocks with syntax highlighting
- Clear file demarcation
Structured data format with:
- File metadata
- Token counts per file
- Project statistics
Interactive HTML view with:
- Collapsible file sections
- Syntax highlighting
- Token usage visualization
Automatically detects and optimizes for:
- Python: Includes .py files, excludes pycache, .pyc
- JavaScript/TypeScript: Includes .js/.ts, excludes node_modules, dist
- Rust: Includes .rs, excludes target directory
- Go: Includes .go, excludes vendor
- And more...
- Initialize project config: Run
project-dumper --initfor optimal defaults - Choose the right selection mode:
- Use automatic mode for quick, repeated dumps with smart defaults
- Use state editor for visual file exploration and simple selection
- Use interactive mode for advanced operations (patterns, previews, token analysis)
- Use edit mode to quickly modify previously saved selections
- Review token usage: Check token counts before sending to LLMs
- Use manifests: Generate manifests for tracking changes over time
- Leverage patterns: Use glob patterns for efficient bulk selection
- Preview first: Always preview output for large projects
- Binary files are automatically skipped
- UTF-8 encoding is assumed for all text files
- Extremely large files (>1MB by default) are excluded with warning
- Token counts are estimates and may vary slightly from LLM APIs