All articles

Read-Only Exploration of an Unfamiliar Codebase

The best time to use plan mode is the first hour in a codebase you have never seen. It is read-only, so you can let Claude roam and explain without any risk of it changing something you do not yet understand.

Start read-only

Open the project straight into plan mode:

claude --permission-mode plan

Now Claude can read files, search, and follow how pieces connect, but it cannot edit or run anything that changes state. You are free to ask broad questions without watching for stray edits.

Ask for the map

Begin with orientation, not code changes. Useful opening questions:

  • Where does the app start, and how is it structured?
  • How does data flow from request to response?
  • Where do the tests live and how do I run them?
  • Which files would a change to feature X touch?

Pull specific files into view with @path when you want Claude to ground its answer in real code rather than a guess.

Turn understanding into a plan

Once you have a feel for the layout, aim it at your actual task. Ask for a plan for the change you came to make. Because you are still read-only, you can refine that plan as many times as you need. Correct wrong assumptions about the structure now, while nothing has changed.

Then step out and implement

When the plan matches the code and your intent, approve it. That exits plan mode and Claude begins the work you agreed on. From there you might switch to accept-edits to carry it out smoothly.

Exploring read-only first means your first edits land with a real understanding of the code behind them, not a hopeful guess.

Comments

Be the first to comment.