LegacyDoc AI
AI-powered documentation generator for legacy codebases.
Stop struggling with undocumented legacy code. LegacyDoc AI analyzes your code and generates comprehensive documentation — JSDoc comments, Markdown docs, and Mermaid architecture diagrams — in seconds.

Features
Document Any Code — Instantly
- Select code → Right-click →
Document Selection — document exactly the code you need
- Right-click any file →
Document This File — full file documentation
- Right-click any folder →
Analyze Project — generate a complete project overview (Pro)
- Sidebar panel → Quick-access buttons with live progress tracking
Three Output Modes
- Inline — JSDoc/docstring comments added to your code via safe diff preview (review before accepting)
- Markdown — Standalone
.docs.md file with function docs, usage examples, and architecture overview
- Both — Get inline comments AND a Markdown reference file
Project-Level Analysis (Pro)
Go beyond single files. Analyze your entire project structure and generate a comprehensive PROJECT.md that includes:
- Project overview and tech stack detection
- Architecture diagram (Mermaid)
- Directory structure explanation
- Key files and data flow documentation
- Configuration and environment guide
Perfect for onboarding new developers or giving AI coding assistants (Claude Code, Cursor, Copilot) full project context.
Architecture Diagrams
Automatically generates Mermaid flowcharts showing module relationships — with built-in syntax validation to ensure diagrams always render correctly.
Safe Diff Preview
Inline documentation is shown in a diff editor so you can review every change before accepting. Your original code is never modified without your approval.
Multi-Provider AI (BYOK)
Bring your own API key. Your code goes directly to your chosen provider — no intermediary servers.
| Provider |
Models |
Best For |
| Anthropic |
Claude Sonnet 4.6, Opus 4.6, Haiku 4.5 |
Best code understanding |
| OpenAI |
GPT-5.4, GPT-5.4-mini |
Fast and capable |
| Google |
Gemini 2.5 Flash, Gemini 2.5 Pro |
Cost-effective |
| xAI |
Grok 4-1 |
Alternative option |
| Custom |
Any model |
Local LLMs, Azure OpenAI, etc. |
Built for Legacy Code
Unlike general AI assistants, LegacyDoc AI is purpose-built for legacy codebases:
- Preserves original code style and conventions — never modernizes or refactors
- Documents what code actually does, not what it should do
- Flags potential issues as documentation notes, not code changes
- Streaming progress with real-time sidebar updates
Getting Started
- Install the extension from VS Code Marketplace
- Open Command Palette →
LegacyDoc AI: Set API Key
- Choose your AI provider and enter your API key
- Right-click any code file →
LegacyDoc AI: Document This File
Free vs Pro
| Feature |
Free |
Pro ($29 one-time) |
| Daily generations |
5 |
Unlimited |
| Inline JSDoc/comments |
✅ |
✅ |
| Markdown docs |
✅ |
✅ |
| Mermaid diagrams |
✅ |
✅ |
| Project-level analysis |
— |
✅ |
| Custom prompt templates |
— |
✅ |
Get Pro →
Settings
| Setting |
Description |
legacyDocAi.provider |
AI provider (anthropic, openai, gemini, xai, custom) |
legacyDocAi.outputMode |
Output format (inline, markdown, both) |
legacyDocAi.anthropicModel |
Anthropic model (default: claude-sonnet-4-6) |
legacyDocAi.openaiModel |
OpenAI model (default: gpt-5.4) |
legacyDocAi.geminiModel |
Gemini model (default: gemini-2.5-flash) |
legacyDocAi.customBaseUrl |
Custom OpenAI-compatible endpoint URL |
legacyDocAi.customModel |
Custom model name |
legacyDocAi.licenseKey |
Pro license key |
legacyDocAi.customPrompt |
[Pro] Custom system prompt |
Supported Languages
JavaScript, TypeScript, Python, Go, Java, Ruby, Rust, C/C++, C#, PHP, Swift, Kotlin — and any language your AI provider supports.
Security & Privacy
- API keys stored in your system keychain via VS Code's
secrets API — never in plain text
- Your code is sent directly to your chosen AI provider — zero intermediary servers
- No telemetry — we don't collect or store your code
- BYOK model — you control which AI provider processes your code
Feedback & Issues
Made with AI, for developers drowning in legacy code.