Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Smart File CombinerNew to Visual Studio Code? Get it now.
Smart File Combiner

Smart File Combiner

Vineet Kumar Motwani

|
20 installs
| (0) | Free
Combine multiple source files and folders into a single .txt for documentation, review, or AI ingestion.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

File Combiner

A VS Code extension that combines multiple files from your workspace into a single text file with customizable ignore patterns, so that it can be provided to LLM models for context.

Features

  • Automatic workspace scanning: Combines all files in your workspace automatically
  • Customizable ignore patterns: Configure which files and folders to exclude
  • Environment file handling: Special handling for .env files with placeholder values
  • Configurable output: Customize output filename and format
  • Deep directory traversal: Processes files in nested directories

Usage

  1. Open a workspace/folder in VS Code
  2. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
  3. Run the command: File Combiner: Combine Files
  4. The extension will create a combined file in your workspace root

Configuration

You can customize the extension's behavior through VS Code settings:

fileCombiner.ignoredDirectories

Array of directory names to ignore during file combination.

Default:

[
  "node_modules", "dist", "build", "out", "coverage", "__pycache__",
  "venv", ".venv", ".idea", ".vscode", "logs", "deploy", "temp", "tmp",
  ".git", ".svn", ".hg", ".cache"
]

fileCombiner.ignoredFiles

Array of specific filenames to ignore.

Default:

["package-lock.json", "yarn.lock", ".DS_Store", "Thumbs.db"]

fileCombiner.ignoredPatterns

Array of file patterns to ignore (supports wildcards).

Default:

["*.log", "*.bak", "*.swp", "*~", "#*#", "*.iml", "*.class", "*.jar", "*.war", "*.pyc"]

fileCombiner.outputFileName

Name of the output file.

Default: "combined.txt"

fileCombiner.handleEnvFiles

Enable special handling for .env files (replaces values with placeholders).

Default: true

fileCombiner.includeFileComments

Include file path comments in the output.

Default: true

Environment File Handling

When handleEnvFiles is enabled:

  • If .env.example exists in your workspace, .env files are ignored
  • If .env.example doesn't exist, .env files are processed with placeholder values
  • Example: API_KEY=secret123 becomes API_KEY=<api_key>

Customization Examples

Adding Custom Ignore Patterns

To ignore all .temp files and backup directories:

{
  "fileCombiner.ignoredPatterns": [
    "*.log", "*.bak", "*.swp", "*~", "#*#", "*.iml", 
    "*.class", "*.jar", "*.war", "*.pyc", "*.temp"
  ],
  "fileCombiner.ignoredDirectories": [
    "node_modules", "dist", "build", "out", "coverage", "__pycache__",
    "venv", ".venv", ".idea", ".vscode", "logs", "deploy", "temp", "tmp",
    ".git", ".svn", ".hg", ".cache", "backup"
  ]
}

Custom Output Format

To change the output filename and disable file comments:

{
  "fileCombiner.outputFileName": "merged-code.txt",
  "fileCombiner.includeFileComments": false
}

Requirements

  • VS Code 1.74.0 or higher

Release Notes

1.0.0

  • Initial release
  • Configurable ignore patterns
  • Environment file handling
  • Automatic workspace scanning

Contributing

Found a bug or want to contribute? Visit our GitHub repository.

License

MIT License

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft