Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>AI Context BuilderNew to Visual Studio Code? Get it now.
AI Context Builder

AI Context Builder

Yisus

|
3 installs
| (0) | Free
Smart context gathering for AI prompts - ChatGPT, Claude, and more
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

AI Context Builder

🚀 Smart context gathering for AI prompts - Automatically analyzes your code dependencies and creates perfectly formatted context for ChatGPT, Claude, and other LLMs.

✨ Features

Core Capabilities

  • Multi-Language Support: JavaScript, TypeScript, Python
  • Smart Import Detection: Automatically finds and includes imported files
  • Dependency Extraction: Identifies npm/pip packages from your code
  • Recursive Analysis: Follows imports up to 3 levels deep (configurable)
  • Token Estimation: Shows estimated tokens with model compatibility

Advanced Features

  • Auto-Exclude Tests: Skips *.test.*, *.spec.*, __tests__ folders
  • File Size Limits: Configurable limit (default 100KB) to avoid huge files
  • Git Integration: Marks recently modified files with *
  • Export Options: Copy to clipboard OR save to file
  • Quick Preview: See summary before copying

AI-Optimized Output

  • Formatted markdown perfect for LLMs
  • Visual file tree structure
  • Separated production/dev dependencies
  • Full source code with syntax highlighting

🎯 Usage

Quick Start

  1. Open any code file
  2. Press Ctrl+Alt+C (or Cmd+Alt+C on Mac)
  3. Choose "Copy to Clipboard" or "View in New File"
  4. Paste into ChatGPT/Claude!

Commands

  • AI Context: Build Context - Quick preview dialog
  • AI Context: Build Context with Preview - Auto-preview
  • AI Context: Export to File - Save as markdown

Right-Click Menu

Right-click anywhere in your code → "AI Context: Build Context"

📦 Example Output

# Code Context for AI

## 📁 File Structure

├── components/Button.tsx \*
├── components/types.ts
└── utils/helpers.ts

## 📦 Dependencies

{
"react": "^18.2.0",
"framer-motion": "^11.0.0"
}

## 📄 Source Files

[Full code of each file]

---

_Context includes 3 files, 2 dependencies_
_📊 ~2,500 tokens (GPT-4, Claude Sonnet ✓)_

* = Recently modified (Git)

⚙️ Configuration

{
  "aiContextBuilder.maxDepth": 3,
  "aiContextBuilder.excludePatterns": ["node_modules", "dist"],
  "aiContextBuilder.includeDependencies": true,
  "aiContextBuilder.excludeTests": true,
  "aiContextBuilder.maxFileSize": 102400
}

🎨 Use Cases

  • Code Review: Full context for AI-powered reviews
  • Debugging: Get help with multi-file issues
  • Refactoring: Ask for suggestions with complete context
  • Documentation: Generate docs from codebase
  • Learning: Understand unfamiliar code faster

🔧 Supported Languages

Language Imports Dependencies
TypeScript ✅ ✅ (package.json)
JavaScript ✅ ✅ (package.json)
React/JSX ✅ ✅ (package.json)
Python ✅ ✅ (requirements.txt)

🐛 Known Issues

  • Git status detection requires git to be installed
  • Large monorepos may take a few seconds

🤝 Contributing

Contributions welcome! Please submit Pull Requests.

📝 License

MIT License


Enjoy smarter AI conversations with full code context! 🎉

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