Stop manually copy-pasting code into LLMs. Impromptu is a powerful VS Code extension designed to help you effortlessly build large, context-aware prompts for any AI model (like GPT-4, Gemini, Claude, and more) directly from your workspace files.
Providing the right context is the key to getting great results from AI. Impromptu makes it trivially easy to select files and folders, include your project structure, and wrap it all with your custom instructions into a single, perfect prompt file.
- ⚡ Dynamic & Interactive File Tree: A custom tree view in the sidebar with checkboxes that automatically updates when you create, delete, or rename files.
- 🖱️ Multiple Ways to Select:
- Check files and folders directly in the Impromptu file tree.
- Use the "Select All" and "Clear Selection" buttons for bulk actions.
- Right-click on any file/folder in the VS Code Explorer or on an editor tab and choose "Add to Impromptu Prompt".
- 📋 Rich & Intelligent UI:
- A main "Generate Prompt" button to kick things off.
- A "Copy" checkbox to automatically send the generated prompt to your clipboard.
- An "ASCII paths" checkbox to include a file structure tree in the prompt.
- A text area for adding last-minute, one-off instructions to the end of the prompt.
- A dynamic character and token-estimation counter that updates in real-time.
- ⚙️ Fully Configurable Engine:
- Use special
.prepend.mdand.append.mdfiles in your project root for reusable instructions. - Customize all prompt templates and headers directly in VS Code settings.
- Use special
- 👁️ Dynamic
.gitignoreFilter:- Automatically respects rules from your project's
.gitignorefile. - A dedicated toggle button in the view's title bar lets you instantly enable or disable the
.gitignorefilter. Your choice is saved per-workspace.
- Automatically respects rules from your project's
- 💾 Persistent State: Your file selections, UI checkbox states, and additional instructions are all remembered across sessions for each workspace.
- Click the new Impromptu icon in the Activity Bar to open the views.
- In the "Project Files" view, use the checkboxes to select the files and folders you want to include.
- In the "Actions" view:
- Check "Copy" to copy the final prompt to your clipboard.
- Check "ASCII paths" to include a tree of your selected file paths.
- Type any final, one-off instructions into the text area.
- Click the "Generate Prompt" button.
- A new file
impromptu_prompt_...mdwill be created and opened. - Paste the result into your favorite LLM and get better, more context-aware answers!
For instructions that you reuse often, you can create special files in the root of your workspace:
.prepend.md: The content of this file is always added to the very beginning of your prompt. Perfect for system prompts or global instructions..append.md: The content of this file is always added to the very end of your prompt (but before any text from the "additional instructions" text area).
Use the buttons in the "Actions" view to create and open these files quickly.
Customize Impromptu's behavior by navigating to File > Preferences > Settings and searching for "Impromptu".
-
impromptu.projectStructureHeader- The header text to display above the ASCII project structure tree.
- Default:
--- Project Structure ---
-
impromptu.startOfFilesHeader- Optional header text to insert before the content of the first selected file.
- Default:
--- Start of Files ---
-
impromptu.fileContentTemplate- The template used to wrap each selected file's content. Use
{filePath}and{fileContent}as placeholders. - Default:
--- Start of {filePath} --- {fileContent} --- End of {filePath} ---
- The template used to wrap each selected file's content. Use
We welcome contributions! If you're interested in helping improve Impromptu, please feel free to open an issue or submit a pull request on our GitHub repository.
- Clone the repository.
- Run
yarn installto install all dependencies. - Run
yarn watchto start the webpack bundler in watch mode for both the extension and the webview. - Press
F5in VS Code to open a new Extension Development Host window with the extension running.
The project is split into two main parts:
src/: The main extension backend (TypeScript, Node.js).web/: The frontend UI for the "Actions" view (React, TypeScript).
This extension is licensed under the MIT License.