Stop manually copying and pasting files into ChatGPT, Claude, and DeepSeek.
REPO2STR is a professional, security-first Context Manager designed to bridge the gap between your codebase and Large Language Models. It visualizes your repository, calculates token usage in real-time, and packages your code into optimized formats (XML, Markdown) specifically tuned for modern AI context windows.
🚀 Key Features
🛡️ Enterprise-Grade Security
Designed for sensitive environments.
100% Local Processing: Your code never leaves your machine until you copy/paste it. No API calls to third-party servers.
Strict Path Validation: Prevents path traversal attacks within the Webview.
Unique to this extension is the ability to separate file existence from file content.
👁️ Open Eye: The file is fully read. The AI sees the path and the code.
👁️ Slashed Eye: The file is referenced only. The AI sees the file exists in the directory tree structure but does not see the code.
Use Case: Show the AI your node_modules structure or images folder without wasting 10k tokens on their contents.
⚡ optimized Formats for 2025 LLMs
XML (Default): The gold standard for Claude 3.5 Sonnet and Opus. Uses robust <codebase_context> tags to clearly separate your code from your prompt instructions.
Markdown: Best for GPT-4o and DeepSeek. Uses "Dynamic Fencing" to ensure code blocks are never broken, even if your source code contains backticks.
Basic: A minimal path: content format for smaller models or raw text processing.
🛠️ Developer Workflow
Git Integration: Instantly select only your Modified or Staged files with one click.
Live Token Counter: Real-time token estimation (calibrated to ~3 chars/token) displayed in the footer.
Prompt Engineering: Built-in collapsible prompt box to prepend instructions (e.g., "Refactor these files using the Factory pattern").
Restore (v1): Paste/edit generated output and safely restore files back into your workspace with preview, diff, and optional backup.
Export Options: Copy to Clipboard, Download (.txt), or Export as .zip.
📖 How to Use
Open: Right-click a folder in Explorer and select Generate Repository Context, or run repo2str.open from the Command Palette.
Select:
Use checkboxes to select files.
Toggle the Eye Icon to choose between "Content" vs "Structure Only".
Instruct: (Optional) Type instructions in the top bar. Click the arrow to expand/collapse the input area.
Generate: Select your format (XML recommended) and click Generate.
Export: Use the toolbar icons to Download, Copy, or Clear.
⚙️ Configuration
Access the Settings Panel via the gear icon in the toolbar.
Setting
Description
Content Exclusion Patterns
Glob patterns for files that should appear in the tree but default to "Hidden Content" (Slashed Eye). Useful for .env, package-lock.json, etc.
Hide Excluded Files
If checked, files matching the patterns above will be completely removed from the view instead of just having their content hidden.
Use External Icons
Toggle between lightweight offline icons (default) and rich Material Design icons (requires internet connection).
⌨️ Shortcuts & Tips
Drag the Sashes to resize the file tree.
Regex Search: Click .* in the search bar to switch from plain text to Regex mode.
Quick Expand: Click the arrow next to the prompt input to instantly expand it to 50% height.