Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Selective ContextNew to Visual Studio Code? Get it now.
Selective Context

Selective Context

jfoy

|
4 installs
| (0) | Free
Concatenates selected files into a string format
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

📦 Selective Context — VS Code Extension for LLM Prompting

Selective Context Screenshot

Selective Context is a VS Code extension purpose-built for software engineers using Large Language Models (LLMs) like ChatGPT or Claude. It helps you quickly select source files, add intent context, and export your structured prompt in either YAML or XML — ready to paste into your favorite coding AI assistant.


🚀 What It Does

  • ✅ Select multiple files or folders
  • 📝 Add an intent or prompt context
  • 🧩 Choose output format: YAML or XML
  • 📋 Copy a clean, structured block for your LLM

Whether you're debugging, designing an architecture, or asking the LLM to refactor — this tool helps you precisely define your prompt context.


📸 Example Use Case

Imagine you're debugging an API issue:

intent: |
  Help me debug this problem — when I click the submit button, the API throws a logic error.

files:
  - name: src/webview/generateHtml.ts
    content: |
      import * as fs from 'fs';
      ...

Paste this into ChatGPT or Claude and get accurate results — no formatting headaches.


🧪 How to Use

  1. Select Files: In the VS Code explorer, select the files or folders you want.
  2. Right-click → Concatenate Files
  3. Preview the output: A webview opens.
  4. Write your intent: Add a description of what you're asking the LLM.
  5. Choose your format (YAML or XML)
  6. Click Copy 📋: Paste directly into your favorite model.

💡 Format Tips

  • 🗂️ YAML is great for small-to-medium files and readability
  • 🧾 XML works best for large files and avoids token cutoff issues
  • ✨ We automatically format with CDATA or pipe (|) blocks to preserve structure

🎯 Why Use This?

LLMs perform better when given:

  • Clear intent
  • Structured input
  • Only relevant files

This tool makes building that structure a 10-second task.


📦 Installation

You can install it from the VS Code Marketplace or manually:

git clone https://bitbucket.org/Jason_Foy/selective_context.git
cd selective_context
npm install
npm run compile
npx @vscode/vsce package
code --install-extension selective-context-0.0.6.vsix

🧱 Dev & Build

npm install
npm run compile
npx @vscode/vsce package

🛠️ Roadmap

  • [ ] Add Markdown and JSON output formats
  • [ ] Token counter & truncation helper
  • [ ] Drag-and-drop file UI
  • [ ] Browser-based version

📃 License

See LICENSE.txt


🔖 Tags

#AI #LLM #PromptEngineering #VSCode #YAML #XML #ChatGPT #DevTools #ContextIsKing

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