Interesting. Two thoughts:
1. Are you using the latest frontier models? I know that feeling: "These things are creating some wild code. Then sticking to its guns in some cases and just rewriting the same bug over and over." But that was a few months ago. With Opus 5.5, it's gone.
2. For debugging, I give Claude read-only access to the prod DB, and it has access to logs and traces (Signoz in our case). With this, it has amazing debugging skills. Orders of magnitude faster than myself, and it has yet to fail finding the cause of an issue.