Imagine joining a project with 200 files, 40 dependencies, and an architecture nobody has explained to you.
You open the repository.
There's a services folder.
A models folder.
A repositories folder.
Something called core.
Another folder called utils.
And at least three different files named config.py.
Where do you begin?
Most developers naturally start reading code.
One file.
Then another.
Then another.
An hour later, they've discovered twenty interesting functions but still cannot answer a simple question:
What actually happens when a user creates an order?
I think this is where we often approach unfamiliar codebases incorrectly.
We try to understand the entire structure before understanding what the system actually does.
But there's a simpler approach.
Stop reading every file. Start by tracing one request from beginning to end.
The Folder Structure Doesn't Tell the Whole Story
A well-organized project can give us a useful overview.
Consider this Python application:
app/
├── main.py
├── routes/
│ ├── users.py
│ ├── orders.py
│ └── payments.py
├── services/
│ ├── order_service.py
│ └── payment_service.py
├── repositories/
│ ├── order_repository.py
│ └── user_repository.py
├── models/
├── schemas/
├── middleware/
└── utils/
At first glance, the architecture looks understandable.
Routes handle requests.
Services contain business logic.
Repositories manage persistence.
Models and schemas represent data.
But knowing these responsibilities doesn't mean we understand the application.
For example:
What happens when someone submits an order?
Does the application validate inventory?
When does it calculate the price?
Does it process payment immediately?
What happens if the database fails?
Are confirmation emails sent synchronously or through a background worker?
The folder structure cannot answer all these questions.
Architecture tells us where things might be. Execution flow tells us what actually happens.
And that distinction matters.
Step 1: Pick One Meaningful User Action
When exploring an unfamiliar application, I would begin with one real operation.
Not the entire codebase.
Not every dependency.
Not every database model.
Just one action.
For example:
A user clicks "Place Order."
Now our investigation has a clear objective.
We want to understand how that action moves through the application.
A simplified flow might look like this:
User clicks "Place Order"
↓
Frontend sends POST request
↓
API receives request
↓
Request validation
↓
Business rules
↓
Database operation
↓
Response returned
↓
Frontend updates interface
This is only a hypothesis.
We haven't inspected the code yet.
The real application could have authentication middleware, external services, background jobs, or additional validation.
But now we know what we're looking for.
We have a question to answer.
That's much more useful than opening random files.
Step 2: Find the Entry Point
Suppose the application uses FastAPI.
We might discover something like this in orders.py:
@router.post("/orders", status_code=201)
def create_order(
payload: OrderCreate,
service: OrderService = Depends(get_order_service)
):
return service.create(payload)
Illustrative snippet; the model, service, and dependency are defined elsewhere in the application.
Now we have a starting point.
The route accepts a request.
FastAPI validates the incoming data against the request model.
The dependency system supplies a service.
The route calls service.create().
That gives us our first connection:
POST /orders
↓
create_order()
↓
OrderService.create()
We don't need to understand every other route.
We only need to follow this one.
A useful repository search might be:
rg 'create_order|OrderService|/orders' app/
If the project has several routers or prefixes, inspect how they are registered too.
In FastAPI, a route may be defined in one module but included from another using include_router().
The important lesson is to trace the actual registration and execution path rather than assuming the URL maps directly to a filename.
Step 3: Follow the Business Logic
Next, open the relevant service.
Imagine it contains logic resembling this:
`def create(self, payload):
product = self.catalog.get(payload.product_id)
if product is None: raise ProductNotFoundError() if product.stock < payload.quantity: raise InsufficientStockError() return self.repository.insert(payload)` This is a simplified illustration, not a complete order-processing implementation.
But already we know much more about the system.
It checks whether the product exists.
It checks inventory.
It writes an order record.
And it can fail before reaching the database insertion.
Now I would ask some additional questions.
Where does catalog.get() retrieve its information?
Is the stock value current?
Can two users order the last available item simultaneously?
Does repository.insert() participate in a transaction?
Who converts the domain exceptions into HTTP responses?
These questions emerge naturally because we're following a real operation.
Good code exploration should produce better questions, not just more notes.
Step 4: Find Where the Data Changes
This is one of the most important steps.
I want to know where the application actually changes state.
Does it insert a database row?
Update an existing record?
Publish an event?
Call an external API?
Send a message to a queue?
Let's say the service calls:
return self.repository.insert(payload)
That might appear straightforward.
But the repository could perform several operations.
Maybe it creates an order and its line items.
Maybe it reserves inventory.
Maybe it uses a database transaction.
Maybe it publishes an event after committing.
The details matter.
In particular, I would try to identify the boundaries between operations that must succeed together and operations that can happen later.
For example:
Create Order
↓
Validate Inventory
↓
Reserve Inventory
↓
Save Order
↓
Commit Transaction
↓
Publish Order Event
What if the database commit succeeds but the event publication fails?
What if the same request is retried?
What if inventory changes during processing?
These are real engineering questions that you might never discover by reading files alphabetically.
And they reveal how the system handles uncertainty.
Step 5: Follow the Response Back to the User
Many developers stop investigating once they reach the database.
I think that's too early.
The user doesn't see the database.
The user sees an outcome.
So we should trace the response back as well.
What does the API return?
What happens if validation fails?
Does the frontend display the correct message?
Can the user safely retry?
Does the interface show an order confirmation before the operation has actually completed?
Imagine the API returns:
{
"order_id": "ORD-1042",
"status": "created"
}
That looks fine.
But we still need to understand what created means.
Has the payment been authorized?
Has inventory been reserved?
Has the order been committed?
Or has the system merely accepted the request for further processing?
Different applications may define that status differently.
The point is not to assume.
Trace the response until you understand what the user is being promised.
That's how we connect technical behavior with the actual product experience.
Step 6: Use Tests and Traces to Verify Your Understanding
There's an important limitation to reading code.
You may understand what the code appears to do.
But that doesn't guarantee you've discovered everything that happens at runtime.
Middleware might modify the request.
Dependencies might reject it.
A background worker might perform additional operations.
An event handler might trigger another service.
This is where tests, logs, and distributed tracing become useful.
If the project already has tests, look for the one covering the user action you're investigating.
If you have access to an authorized development environment, execute the relevant test and inspect what actually happens.
For more complex systems, distributed tracing can help show how a request travels across components.
For example:
POST /orders
│
├── validate_request
│
├── check_inventory
│
├── reserve_stock
│
├── create_order_record
│
└── publish_event
A tool such as OpenTelemetry can help correlate operations within a trace when the system is instrumented appropriately.
But tracing is not magic.
You only see the spans and information the application records.
Missing instrumentation can leave important work invisible.
The goal is to compare our mental model with observable system behavior.
Reading gives us a hypothesis. Execution provides evidence.
Step 7: Now Make the Change
Once you've traced a meaningful request, modifying the code becomes much easier to reason about.
Suppose the task is:
"Prevent duplicate orders when users retry checkout."
Without understanding the existing flow, you might simply disable the frontend button.
That could help with accidental double-clicks.
But what about network retries?
Concurrent requests?
Background jobs?
By tracing the order workflow first, you know where the state change happens and which component should enforce idempotency.
Now the solution can be based on the real system.
You can identify the files that need changes.
You can predict which behaviors might be affected.
You can write a focused regression test.
And you can avoid changing unrelated components.
This is a much more disciplined way to work.
What About AI-Assisted Code Exploration?
AI can make this process significantly easier.
Instead of manually searching through every file, you can ask a coding assistant to investigate a specific execution path.
For example:
I need to understand what happens when POST /orders is called. Inspect the relevant codebase and: 1. Identify the route entry point. 2. Trace the function calls. 3. Identify input validation. 4. Find where database state changes. 5. List external services and background jobs. 6. Explain error handling. 7. Identify relevant tests. Reference the actual files and functions. Separate verified behavior from assumptions. Do not modify any code. This can be an excellent starting point.
But I would still verify important claims.
AI might overlook a middleware dependency.
It might misunderstand an asynchronous operation.
It might infer a call that doesn't exist.
Or it might describe how the architecture should work rather than how it actually works.
The assistant can help build your mental model.
It should not become the only evidence supporting it.
The Bigger Lesson: Understand the Process Before the Components
There's a reason I find this approach particularly useful.
When looking at complicated systems, we often focus on individual components.
Files.
Classes.
Functions.
Services.
Libraries.
But the value of most applications emerges from how those components work together.
This is also a principle I emphasize in my work at ReThynk AI.
Before optimizing or automating a workflow, we need to understand how the process operates, where decisions happen, and which dependencies influence the outcome.
I've explored that broader principle in Why You Should Fix Your Process Before Implementing AI.
The same idea applies to codebases.
Before changing a component, understand the workflow it belongs to.
Otherwise, we risk improving one part while creating problems somewhere else.
My One-Request Checklist
The next time you encounter an unfamiliar repository, try answering these seven questions:
- Entry point: Where does the request enter the application?
- Validation: Which rules determine whether it's accepted?
- Business logic: Which component makes the important decisions?
- State changes: Where is data created, updated, or deleted?
- External effects: Which APIs, queues, or services are involved?
- Failure behavior: What happens when something goes wrong?
- Outcome: What does the user actually receive or experience?
If you can answer these questions for one important operation, you've established a useful starting model of the system.
You haven't mastered the entire codebase.
You don't need to pretend you have.
But you're no longer navigating blindly.
You Don't Have to Understand Everything to Begin
I think developers sometimes put unnecessary pressure on themselves when joining a new project.
They feel they need to understand the whole architecture before making a meaningful contribution.
But large systems are rarely understood all at once.
Understanding grows through investigation.
One request.
One workflow.
One database operation.
One failure scenario.
One carefully scoped change.
Eventually, those individual paths begin connecting.
You start recognizing shared services.
You understand important dependencies.
You discover the architectural decisions behind the code.
And the repository that initially looked overwhelming begins to make sense.
The objective isn't to memorize the codebase. It's to understand how the system behaves.
So the next time you open a repository with hundreds of files, resist the temptation to read everything.
Pick one meaningful action.
Find its entry point.
Follow the data.
Find the decisions.
Observe the result.
And trace the flow from beginning to end.
Because sometimes the fastest way to understand a large system is to stop trying to understand all of it at once.
A question for fellow developers:
When you join a new project, what's the first thing you investigate?


