Tired of manually copy-pasting files to provide context to a Large Language Model (LLM) like ChatGPT, Claude, or Gemini? LLM.md Builder is a Visual Studio Code extension that automates this process. It intelligently scans your workspace, respects your existing .gitignore
rules, and bundles all relevant code into a single, clean Markdown file, perfectly formatted for any LLM.
Why Use LLM?
Providing an LLM with your full project context is key to getting high-quality, relevant responses. However, this is often a tedious and error-prone process. This extension solves that by:
- Saving Time: No more manual selection and copying of files.
- Providing Complete Context: Ensure the LLM sees the whole picture, not just isolated snippets.
- Reducing Noise: Automatically excludes irrelevant files, binaries, and dependencies.
- Creating a Structured Prompt: The output includes a file tree and clearly separated code blocks, making it easier for the LLM to understand your project's structure.
Features
- 🚀 One-Click Context Generation: An icon in the editor toolbar lets you run the tool instantly.
- 🧠 Intelligent Filtering: Automatically ignores files and directories based on:
- Your project's
.gitignore
files (it respects nested rules!).
- A dedicated
.llmignore
file for LLM-specific exclusions.
- A comprehensive list of default patterns (like
node_modules
, .git
, dist/
).
- A blocklist of binary file extensions.
- 📁 Structured Output: The generated Markdown file includes:
- A summary with total file count and content size.
- A clean, easy-to-read repository tree.
- The full contents of each included file, wrapped in syntax-highlighted code fences.
- ✨ Seamless Workflow:
- Shows a progress notification while working.
- Automatically names the output file with a timestamp (e.g.,
LLM_2023_NOV_21_15_30.md
).
- Opens the generated file for you upon completion.
How to Use
The easiest way to use LLM.md Builder is by clicking the icon in the editor's title bar.

- Install the extension.
- Open any file in your project.
- Click the LLM.md Builder icon
- The extension will generate the
LLM_*.md
file and open it.
How Filtering Works
The extension is designed to be smart about what it includes. It uses the exact same logic as your original code:
- Find All Files: It starts by finding every file in your workspace.
- Apply Default Excludes: It removes files and folders matching the built-in list (
node_modules
, its own output LLM_*.md
, etc.).
- Exclude Binary Files: It removes files with common binary extensions (
.png
, .zip
, .pdf
).
- Apply Custom Ignore Files: It reads all
.gitignore
and .llmignore
files in your workspace and applies their rules.
The .llmignore
File
Sometimes you want to exclude files from the LLM context that you do want to keep in version control. For this, create a .llmignore
file in your project's root or subdirectories. It uses the exact same syntax as .gitignore
.
This is useful for excluding:
- Large data files or fixtures (
*.csv
, test/fixtures/
).
- Documentation or examples not relevant to your current query (
docs/
, examples/
).
- Highly verbose generated files (
*.lock
, generated_types.ts
).
Example .llmignore
# Exclude all documentation from the context
docs/
# Exclude large test assets
tests/assets/