Hi! I play several characters but the most important one for your purposes is Tyrion here.
Currently, Dany has the Iron Throne, Jon Snow and a Northern contingent are in KL to treat with her, and Cersei is hiding in the Westerlands. Our Cersei just came in, so we're still hashing out what she's doing. She's likely going to be captured and put on house arrest, so Jaime could be plotting to free her.
He could use the good will he bought with the Starks by sending Brienne after the Stark girls to prostrate himself in front of the Crown and swear his service (whether Dany would accept it is up to her, obvs), saying that his sister is mad and he had nothing to do with the sept explosion, all the while plotting with her to get her released/her throne back/etc.