ContextServe is a VS Code extension that generates comprehensive context files from your codebase for Large Language Models (LLMs). It analyzes your selected files and directories, creating structured documentation that helps LLMs understand your codebase better.
Features
Right-click on any file or folder in the explorer to generate a context file
Select multiple files and/or folders for analysis
Context file includes:
Directory structure in tree format
File type statistics
Complete file contents
Generates and opens the file automatically - no need to choose a save location
Works with any programming language or file type
No external dependencies - works out of the box without requiring Python or any other tools
Smart file type detection optimized for:
TypeScript, JavaScript and JSX/TSX files
Modern web frameworks (Vue, Svelte, Astro)
All common programming languages
Configuration and documentation files
Installation
From VS Code Marketplace
Open VS Code
Go to Extensions (Ctrl+Shift+X)
Search for "ContextServe"
Click "Install"
From VSIX File
Download the latest .vsix file from the Releases page
In VS Code, go to Extensions (Ctrl+Shift+X)
Click the "..." menu at the top of the Extensions view
Choose "Install from VSIX..."
Select the downloaded .vsix file
Requirements
VS Code 1.60.0 or higher
Usage
Select one or more files and/or folders in the Explorer view
Right-click and select "ContextServe - Generate Context" from the context menu
Wait for the process to complete (progress is shown in a notification)
The generated context file will open automatically in a new editor tab
Using in Your Prompts
The generated context file is optimized for use with LLMs like GPT-4, Claude, or other AI assistants. Here are some tips:
For small to medium projects, you can include the entire context file in your prompt
For larger projects, you may want to selectively copy relevant sections
When sharing with an LLM, explain that the file provides context about your codebase
How It Works
ContextServe analyzes the directory structure and reads file contents. The generated context file includes:
A header with information about the analyzed files/directories
A directory tree visualization showing the structure
Statistics about file types and counts
The full content of each file (subject to size limits)
Files are properly organized and labeled, making it easy for LLMs to understand the relationships between files and their content.
Extension Settings
This extension doesn't have any configuration settings at the moment. Future versions may add customization options.
Known Issues
Large directories may take time to process
Improved detection of text-based source code files in v0.1.2
Development
Building From Source
Clone the repository
Run npm install to install dependencies
Make your changes
Use npm run package to create a VSIX file
License
This extension is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.