When claude or codex does something other than what you want, instead of getting mad at it, ask it what it saw in your prompt that led it to do what it did, and how should you have prompted it to achieve what you wanted. This process tends to work very well and gives you the tools you need to learn how to prompt it to achieve the results you want.