Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Context Generator for LLMNew to Visual Studio Code? Get it now.
Context Generator for LLM

Context Generator for LLM

e-penguiner

|
2 installs
| (1) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Context Generator for LLM

A Visual Studio Code extension that generates copy-ready context from multiple files in your workspace for use with Large Language Models (LLMs) such as ChatGPT, Claude, and Gemini. Instead of manually copying and pasting the contents of file after file every time you want to send them to one of these LLM tools, this extension gathers all the files you select and turns them into a single, well-structured context block that you can paste in one go.

demo

Features

  • Workspace file tree with checkboxes: Browse your current workspace in a dedicated view with a hierarchical tree of folders and files, each with a checkbox.
  • Folder-level selection: Checking a folder will check (or uncheck) all files and subfolders under it, making it easy to include whole directories at once.
  • Markdown-style context generation: For every selected file, the extension generates a block like:
    • File: relative/path/to/file.ext
    • Followed by the full file contents wrapped in triple backticks.
  • Dedicated "Generated Context" view: The generated text is shown in a separate webview tab called Generated Context with a read-only text area.
  • One-click copy: A Copy to Clipboard button copies the entire generated context so you can paste it directly into your LLM prompt.
  • Clear selection command: Quickly uncheck everything in the tree with a single command.

Requirements

  • Visual Studio Code: version 1.106.1 or higher (as defined in engines.vscode).
  • No additional runtime dependencies are required.

Installation

  1. Open the Extensions view in VS Code (Ctrl+Shift+X / Cmd+Shift+X).
  2. Search for "Context Generator for LLM".
  3. Click Install.
  4. Reload VS Code if prompted.

Usage

1. Open a workspace

  1. Open a folder or workspace in VS Code that contains the files you want to send as context to an LLM.

2. Open the Context Generator view

  1. In the Activity Bar, find the view container titled Context Generator for LLM.
  2. Open it to show the llm-file-selector tree view.

3. Select files and folders

  1. Use the checkboxes to select the files you want to include.
  2. You can also check a folder to select (or unselect) all files and subfolders inside it.
  3. Only real files are included in the generated context; folders themselves are used only for grouping and selection.

4. Generate context

You can generate context in either of the following ways:

  • Click the Generate Context button in the title bar of the llm-file-selector view.
  • Or run the Generate Context command from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and choose "Generate Context".

When executed, the extension:

  1. Collects all checked items that are files.

  2. Reads their contents from disk.

  3. Builds a single text document with each file represented as:

    File: path/from/workspace/root.ext
    
    // file contents here
    
  4. Opens a Generated Context webview tab showing the final result.

If no files are selected, a warning message is shown instead.

5. Copy the generated text

  1. In the Generated Context tab, click the Copy to Clipboard button.
  2. Paste the copied text into your LLM chat or prompt.

Configuration

This extension currently does not contribute any user settings.
There are no configuration options yet.

Release Notes

0.0.1

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