Prompt Optimizer for VS CodeA local prompt optimizer, semantic cache, and conversational AI agent � all running inside VS Code without leaving your editor.
🚀 Interactive Visual Onboarding GuideMarkdown renderers (GitHub, Marketplace, VS Code preview) strip
What the live guide gives you that this static page cannot:
The static file lives at vscode-extension/media/onboarding.html — you can also open it directly in any browser if you want to share it. What you'll see (static preview)
What it doesPrompt Optimizer sits between you and Copilot. Before your prompt reaches the model it:
ModesSelect the mode from the Mode dropdown in the sidebar or via the status bar item (
Switch mode any time by:
SDLC modes and agent skillsPrompt Optimizer 2.1.0 includes a built-in SDLC mode layer that can frame the optimized prompt with a role and checklist before it is sent. Built-in modesSlash-triggered modes available out of the box:
If you do not type a slash command, the picker can still activate a mode by scoring prompt intent, keywords, Custom skillsWorkspace skills live in Supported frontmatter fields include:
Skill files hot-reload on the next prompt. The parser tolerates comments, block scalars, quoted regex strings, and inline or block arrays. If a skill fails to load, diagnostics are available from the command palette. Agents button in the sidebarThe
Enabled agents are copied into Sidebar panel � Prompt Optimizer ControlOpen it from the Chat sidebar or press the status bar item.
Send buttonThe circular ? button inside the textarea behaves like the Copilot send button � hover shows the current mode action ("Run Agent � optimize + call Copilot"). Chat participant �
|
| Command | Effect |
|---|---|
@promptoptimizer /mode agent |
Switch to Agent mode |
@promptoptimizer /mode optimize |
Switch to Optimize mode |
@promptoptimizer /mode direct |
Switch to Direct send mode |
@promptoptimizer /memory |
Show stored conversation turns for this workspace |
@promptoptimizer /clear |
Clear conversation memory for this workspace |
@promptoptimizer /context |
Show what local context (files, logs, cache) is available |
Conversation memory
Up to 12 turns per workspace are remembered. Back-references resolve automatically:
Turn 1: "refactor the auth middleware to async/await"
Turn 2: "now add unit tests for it"
? proxy injects "[Continuing from: 'refactor�']" before sending
Analysis table (Optimize mode)
After analyzing a prompt, the result card shows a compact table:
| Row | Values |
|---|---|
| Cost / Saved | Total estimated USD cost � tokens saved |
| Tokens | Raw ? optimized token count � estimated output |
| Cache | exact hit / semantic match (%) / miss |
| Pricing | Input + output cost breakdown |
Below the table, Refinements and the Optimized prompt sit side by side.
Secret detection
If your prompt contains what looks like an API key, token, or private key header, a ?? alert appears in the panel before anything is sent. Patterns detected:
- OpenAI keys (
sk-�) - Anthropic keys (
sk-ant-�) - GitHub tokens (
ghp_�,ghs_�) - AWS access keys (
AKIA�) - PEM private key headers
- Generic
password=,token=,api_key=assignments
Semantic cache
The local SQLite cache stores every prompt you send and builds embeddings for semantic similarity. On future prompts it checks for:
- Exact match � returns the cached optimized version instantly
- Semantic match (= 68% cosine similarity) � returns and boosts confidence score
- Miss � optimizes fresh, writes to cache
The cache is seeded on activation from your git log, Copilot chat history, README, package.json, and AI instruction files (.github/copilot-instructions.md, AGENTS.md, etc.).
Manage via command palette:
Prompt Optimizer: Show Cache StatisticsPrompt Optimizer: Clear Semantic Cache
Privacy & Security
| What | Detail |
|---|---|
| Data processing | 100% on your machine � no cloud backend, no remote API except the Copilot request you approve |
| Prompt storage | Cached locally in a SQLite file on your own disk (promptProxy.dbPath). Never uploaded. |
| Secret scanning | API keys and tokens are detected before any network call and blocked with a warning |
| Telemetry | None. The extension collects zero usage or diagnostic data. |
| Network calls | Only the GitHub Copilot inference request you explicitly send via the VS Code Chat API |
| Open source | Full source available at github.com/PawanDBalapure/prompt-optimizer � audit it yourself |
To verify: open the extension source (
out/extension.js) or the engine source (engine/dist/). Search forhttp,fetch,axios,request� you will find zero outbound calls outside of the Copilot API.
Command palette
| Command | Description |
|---|---|
Prompt Optimizer: Select Mode (Agent / Optimize / Direct) |
Open mode QuickPick |
Prompt Optimizer: Open Chat Participant |
Jump to @promptoptimizer in Chat |
Prompt Optimizer: Focus Control Panel |
Focus the sidebar panel |
Prompt Optimizer: Optimize Clipboard & Cost Forecast |
Optimize whatever is on the clipboard |
Prompt Optimizer: Copy Last Optimized Prompt |
Copy the last result to clipboard |
Prompt Optimizer: Send Last Optimized Prompt To Chat |
Open Chat with last result |
Prompt Optimizer: Show Cache Statistics |
Show entry count, avg confidence, total hits |
Prompt Optimizer: Clear Semantic Cache |
Wipe the local SQLite cache |
Prompt Optimizer: Clear Conversation Memory |
Clear this workspace's conversation history |
Prompt Optimizer: List Agent Skills (Modes) |
Show every registered built-in and custom mode |
Prompt Optimizer: Create / Edit Agent Skill |
Create a workspace skill file or override an existing mode |
Prompt Optimizer: Diagnose Skill Loading Errors |
Open the files that failed skill parsing/loading |
Prompt Optimizer: Manage SDLC Agent Skills |
Enable, disable, edit, or reset the bundled SDLC agent library |
Configuration
| Setting | Default | Description |
|---|---|---|
promptProxy.dbPath |
(global storage) | Custom path for the SQLite cache file |
promptProxy.processingMode |
blocking |
blocking or non-blocking cache lookup |
promptProxy.enableSessionContext |
true |
Feed recent turns back as session history |
promptProxy.pricingInput |
0.0015 |
Input cost per 1K tokens (USD) |
promptProxy.pricingOutput |
0.002 |
Output cost per 1K tokens (USD) |
