Package clean code context for Codex, ChatGPT, Claude, and other AI coding tools.
This extension is built for developers who want to stop manually copying file paths, selections, and project structure before asking an AI assistant for help.
Why use it
AI coding assistants are much better when you give them clean context:
which file the code came from;
which lines are relevant;
what the project structure looks like;
which open files belong together.
Codebase to AI Context turns that into one clipboard action.
Screenshots
Commands
AI Context: Copy Selection with Path
AI Context: Copy Current File
AI Context: Copy Project Tree
AI Context: Copy Open Editors Context Pack
What it does
Adds file path and line numbers to copied selections.
Wraps code in Markdown fences.
Generates a compact workspace tree.
Packages open workspace files together with the project tree.
Ignores noisy folders such as .git, node_modules, dist, build, .next, out, and coverage.
Adds a per-file character limit for open editor context packs to avoid accidentally pasting huge files.
Usage
Open a project folder in VS Code.
Open the files you want to include.
Run AI Context: Copy Open Editors Context Pack from the Command Palette.
Paste the generated context into Codex, ChatGPT, Claude, or another AI coding assistant.
For smaller questions, select code and run AI Context: Copy Selection with Path.
Settings
codebaseToAiContext.maxTreeDepth
codebaseToAiContext.maxChildrenPerDirectory
codebaseToAiContext.ignoredDirectories
codebaseToAiContext.maxDocumentCharacters
MVP boundary
This extension does not upload your code anywhere. It only reads local workspace files and writes generated context to your clipboard.