Workflow
Codebase Understanding
Rapidly map architecture, identify key modules, and understand unfamiliar code before making changes.
Overview
When joining a new project or diving into unfamiliar code, use this workflow to quickly map the architecture, understand dependencies, and identify key modules. Instead of spending days reading code manually, Claude Code can scan the entire repository and provide a structured overview in minutes.
Use this workflow when starting on a new codebase, planning a large refactor, onboarding team members, or investigating a subsystem you haven't worked with before.
Step-by-step process
Start with context
Describe what you're trying to learn and why. This helps Claude focus on relevant parts of the codebase.
Request architecture mapping
Ask Claude to identify core modules, their relationships, and the overall system structure.
Deep dive on critical paths
Once you have the overview, drill into specific flows like data processing, API routes, or state management.
Document your findings
Have Claude generate a summary document with the architecture map, key files, and next steps for your reference.
Example prompts
"This is a Django REST API project. Explain the project structure, where models and serializers live, and how authentication is configured."
"Show me all the code related to the checkout process. What files are involved? How does payment processing work?"
"What are the main external dependencies in this project? Which ones are critical vs nice-to-have? Are there any security vulnerabilities in the current versions?"
"What are the main entry points to this application? Show me where requests come in and how they're routed."
Expected outputs
Architecture diagram
Text-based or markdown representation of the system's major components and their relationships
Key modules list
Annotated list of important directories and files with their purposes and responsibilities
Dependencies overview
Summary of external packages, their versions, purposes, and any potential issues
Data flow documentation
Step-by-step explanation of how data moves through the system for critical user journeys
Next steps checklist
Recommended areas to explore further or potential improvements to make
Best practices
Common pitfalls
Asking to explain everything at once
Solution: Break exploration into logical chunks: auth, then data layer, then UI, etc.
Not providing enough context about your goal
Solution: Be specific: "I need to add a new payment method" vs "explain the codebase"
Ignoring documentation that already exists
Solution: Ask Claude to read existing docs first, then fill gaps or clarify confusing parts
Pro tips
Use glob patterns to focus exploration
""Analyze all files matching src/auth/**/*.ts and explain the authentication strategy""
Ask for comparisons to familiar patterns
""Is this similar to a standard Rails MVC structure or something different?""
Request visual representations
""Create a mermaid diagram showing how these modules interact""
Combine with testing
""Based on the architecture, what unit tests should I read to understand the payment flow?""