If you are writing massive codebase, 10k plus, first ask it to give you a detailed technical blueprint of what it wants to do, and a draft set instructions it would give to a senior engineer to follow to create what you want.
Then review the blueprint and then ask it to follow your revised blueprint. Then chunk it into parts 2k to 4k plus lines per output.
It would greatly reduce your errors and you can easily track where it breaks or drifts of course.
From experience there are less errors this way and you can see all parts..