CodeContextCodeContext is a VS Code extension for exporting, importing, and sharing developer project context with AI. Turn files, folders, project structure, paths, and Git changes into AI-friendly context. Import generated context back into a workspace when you need to recreate files or project structure. Exports open as editable untitled documents. Nothing is written to your workspace unless you explicitly save or create the files. Why CodeContext?When working with AI coding assistants, you often need to provide more than a single file. You may need:
CodeContext provides these workflows directly inside VS Code instead of making you manually copy files, build folder trees, or assemble Git context yourself. FeaturesExport ContentExport one or more files, folders, or the complete workspace as Markdown containing file paths and contents. Useful for sharing implementation context with AI assistants. Read the Export Content documentation Export Project TreeExport a deterministic project directory tree without reading or including file contents. Useful when an AI assistant needs to understand the structure of a project before working with its files. Read the Export Project Tree documentation Export PathsExport workspace-relative file paths as a structured text document.
Useful for quickly sharing a list of relevant files or feeding paths into another workflow. Read the Export Paths documentation Import ContentPaste CodeContext Markdown generated by an AI or another CodeContext export and recreate or update files in the workspace. Before modifying existing files, CodeContext validates the input and asks for overwrite confirmation. Read the Import Content documentation Import Project TreeCreate directories and empty files from a project tree without changing existing files. Useful for recreating project structure before filling files with content. Read the Import Project Tree documentation Import PathsCreate directories and empty files from a newline-separated path list. Existing files are preserved. Read the Import Paths documentation Route ReportAnalyze the workspace and generate a Markdown report of application routes for supported web frameworks. Supported frameworks: Next.js (App Router and Pages Router) and Nuxt ( Framework detection is automatic. If multiple frameworks are found, a picker lets you choose. Open the editable Markdown report or use Route Report Preview to open it in VS Code's Markdown preview. Read the Route Report documentation Generate Context from PathsPaste a list of workspace-relative file paths and choose what kind of context to generate:
Useful when you already know which files are relevant and want to generate context without navigating the Explorer. Read the Generate Context from Paths documentation Git DiffExport the current Git changes as a patch. Git Diff includes:
From the Explorer context menu, Git Diff can be scoped to one or more selected files or folders. Without an Explorer selection, it operates across the workspace repositories. Read the Git Diff documentation Before/After Git ContextExport the complete file contents before and after the current Git changes. For changed files:
Selections from the Explorer can scope the export to specific files or folders. Read the Before/After Git Context documentation Export and Import WorkflowCodeContext is designed around a simple two-way workflow:
This makes CodeContext useful both for giving project context to AI and for turning structured AI-generated context back into files. UsageAll commands are available from the Command Palette under the CodeContext category. Export commands open editable untitled documents:
Git commands and export commands that support Explorer resources can also be used from the Explorer context menu. Import commands open the shared CodeContext Import panel:
Typical AI workflow
Safety and ValidationCodeContext validates imported paths before creating or modifying files. The extension protects against common unsafe filesystem operations, including:
Existing files are not overwritten silently. Large or binary content is handled conservatively where appropriate, especially for Git context exports. Requirements
CodeContext has no runtime dependencies. Current LimitationsCodeContext currently focuses on project files, structure, paths, Git context, and route reporting for Next.js and Nuxt. Additional routing framework support (React Router, Vue Router, NestJS, etc.) is planned for a future release. Git operations require a Git installation and an accessible repository. Very large or binary files may have their contents omitted from context exports where reading the content is not appropriate. DocumentationDetailed feature documentation is available in the
Architecture and development decisions are documented in: Release0.2.0Added advanced project context workflows and route reporting.
0.1.0Initial public release.
LicenseSee LICENSE. |