VS Code Extensions
C

Context Purger

by sdooodly

Minify and copy code to clipboard for AI context, stripping comments and whitespace.

Downloads

3

Rating

— (0)

Version

1.0.0

Last updated

May 07, 2026

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

Related extensions