Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>Contrail – Prompt Enhancer & Context PackerNew to Visual Studio Code? Get it now.
Contrail – Prompt Enhancer & Context Packer

Contrail – Prompt Enhancer & Context Packer

Raj Bagri

|
2 installs
| (0) | Free
Pack only the code that matters into AI prompts, reuse prompt templates and improve prompts before you send them. Works with Copilot Chat, Claude Code and any AI chat.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Contrail for VS Code

Send AI chats only the code that matters, reuse your best prompts, and improve prompts before you send them. Works with GitHub Copilot Chat, Claude Code, or any AI chat you paste into.

Pack for AI: fewer tokens, better answers

Right-click files or folders in the Explorer (or a file's tab) → Pack for AI, then type your question.

  • Skips what shouldn't go to an AI: node_modules, build output, lock files, minified files, binaries, and secret files such as .env and private keys.
  • If the files are bigger than your budget (default 8,000 tokens), keeps the parts most relevant to your question and marks what was cut, e.g. [… 42 lines omitted …].
  • Masks API keys, tokens and card numbers in the code.
  • Shows the saving, e.g. Packed 12 files: ≈7.8k tokens (from ≈46k, 83% smaller), then sends the prompt to the chat, copies it, or opens it in an editor.

The status bar shows the estimated tokens of the current selection or file. Click it to pack that file.

@contrail in Copilot Chat

  • @contrail /pack #file:src/auth.ts #folder:src/session why does the session expire early? trims the attached context, then asks the chat model with only what matters.
  • @contrail /enhance write tests for login rewrites your prompt into a clearer, structured one.

Needs a chat provider such as GitHub Copilot. Every other feature works without one.

Templates

  • Contrail: Insert template (Cmd/Ctrl+Alt+T) inserts a template, asking for each {{variable}}. {{tone|Formal|Casual}} becomes a pick list, {{words=120}} has a default, and {{clip}} is the current selection.
  • Save selection as template stores the selected text as a template.
  • Define your own in settings.json under contrail.templates (Edit templates in settings.json), and export or import them as JSON.

Enhance prompt

Select a prompt (or run Contrail: Enhance prompt, Cmd/Ctrl+Alt+P), answer two or three quick questions (audience, format, length, tone), and get a structured prompt. Runs locally; nothing is sent anywhere.

Settings

Setting Default
contrail.packBudget 8000 Maximum estimated tokens of file content in a packed prompt
contrail.maskInCode secrets secrets, all (also emails and phone numbers) or off
contrail.promptStyle markdown xml structures prompts with XML tags, which Claude prefers
contrail.includeRole true Add a "You are…" line to improved prompts
contrail.templates [] Your templates: [{ "name": "…", "body": "…" }]

Privacy

Packing, masking, templates and the local enhancer run entirely inside VS Code. Text is sent only when you choose to: to the chat you send it to, or, for @contrail, to the chat model your chat provider uses.

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