I'll often move around in the course of a work day, from my basement office where I have a second external monitor, to the patio and so on. When I unplug my external monitor, any windows I have on it gather on my MacBook Pro's screen -- this is great.
But when I plug my external monitor back in the windows cluster up on the external monitor (I have the external set to be primary when it's present).
Is there an app that can save window states and restore them when ever I plug my external monitor back in? Bonus points if it can also handle putting windows on separate spaces when I unplug my external monitor and lose screen real estate.