Like many/most of us, I've been through this, but by virtue of luck and experience, haven't in a while. I think I've learned to spot the symptoms early enough that I avoid the companies/teams/projects that are on that path.
For those who think this is inevitable and unavoidable in a tech career, take heart in the fact that it's not!