Ask it in your prompt to run pre-commit and the tests when checking things are good.
You can also add a plan exit hook to Claude Code - mine has like 150 bullet points about what I want to see in plans. The first run blocks (exit 2 with a message about what’s expected in a plan); the second run always goes through. So the agent is given plan feedback exactly once and told to go back and make it better. Anything I have to say to it in response to a plan it generates, I think hard about (or ask the agent about) and add that as a new bullet point - and then the plan exit hook is 151 bullet points and I never have to tell the agent that thing again. Working great so far!