I noticed that I found Claude great for squashing bugs/issues, and started using worktrees but saw similar problems as you described, so I enlisted Claude and wrote https://github.com/Someblueman/hydra to solve for this very issue, keeping (or rather trying) it in pure shell for personal portability and gives me a playground for AI driven development