Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Claude AI Docs GeneratorNew to Visual Studio Code? Get it now.
Claude AI Docs Generator

Claude AI Docs Generator

Alex Pretorius

|
2 installs
| (0) | Free
Generate thorough, accurate documentation for your codebase using Claude Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Claude Documentation Generator

A VS Code extension that generates thorough, accurate documentation for your codebase using Claude Code (the claude CLI).

Features

  • Multiple Documentation Types: Generate README overviews, API documentation, module docs, inline comments, and architecture overviews
  • Flexible Scope: Document a single file, a folder, or your entire workspace
  • Intelligent Chunking: Automatically handles large codebases by splitting code into manageable chunks
  • Accurate Documentation: Uses carefully crafted prompts to ensure Claude only documents what's actually in the code
  • Progress Tracking: Real-time progress notifications during documentation generation
  • Configurable: Customize paths, chunk sizes, and excluded directories

Prerequisites

1. Claude Code Max Account

This extension requires a Claude Code Max subscription. Claude Code Max provides:

  • Access to Claude's most capable models
  • Extended context windows for processing large codebases
  • Higher rate limits for batch processing

Sign up at claude.ai if you don't have an account.

2. Claude CLI Installation

The claude CLI (Claude Code) must be installed and authenticated on your system.

Installing Claude Code

macOS/Linux:

# Install via npm (recommended)
npm install -g @anthropic-ai/claude-code

# Or using Homebrew (macOS)
brew install claude-code

Windows:

# Install via npm
npm install -g @anthropic-ai/claude-code

Authenticating Claude Code

After installation, authenticate with your Claude account:

claude login

This will open a browser window for authentication. Follow the prompts to complete the login process.

Verifying Installation

Confirm that Claude Code is properly installed and accessible:

# Check if claude is in your PATH
claude --version

# Test with a simple prompt
echo "Hello, Claude!" | claude --print

You should see the version number and a response from Claude.

Troubleshooting PATH Issues:

If claude --version returns "command not found":

  1. Check npm global path:

    npm config get prefix
    
  2. Add to PATH (add to your ~/.bashrc, ~/.zshrc, or equivalent):

    export PATH="$PATH:$(npm config get prefix)/bin"
    
  3. Restart your terminal or source your shell config:

    source ~/.zshrc  # or ~/.bashrc
    

Installation

From VS Code Marketplace (Coming Soon)

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "Claude Documentation Generator"
  4. Click Install

From VSIX File

  1. Build the extension (see Development section below)
  2. In VS Code, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  3. Run "Extensions: Install from VSIX..."
  4. Select the generated .vsix file

From Source (Development)

  1. Clone the repository:

    git clone https://github.com/your-username/vscode-claude-docs.git
    cd vscode-claude-docs
    
  2. Install dependencies:

    npm install
    
  3. Compile the extension:

    npm run compile
    
  4. Open in VS Code:

    code .
    
  5. Press F5 to launch a new VS Code window with the extension loaded

Usage

Generating Documentation

  1. Open a workspace or folder in VS Code

  2. Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)

  3. Type and select "Generate Documentation with Claude"

  4. Choose the scope:

    • Current File: Document only the active file
    • Selected Folder: Document files in a specific folder
    • Entire Workspace: Document all source files in the workspace
  5. Select documentation types (you can select multiple):

    • README Overview: Comprehensive project README
    • Module Documentation: Detailed module/folder docs
    • API Documentation: Public API reference
    • Inline Comments: Add JSDoc/docstring comments
    • Architecture Overview: High-level system design
  6. Wait for generation to complete (progress shown in notification)

  7. Generated files appear in your workspace:

    • README.md in workspace root
    • Other docs in /docs folder

Output Locations

Documentation Type Output Location
README Overview ./README.md
Module Documentation ./docs/{target}-module.md
API Documentation ./docs/{target}-api.md
Inline Comments ./docs/annotated-code.md
Architecture Overview ./docs/ARCHITECTURE.md

Configuration

Access settings via File > Preferences > Settings, then search for "Claude Docs".

Setting Default Description
claudeDocs.claudePath "claude" Path to the claude CLI executable
claudeDocs.maxChunkSize 50000 Maximum characters per chunk when processing large codebases
claudeDocs.outputDirectory "docs" Directory for generated documentation files
claudeDocs.excludePatterns ["node_modules", ".git", ...] Directories/files to exclude from processing

