How telling your coding agent to read relevant code before acting improves results
One thing I found really useful recently when working with Claude Code or Codex CLI: telling it to read the code you're about to investigate or change before giving it specific direction.
I'm using both Claude code and codex CLI pretty heavily right now. Claude code is still my daily driver with Codex CLI sprinkled in for gnarly challenges.
When I was using Cursor as my daily driver a few months back, to get good results I would go and find all the relevant files to what I was doing and load them into context.
One nice thing about Claude Code is that it does that part for you: it searches the code base, figures out what you're trying to do, and you don't have to specify individual file names.
But, what I've also found is that if you tell the agent to read a specific part of the code base before acting so it loads more of the right stuff into context, it often gives you a better result. Less work than finding all the individual files you need, but still one extra step.
I'm finding, especially this week with Sonnet 4.5, it might even find and suggest fixes to the problem I'm looking into before I ask it to. It doesn't always do it, but it's a nice bonus when it does.
I've also found that sometimes this is a good time to use one of magic think phrases like "think hard" just to give it a little more context before trying to solve the problem.
Give that a shot and see if your results improve like mine have.
Follow along as I build and share what I learn
Found this helpful? Share it with your network!