File Filtering
Smart Defaults
Section titled “Smart Defaults”promptext automatically excludes common non-source files:
- Dependencies:
node_modules/,vendor/,bower_components/ - Build Output:
dist/,build/,out/,target/ - Version Control:
.git/,.svn/,.hg/ - IDE Files:
.idea/,.vscode/,*.sublime-* - Cache:
__pycache__/,.sass-cache/,.npm/ - Logs:
logs/,*.log,tmp/
Disable default rules:
promptext -u=false # Only use explicit excludesMulti-Layered Lock File Detection
Section titled “Multi-Layered Lock File Detection”promptext automatically excludes package lock files using a sophisticated 3-layer detection system, saving 50K-100K+ tokens per project:
Layer 1: Signature-Based Detection (99% confidence)
Section titled “Layer 1: Signature-Based Detection (99% confidence)”Pattern matching with content verification for 15+ lock file formats:
- Node.js:
package-lock.json,yarn.lock,pnpm-lock.yaml,bun.lockb,.pnp.cjs - Python:
poetry.lock,Pipfile.lock,pdm.lock - PHP:
composer.lock - Ruby:
Gemfile.lock - Rust:
Cargo.lock - Go:
go.sum - .NET:
packages.lock.json,project.assets.json - Java:
gradle.lockfile
Requires multiple signature matches to avoid false positives.
Layer 2: Ecosystem-Aware Detection (95% confidence)
Section titled “Layer 2: Ecosystem-Aware Detection (95% confidence)”Automatically detects package managers by scanning for manifest files:
- Detects
package.json→ excludes Node.js lock files - Detects
go.mod→ excludesgo.sum - Detects
pyproject.toml→ excludes Python lock files - Context-aware for uncommon lock file formats
Layer 3: Generated File Detection (85% confidence)
Section titled “Layer 3: Generated File Detection (85% confidence)”Heuristic detection for auto-generated files:
- Checks for markers:
@generated,autogenerated,do not edit - Low-entropy pattern analysis for repetitive structures
- Catches minified files, bundles, source maps (
.min.js,.map, etc.)
Token Savings Examples
Section titled “Token Savings Examples”| Project Type | Lock File | Size | Token Savings |
|---|---|---|---|
| Node.js (React) | package-lock.json | 500KB | ~80,000 tokens |
| Python (Poetry) | poetry.lock | 200KB | ~60,000 tokens |
| Rust | Cargo.lock | 150KB | ~45,000 tokens |
| PHP (Laravel) | composer.lock | 400KB | ~70,000 tokens |
Binary Detection
Section titled “Binary Detection”Automatically skips binary files by detecting:
- Null bytes in first 512 bytes
- Invalid UTF-8 encoding
No need to specify binary extensions — images, executables, and archives are automatically excluded.
Custom Patterns
Section titled “Custom Patterns”Pattern Types
Section titled “Pattern Types”Directory matching:
excludes: - test/ # Any 'test' directory - internal/tmp/ # Specific pathWildcards:
excludes: - "*.test.go" # Test files - ".aider*" # Generated filesExact matches:
excludes: - config.json # Specific file - src/constants.go # Exact pathConfiguration
Section titled “Configuration”Config file:
excludes: - test/ - "*.generated.*" - docs/private/Command line:
promptext -x "test/,*.generated.*,docs/private/"GitIgnore Integration
Section titled “GitIgnore Integration”Automatically respects .gitignore patterns. Disable with:
promptext -g=falseFilter Priority
Section titled “Filter Priority”- Default patterns (if enabled)
- GitIgnore patterns (if enabled)
- Custom excludes (config + command line)
All patterns are combined and deduplicated for optimal performance.