Example settings.json

{
  "claudeDocs.claudePath": "/usr/local/bin/claude",
  "claudeDocs.maxChunkSize": 75000,
  "claudeDocs.outputDirectory": "documentation",
  "claudeDocs.excludePatterns": [
    "node_modules",
    ".git",
    "dist",
    "build",
    "coverage",
    "*.test.ts",
    "*.spec.ts"
  ]
}

How It Works

Architecture

┌─────────────────────────────────────────────────────────┐
│                    VS Code Extension                      │
├─────────────────────────────────────────────────────────┤
│                                                           │
│  ┌─────────────┐   ┌─────────────┐   ┌─────────────┐    │
│  │ extension.ts│──▶│ fileUtils.ts│──▶│  claude.ts  │    │
│  │  (UI/Flow)  │   │ (Traversal) │   │  (CLI Call) │    │
│  └─────────────┘   └─────────────┘   └──────┬──────┘    │
│         │                                     │          │
│         │         ┌─────────────┐            │          │
│         └────────▶│  prompts.ts │◀───────────┘          │
│                   │ (Templates) │                        │
│                   └─────────────┘                        │
│                                                           │
└───────────────────────────┬─────────────────────────────┘
                            │
                            │ stdin (prompt + code)
                            ▼
                    ┌───────────────┐
                    │  claude CLI   │
                    │ (Claude Code) │
                    └───────┬───────┘
                            │
                            │ stdout (documentation)
                            ▼
                    ┌───────────────┐
                    │  Output Files │
                    │ (docs/*.md)   │
                    └───────────────┘

Processing Flow

  1. File Collection: Traverses the selected scope, respecting exclude patterns
  2. Chunking: Splits large codebases into chunks under the token limit
  3. Prompt Construction: Builds structured prompts with code content
  4. Claude Invocation: Sends prompts to Claude CLI via stdin
  5. Chunk Combination: Merges chunk outputs into cohesive documentation
  6. File Writing: Writes documentation to appropriate locations

Prompt Design

The extension uses carefully crafted prompts that:

  • Instruct Claude to document only what's present in the code
  • Prevent invention of APIs or behavior
  • Require explicit uncertainty statements when code is unclear
  • Produce consistent, production-quality output

Development

Building the Extension

# Install dependencies
npm install

# Compile TypeScript
npm run compile

# Watch mode for development
npm run watch

# Package as VSIX
npm run package

Project Structure

vscode-claude-docs/
├── src/
│   ├── extension.ts    # Main entry point, command registration
│   ├── claude.ts       # Claude CLI invocation
│   ├── fileUtils.ts    # File traversal and chunking
│   ├── prompts.ts      # Prompt templates
│   └── types.ts        # TypeScript type definitions
├── package.json        # Extension manifest
├── tsconfig.json       # TypeScript configuration
└── README.md          # This file

Testing Locally

  1. Open the project in VS Code
  2. Press F5 to launch the Extension Development Host
  3. In the new window, open any project folder
  4. Run "Generate Documentation with Claude" from the Command Palette

Future Improvements

Planned Features

  • Incremental Updates: Detect changes and only regenerate affected docs
  • Custom Templates: Allow users to define their own prompt templates
  • Multiple Output Formats: Support for HTML, PDF, and other formats
  • Language-Specific Prompts: Tailored prompts for different programming languages
  • Git Integration: Auto-commit generated documentation
  • Documentation Preview: Live preview of generated markdown
  • Batch Processing: Queue multiple documentation jobs
  • Caching: Cache Claude responses for faster regeneration

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Troubleshooting

Common Issues

"Claude CLI is not available"

  • Ensure claude is installed: npm install -g @anthropic-ai/claude-code
  • Verify it's in your PATH: claude --version
  • Check the claudeDocs.claudePath setting

"No source code files found"

  • Verify the selected scope contains supported file types
  • Check that files aren't in an excluded directory
  • Review the claudeDocs.excludePatterns setting

"Operation timed out"

  • Large codebases may take several minutes
  • Try reducing scope or increasing maxChunkSize
  • Check your network connection

"Rate limit exceeded"

  • The extension includes delays between chunks
  • For very large projects, consider processing folders separately
  • Upgrade your Claude subscription if needed

Getting Help

  • Report issues
  • VS Code Extension Docs
  • Claude Code Documentation

License

MIT License - see LICENSE file for details.


Made with Claude

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