VSCode extension that lets you copy code to share (or prompt with)

3 hours ago 2

# Copy Code Context

GitHub issues

Copy files or folder trees into your clipboard as Markdown—ready to paste into chats, docs, or code reviews.

UsageFeaturesSettings


🚀 Usage

  1. Explorer

    • Select one or more files or folders → right-click → Copy Code Context
    • Select a root folder → right-click → Copy Folder Structure
  2. Editor Tab

    • Right-click a tab title → Copy Code Context (This Tab) or … (All Open Tabs).
  3. Paste anywhere and your Markdown snippet or tree is on the clipboard


✨ Features

📄 Copy Code Context

  • Explorer: grab paths + syntax-highlighted code blocks
  • Tabs: copy the active file or all open files at once (Unsaved buffers (Untitled) are skipped)
  • Respects include/exclude globs, VS Code Explorer excludes & (opt-in) .gitignore

Copy Code (Explorer)

copy-code-explorer

Copy Code (Tabs)

copy-code-editor

📂 Copy Folder Structure

  • Generates a Markdown tree of your folder’s contents
  • Respects the same filters (globs, Explorer excludes, .gitignore)

Copy Folder Structure

copy-folder-structure


🔧 Settings

Setting Default Description
copyContext.template // {path}\n{content} Markdown template for text files ({path}, {content}).
copyContext.excludeGlobs [] Always exclude these glob patterns (highest priority).
copyContext.includeGlobs [] Always include these glob patterns, even if Explorer or .gitignore would skip them.
copyContext.maxContentSize 500000 Max total size (bytes) of all file contents to copy.
copyContext.respectVSCodeExplorerExclude true Skip files/folders hidden by your VS Code files.exclude settings.
copyContext.respectGitIgnore false Skip files matching your project’s .gitignore (opt-in).

📜 License

This extension is released under the MIT License.

Read Entire Article