After the Doctor plucked Clara away from her death by the Quantum Shade through the use of an extraction chamber, they retreated into the Matrix, where they were followed by the General, Ohila and Gastron. Clara distracted the Time Lords while the Doctor escaped, made his way to the workshop below the Cloisters where he had stolen his own TARDIS and stole this one. He then piloted it back in time a few minutes to materialise around Clara to rescue her.
They then took the TARDIS to the very end of the universe, where the Doctor found Ashildr waiting in a chair, a chessboard set up for when the Doctor arrived. They discussed the Hybrid, and Clara used the sonic sunglasses to activate the scanner and listen in on the conversation. She learned that the Doctor intended to wipe her memory of him so that she could live a normal life again and not be found by the Time Lords. The Doctor later entered the TARDIS with Ashildr, and Clara indicated that she had used the sunglasses to "reverse the polarity" of the memory-wiping device. not knowing which one of them wold lose their memory of the other, both Clara and the Doctor held the device. The Doctor ended up wiping his own memory of Clara. After he was unconscious, they piloted the TARDIS to Nevada, and dropped him off, before depositing the TARDIS nearby and disguising it as a North American diner. Later, the Doctor arrived at the supposed diner and went in. Clara, knowing that he didn't remember her, gave him a lemonade and had him tell the story of his adventures on Gallifrey.
When the story was done, Clara opened part of the wall and stepped back into the console room, where Ashildr was waiting. They dematerialised, depositing the Doctor's TARDIS with the Doctor. Ashildr told Clara she couldn't get the chameleon circuit working, so the TARDIS was stuck looking like a diner. Clara said that was "awesome," and decided that she needed to return to Gallifrey to be sent back to die as her death was a fixed point in time. However, as she was now effectively immortal, she decided that she had a little "wiggle room" and took off from Nevada, stating that their destination was Gallifrey, "the long way around", implying that Clara and Ashildr would use the TARDIS to have their own adventures before returning to Gallifrey.