No. 103 Clarify a request

Deep Dive: Understanding the Codebase

Use when the request is still open and an edit would be a guess

  • Claude Code
  • Codex
  • Cursor
  • Clarify a request

Prompt

# Deep Dive: Understanding the Codebase

Take a step back and deeply understand this codebase by exploring these questions:

## Questions to Investigate

1. **Architecture & Design**
   - How do the different services communicate with each other?
   - What are the key data flows through the system?
   - Are there any circular dependencies or architectural smells?
   - How is state managed across different components?

2. **Integration Points**
   - How do external services and APIs integrate with the application?
   - What's the relationship between different modules and components?
   - How do third-party libraries or services connect to the system?
   - Where are the boundaries between services?

3. **Data Flow**
   - How does data flow from input to processing to output?
   - What data storage solutions are used and for what purposes?
   - How are requests tracked, logged, or monitored?
   - What's the lifecycle of key workflows or processes?

4. **Hidden Complexity**
   - What assumptions are baked into the code?
   - Are there any implicit dependencies?
   - What edge cases might not be handled?
   - Where might performance bottlenecks occur?

5. **Development Experience**
   - What makes development easy or hard in this codebase?
   - Are there patterns that could be extracted or reused?
   - What's missing from the developer tooling?

## Action Items

1. Pick 2-3 questions that seem most important or unclear
2. Use search and code reading to find concrete answers
3. Challenge any assumptions you've made
4. Update your mental model of how the system works
5. Document any surprising findings or insights
6. Note any potential improvements or concerns

Remember: The goal is to build a deeper, more accurate understanding of the system's actual behavior, not just its intended design.

When to use

“Deep Dive: Understanding the Codebase” fits when the request is still open and an edit would be a guess, because it says “Deep Dive: Understanding the Codebase”, and its first written step is “Architecture & Design”.

For “Deep Dive: Understanding the Codebase”, the extra line you type is the requirement those steps ask for, for example “make src/cart.js return 0 on an empty cart and skip a line with no price”, and the file then starts at “Architecture & Design”.

When not to use

Leave “Deep Dive: Understanding the Codebase” unused when the design is already chosen and the next action is an edit, because “Deep Dive: Understanding the Codebase” points the other way

How to run it

Claude Code

Claude Code stores “Deep Dive: Understanding the Codebase” as a Claude command and runs it with that command, putting the requirement in the argument, and CLAUDE.md should not also carry “Deep Dive: Understanding the Codebase”.

Codex

Codex takes “Deep Dive: Understanding the Codebase” as a paste above the task. Leave AGENTS.md unchanged so the next thread does not inherit “Deep Dive: Understanding the Codebase”.

Cursor

Cursor should see “Deep Dive: Understanding the Codebase” only as a chat paste of “Deep Dive: Understanding the Codebase” for this turn. A file at .cursor/rules would keep applying after the turn ends.

Comparison

对比待补

This before-and-after was not run on this machine.

Related

来源:Darin Cassler · https://github.com/cassler/awesome-claude-code-setup/blob/main/commands/understand-codebase.md · MIT · Copyright (c) 2025 Darin Cassler · 2026-12-01