Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Context PurgerNew to Visual Studio Code? Get it now.
Context Purger

Context Purger

sdooodly

|
2 installs
| (0) | Free
Minify and copy code to clipboard for AI context, stripping comments and whitespace.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Context Purger

A VS Code extension that minifies code and copies it to the clipboard, optimized for pasting into LLM contexts.

Features

  • Strip comments — Removes //, /* */, #, and <!-- --> style comments while preserving URLs and string literals.
  • Remove empty lines — Collapses whitespace so you send only meaningful code.
  • Markdown-wrapped output — Each file is wrapped in a fenced code block with the correct language identifier.
  • File tree map — Optionally prepends an ASCII tree so the AI understands your project structure at a glance.
  • Token estimation — Shows a status bar indicator with approximate tokens saved.
  • Smart filtering — Automatically skips node_modules, .git, dist, build, lock files, and binary files.

Usage

  1. Right-click any file or folder in the Explorer sidebar.
  2. Choose one of:
    • Purge & Copy for AI — Minifies and copies to clipboard.
    • Purge & Copy for AI (with Tree) — Same as above, but includes a file structure overview at the top.
  3. Paste into AI chat.

Ignored by Default

Directories Files
node_modules package-lock.json
.git yarn.lock
dist pnpm-lock.yaml
build composer.lock
.next / .nuxt Gemfile.lock
__pycache__ Cargo.lock
.venv / venv poetry.lock
.cache Pipfile.lock
coverage

Binary files (images, fonts, archives, etc.) are also skipped automatically.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft