Skip to content

File Filtering

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:

Terminal window
promptext -u=false # Only use explicit excludes

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 → excludes go.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.)
Project TypeLock FileSizeToken Savings
Node.js (React)package-lock.json500KB~80,000 tokens
Python (Poetry)poetry.lock200KB~60,000 tokens
RustCargo.lock150KB~45,000 tokens
PHP (Laravel)composer.lock400KB~70,000 tokens

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.

Directory matching:

excludes:
- test/ # Any 'test' directory
- internal/tmp/ # Specific path

Wildcards:

excludes:
- "*.test.go" # Test files
- ".aider*" # Generated files

Exact matches:

excludes:
- config.json # Specific file
- src/constants.go # Exact path

Config file:

.promptext.yml
excludes:
- test/
- "*.generated.*"
- docs/private/

Command line:

Terminal window
promptext -x "test/,*.generated.*,docs/private/"

Automatically respects .gitignore patterns. Disable with:

Terminal window
promptext -g=false
  1. Default patterns (if enabled)
  2. GitIgnore patterns (if enabled)
  3. Custom excludes (config + command line)

All patterns are combined and deduplicated for optimal performance.