AI-powered code archaeologist — autonomously explores your codebase and generates deep architectural documentation.
DeepLens is a desktop + CLI tool that uses Claude Agent to explore code repositories like a senior architect would: identifying business domains, tracing data flows, and producing documentation organized by concepts, not file paths.
Your Code ──► Agent Explores ──► Knowledge Outline ──► You Review ──► Deep Docs ──► VitePress Site
(Claude) (JSON concept map) (HITL) (Hub+Spoke) (local preview)
- Explore — Claude Agent reads your code, identifies 3-8 business domains, maps files to concepts
- Review — You review and adjust the outline (rename, reorganize, approve)
- Generate — Agent writes Hub docs (high-level) + Spoke docs (details) with Mermaid diagrams
- Browse — VitePress site with full-text search, Q&A chat, and MCP integration
| DeepWiki | DeepLens | |
|---|---|---|
| Organization | Mirrors file tree | Business concept grouping |
| Depth | Code listing + shallow description | Data flow analysis + architectural intent |
| Diagrams | Basic class diagrams | Sequence diagrams, flowcharts (dynamic behavior) |
| Human input | None | Outline review before generation |
| Noise handling | Shows everything | Smart simplification (business-first) |
| Runtime | Cloud SaaS | Local (desktop app or CLI) |
- Node.js 20+
- Anthropic API key (for code exploration & doc generation)
- OpenRouter API key (for Q&A search & embedding)
git clone https://github.com/xkcoding/deeplens.git
cd deeplens
npm install
npm run buildcp .env.example .envEdit .env:
# Required: Claude API for exploration & generation
ANTHROPIC_API_KEY=sk-ant-...
# Required for indexing & Q&A
OPENROUTER_API_KEY=sk-or-...# Explore → Review outline → Generate docs → Preview
npx deeplens analyze /path/to/your/project# 1. Explore codebase, output outline JSON
npx deeplens explore /path/to/project
# 2. Generate docs from reviewed outline
npx deeplens generate /path/to/project/.deeplens/outline.json
# 3. Index docs for semantic search
npx deeplens index /path/to/project
# 4. Start preview + Q&A server
npx deeplens serve /path/to/project
# 5. Export static site
npx deeplens export /path/to/project# Start MCP server for Cursor / Windsurf integration
npx deeplens mcp-server --project /path/to/projectDeepLens also ships as a Tauri desktop app with a visual UI:
# Development
npm run dev:tauri
# Build
npm run build:tauri| Command | Description |
|---|---|
analyze <path> |
Full pipeline: explore → review → generate → preview |
explore <path> |
Run exploration agent, output outline JSON |
generate <outline> |
Generate documentation from outline |
preview [docs-path] |
Start VitePress dev server |
index <path> |
Index documentation for semantic search |
serve [path] |
Start API server + VitePress preview |
export [path] |
Build static HTML site |
mcp-server |
Start MCP server (stdio) for IDE integration |
sidecar |
Start sidecar HTTP server (used by desktop app) |
┌──────────────── Desktop App (Tauri) ────────────────┐
│ │
│ Tauri Shell (Rust) ◄──► React Frontend │
│ │
│ ▼ Sidecar │
│ ┌────────────────────────────────────┐ │
│ │ Node.js API (Hono) │ │
│ │ │ Anthropic │
│ │ claude-agent-sdk ─────────────────────► API │
│ │ (explore + generate) │ (Claude) │
│ │ │ │
│ │ Vercel AI SDK ────────────────────────► OpenRouter│
│ │ (Fast Search + Deep Search) │ (Embed+LLM) │
│ │ │ │
│ │ MCP Server ◄─── Cursor/Windsurf │ │
│ └─────────────┬──────────────────────┘ │
│ │ │
│ SQLite + sqlite-vec VitePress (preview) │
└──────────────────────────────────────────────────────┘
| Layer | Technology |
|---|---|
| Desktop | Tauri (Rust) |
| Frontend | React + Tailwind CSS |
| API Server | Hono (Node.js) |
| Exploration & Generation | Claude Agent SDK + Anthropic API |
| Q&A Search | Vercel AI SDK + OpenRouter |
| Vector Store | SQLite + sqlite-vec |
| Documentation | VitePress |
DeepLens generates docs under <project>/.deeplens/:
.deeplens/
├── outline.json # Knowledge outline (concept map)
├── settings.json # Project-level config overrides
├── deeplens.db # Vector index (SQLite + sqlite-vec)
└── docs/
├── index.md # Project overview
├── summary.md # Project summary
├── domains/
│ ├── auth-system/
│ │ ├── index.md # Hub doc (high-level)
│ │ ├── jwt-handler.md # Spoke doc (details)
│ │ └── oauth-flow.md # Spoke doc (details)
│ └── data-pipeline/
│ └── ...
└── .vitepress/
└── config.mts # Auto-generated VitePress config
| Mode | Engine | Best For |
|---|---|---|
| Fast Search | Doc RAG → OpenRouter LLM | Quick questions about architecture, data flows |
| Deep Search | Agent Loop + Code RAG + CoT | Implementation details, edge cases, debugging |
External coding agents (Cursor, Windsurf) can connect via MCP:
| Tool | Description |
|---|---|
get_architecture_map |
Get project architecture overview |
consult_knowledge_base |
Query documentation (Layer 1) |
investigate_implementation |
Deep code analysis (Layer 2) |
visualize_data_flow |
Generate Mermaid data flow diagrams |
# Build TypeScript
npm run build
# Watch mode
npm run dev
# Type check
npm run typecheck
# Build Tauri desktop app
npm run build:tauri