Not sure if it would work for you, but a friend of mine who was noticing something similar has joked on numerous occasions that what ended up working for him to get out of that funk was going on long walks and talking to himself, literally. Framing problems out in his head and then talking out solutions or different approaches or whatever out loud. The joke being that he regained his sanity by looking like a crazy person, but if it works...
Probably easier to do if you live near some woods, lest your neighbors try to have you committed.