Clara tells us at the outset that she was born to save the Doctor. To illustrate this, we see bits of her worked into the lives of the previous Doctors, starting from the time the William Hartnell version stole the TARDIS. This, she explains, is how she's the Impossible Girl. Then the story backtracks a bit so that we can see how she got to that point. It begins when Vastra gets word that something bad is going down on Trenzalore, so she convenes a "conference call" with all the Doctor's friends. This includes Jenny, Strax, Clara and the digital version of River Song from the library. While they're discussing what to do, the Victorian friends are abducted by the Whisper Men, who look like Buffy's Gentlemen, but with top hats.
The Doctor drops in on Clara and learns what's happened to their friends. The Doctor realizes he must go to the place of his own grave to rescue them, which is kind of a big no-no in time travel. When they finally get to Trenzalore, they are confronted by the Whisper Men and their progenitor, the Great Intelligence. He, or "it", is disembodied, but assumes the guise of Dr. Simeon so that our villain isn't just an empty space in the middle of the room. He tries to force the Doctor to open his own tomb, which can only be opened by the utterance of the Doctor's true name. The Great Intelligence threatens his friends. The Doctor refuses to budge. The tomb... opens anyway.
It turns out that some remnant of River is still in Clara's mind after the "conference call." She whispered his name to open the tomb to save his friends. Inside, it's not the Doctor's corpse, but a concentration of his past and future timeline. The Great Intelligence, feeling vengeful after being defeated so many times, walks into that timeline to disperse himself into every corner of the Doctor's lives and wreak havoc. Clara suddenly realizes she is meant to go in, as well, and counter the Great Intelligence's effects. This is how she becomes so many echoes of herself, placed strategically throughout the Doctor's lives. Or... something.
The Doctor is somehow able to communicate with River, even though she's digital and entirely in Clara's head. Their goodbye has the feeling of passing the torch, in a way, as the Doctor leaps into his own timeline to rescue Clara. Once there, they meet someone that the Doctor says is a version of himself, but who is not the Doctor. All we know is that he's portrayed by John Hurt. Let six months of speculation begin, and stay tuned for the full weecap.
We begin on Gallifrey, a very long time ago, as the screen tells us. Two fellows in a repair shop hear an alarm go off and check the security camera. "What kind of idiot would steal a faulty TARDIS?" asks one of the follows, referring to one of the metal cylinders on the screen. A moment later, original flavor Doctor ushers Susan (seen from the back only) towards one of the TARDISes. Clara is suddenly there, dressed as we've not seen her before. She calls to the Doctor, with whom she interacts through a combination of repurposed footage and stand-ins. "You're about to make a very big mistake," she tells him.
Next thing you know, she's falling through space and time, telling us she doesn't know where she is. "It's like I'm breaking into a million pieces and there's only one thing I remember: I have to save the Doctor." We see clips of her chasing after other Doctors, her hair and outfits changing to fit the periods. "But he never hears me," she says, then corrects herself: "Almost never." We see Clara the barmaid meeting the Doctor in Victorian London. "I'm Clara Oswald. I'm the Impossible Girl. I was born to save the Doctor."
After the credits, we drop into London, 1893. A madman in a prison recites a poem about somebody called the Whisper Men, stopping only when Madame Vastra appears outside his cell door. He is slated to die for murdering 14 women, but wishes to trade valuable information for his life. Vastra, of course, refuses... until the madman mentions the Doctor. "The Doctor has a secret, you know - he has one he will take to his grave. And it is discovered."
Vastra returns home to tell Jenny of what's transpired. Jenny doesn't want the madman free anymore than Vastra does, but they decide to set up a "conference call" to consult with the others. "I'll send out the invitations, you fetch the candles," Vastra says. "Yes, ma'am," Jenny says to her wife.
Strax is enjoying a weekend off in Glasgow by engaging in fisticuffs with a burly Scotsman. Their fun is interrupted when a young boy pops in to give Strax a telegram. "Conference call," Strax groans when he reads it. The call requires Strax's unconsciousness, so his foe happily obliges by knocking him upside the head with a shovel.
Jenny and Vastra sit at a pentagonal table and light a candle at its center. "Sleep well, my love," Vastra says, holding her hand. They close their eyes and open them again a moment later in a trippy version of the room in which they left their sleeping selves. Strax joins them, grumbling that they interrupted his fight.