From analyze-codebase
Scans project structure, configs, and source code to produce a comprehensive analysis and documentation of the entire codebase.
How this command is triggered — by the user, by Claude, or both
Slash command
/analyze-codebase:analyze-codebaseFiles this command reads when invoked
This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# Comprehensive Codebase Analysis ## Project Discovery Phase ### Directory Structure !`find . -type d -not -path "./node_modules/*" -not -path "./.git/*" -not -path "./dist/*" -not -path "./build/*" -not -path "./.next/*" -not -path "./coverage/*" | sort` ### Complete File Tree !`tree -a -I 'node_modules|.git|dist|build|.next|coverage|*.log' -L 4` ### File Count and Size Analysis - Total files: !`find . -type f -not -path "./node_modules/*" -not -path "./.git/*" | wc -l` - Code files: !`find . -name "*.js" -o -name "*.ts" -o -name "*.jsx" -o -name "*.tsx" -o -name "*.py" -o -name "*.jav...
!find . -type d -not -path "./node_modules/*" -not -path "./.git/*" -not -path "./dist/*" -not -path "./build/*" -not -path "./.next/*" -not -path "./coverage/*" | sort
!tree -a -I 'node_modules|.git|dist|build|.next|coverage|*.log' -L 4
find . -type f -not -path "./node_modules/*" -not -path "./.git/*" | wc -lfind . -name "*.js" -o -name "*.ts" -o -name "*.jsx" -o -name "*.tsx" -o -name "*.py" -o -name "*.java" -o -name "*.php" -o -name "*.rb" -o -name "*.go" -o -name "*.rs" -o -name "*.cpp" -o -name "*.c" | grep -v node_modules | wc -ldu -sh . --exclude=node_modules --exclude=.git --exclude=dist --exclude=buildls package-lock.json 2>/dev/null || echo "Not found"ls yarn.lock 2>/dev/null || echo "Not found"find . -name ".env*" -type ffind . -name "Dockerfile*" -o -name "docker-compose*"find . -name "*.yaml" -o -name "*.yml" | grep -E "(k8s|kubernetes|deployment|service)"find .github -name "*.yml" -o -name "*.yaml" 2>/dev/null || echo "No GitHub Actions"find . -name "main.*" -o -name "index.*" -o -name "app.*" -o -name "server.*" | grep -v node_modules | head -10find . -path "*/routes/*" -o -path "*/controllers/*" -o -path "*/api/*" | grep -v node_modules | head -20find . -path "*/models/*" -o -path "*/schemas/*" -o -path "*/entities/*" | grep -v node_modules | head -20find . -path "*/components/*" -o -path "*/views/*" -o -path "*/pages/*" | grep -v node_modules | head -20find . -name "*database*" -o -name "*db*" -o -name "*connection*" | grep -v node_modules | head -10find . -path "*/migrations/*" -o -path "*/migrate/*" | head -10find . -path "*/seeds/*" -o -path "*/seeders/*" | head -10find . -name "*test*" -o -name "*spec*" | grep -v node_modules | head -15find . -name "*api*" -name "*.md" -o -name "swagger*" -o -name "openapi*" | head -10@README.md @LICENSE @.gitignore
!find . -name "index.js" -o -name "index.ts" -o -name "main.js" -o -name "main.ts" -o -name "app.js" -o -name "app.ts" -o -name "server.js" -o -name "server.ts" | grep -v node_modules | head -5 | while read file; do echo "=== $file ==="; head -50 "$file"; echo; done
Based on all the discovered information above, create a comprehensive analysis that includes:
For each major directory, explain:
Organize by category:
If applicable, document:
Explain:
Document:
List and explain:
Create a comprehensive diagram showing:
Use ASCII art, mermaid syntax, or detailed text representation to show: ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ Frontend │────▶│ API │────▶│ Database │ │ (React/Vue) │ │ (Node/Flask) │ │ (Postgres/Mongo)│ └─────────────────┘ └─────────────────┘ └─────────────────┘
Provide:
Think deeply about the codebase structure and provide comprehensive insights that would be valuable for new developers joining the project or for architectural decision-making.
At the end, write all of the output into a file called "codebase_analysis.md"
4plugins reuse this command
First indexed Jan 1, 2026
npx claudepluginhub danielmiessler/marketplace --plugin analyze-codebase/analyze-codebaseScans project structure, configs, and source code to produce a comprehensive analysis and documentation of the entire codebase.
/map-codebaseAnalyzes codebase using parallel Explore agents to produce structured codebase documents in .planning/codebase/. Optionally focus on a specific subsystem.
/generate-mapAnalyzes the entire codebase and generates a structured project-map.md overview covering tech stack, structure, API, database, frontend, infrastructure, and testing.
/exploreScans a project's root config, directory structure, tech stack, entry points, and CI/CD setup to produce a structured overview of the codebase.
/deep-code-analysisAnalyzes codebase with structure mapping, documentation research, pattern detection, security review, performance assessment; generates Markdown report. Supports focus areas like security via arguments.
/bootstrap-repoExplores the current repository with 10 parallel subagents to produce a CODEBASE.md document containing full architecture analysis, dependency inventory, data layer, API surface, and more.