📦 Selective Context — VS Code Extension for LLM Prompting

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
- Select Files: In the VS Code explorer, select the files or folders you want.
- Right-click → Concatenate Files
- Preview the output: A webview opens.
- Write your intent: Add a description of what you're asking the LLM.
- Choose your format (YAML or XML)
- Click Copy 📋: Paste directly into your favorite model.
- 🗂️ 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
#AI #LLM #PromptEngineering #VSCode #YAML #XML #ChatGPT #DevTools #ContextIsKing