Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Context Bundle for AINew to Visual Studio Code? Get it now.
Context Bundle for AI

Context Bundle for AI

Felerv0

|
2 installs
| (1) | Free
Bundle complete project files and exact code selections into clean context for AI assistants.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Context Bundle for AI

Copy complete files and exact code selections into clean, structured context for AI assistants — without manually opening, copying, and labeling every file.

Context Bundle for AI uses VS Code's native file picker, searches the entire workspace, supports unsaved editor content, and can copy the result to the clipboard or save it as a text file.

Features

  • Native VS Code file picker with a strong filename and a dimmed, searchable path.
  • Complete workspace search without silently limiting the list to the first N files.
  • Multi-file selection from the Explorer, editor, or Command Palette.
  • Add all open files with one picker button.
  • Partial file context that stores exact snapshots of selected code.
  • Full-file override: selecting a partial file includes its current full content instead.
  • Relative or absolute paths, switchable directly from the picker.
  • Custom file separator configured in VS Code Settings.
  • Clipboard and file output.
  • Unsaved editor support for complete open files.
  • Binary and oversized-file protection.
  • Multi-root workspace support.

Quick start

  1. Right-click a file, folder, or editor and choose Copy Context For AI.
  2. Search for files by filename or directory path.
  3. Select any complete files you want to include.
  4. Optionally use the toolbar buttons to add every open file or switch path style.
  5. Press Enter.
  6. Choose Copy to clipboard or Save to file.

You can also launch Copy Context For AI from the Command Palette.

Output format

Complete files are emitted as a path, a blank line, and the current file content:

src/example.ts

export const answer = 42;

Files are joined using the configured separator. The default separator is:


---

No extra Path: or Content: labels are added.

Partial file context

Partial context is disabled by default. Enable:

Context Bundle for AI: Add Partial Content Function

Then select code in an editor, right-click it, and choose Add Selection to AI Context. Multiple selections and repeated additions are supported.

Each selection is stored as an exact text snapshot. Later edits to the source file do not change previously stored partial content.

A partial selection is emitted using a GitHub-style line anchor:

src/example.ts#L15-L28

export function calculateTotal() {
  // Exact selected content
}

For a single line:

src/example.ts#L15

export const answer = 42;

Files with stored fragments show a blue selection icon in the picker. Hover over the icon to see Partial.

  • Leave the file unchecked to include its stored partial selections.
  • Select the file to include its current complete content and suppress its partial selections in that output.
  • Use the Clear partial file context toolbar button to delete every stored fragment for the current workspace.

Partial snapshots are stored locally in VS Code's workspace storage, not inside your project.

Settings

Setting Default Description
aiContext.pathStyle relative Writes paths relative to the workspace or as absolute file-system paths.
aiContext.exclude Common dependency and build folders Glob for files and directories hidden from the picker.
aiContext.fileSeparator \n\n---\n\n Text inserted between context sections. Supports \n, \r, and \t.
aiContext.maxFileSizeKB 1024 Maximum size of one complete file or one partial selection.
aiContext.addPartialContentFunction false Enables persistent partial-file context and its context-menu command.

Example custom separator in settings.json:

{
  "aiContext.fileSeparator": "\\n\\n===== NEXT FILE =====\\n\\n"
}

Commands

Command Purpose
Copy Context For AI Opens the file picker and builds the context.
Add Selection to AI Context Stores selected editor text when partial context is enabled.

Installation from VSIX

  1. Open the Extensions view in VS Code.
  2. Choose Views and More Actions... (...).
  3. Select Install from VSIX....
  4. Choose context-bundle-for-ai-1.0.0.vsix.

Development

npm install
npm test
npm run package

Press F5 in VS Code to launch an Extension Development Host.

Privacy

Context Bundle for AI does not send files, selections, or telemetry anywhere. It only reads the files you choose and writes to the clipboard, a destination you select, or VS Code's local workspace storage.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft