There are ways to reign it in, so it doesn't break existing code (too often). For example, entering plan mode, forcing it to write tests, and making sure it commits all atomic changes to git, with good commit messages, so you can revert when it goes astray.
Also, I strongly recommend having it write out a "status" or "handover" markdown file periodically. That way, you can exit, start again, and have a clean context to start from. Massively reduces hallucinations. HTH HAND :D