I treat it the exact opposite. I do all of the design and planning and have it crank out code, syntax, and comments smaller pieces at a time.
My typical prompts look like this.
-Write me a function that takes these input params and has these returns. Remember to use functions x, y, and z that we wrote earlier in your solution.
-update this function to change it in this way.
I find asking it bigger picture questions or for bigger changes at once leads to more useless responses.
Also, try claude 3.5. I like the claude 3.5 code context in kagi far more than gpt 4o for code.
Forces me to not spaghetti everything this way and if you add it to your context it will comment as it goes. Both are nice bonuses.