How to use Claude Code for big tasks without turning your code to shit

I find myself using LLMs for coding in 4 specific ways: 1. Finding information 2. Rubber ducking 3. Generating snippets of code or documentation 4. Having it work for hours on a big task with minimal intervention