The trick is to ask it to do more narrow tasks and design the structure of the code base yourself.
It also helps to tell it to write tests first: I lean towards integration tests for most things but it is decent at writing good unit tests etc too. Obviously, review is paramount if TDD is going to work.