At Caliburn House in 1974 England, it's a dark and stormy night. Inside, psychic Emma Grayling checks with Alec Palmer, who is setting up monitoring equipment. He dismisses the interference as stray FM broadcasts and assures her that he's taken care of it. Alec asks if Emma wants to go through with it again, and she says that "she" is so lonely. Satisfied, Alec begins an audio journal and Emma calls out to the spirit of the Witch of the Well, trying to establish contact. As she offers to bring it home, Alec's equipment overloads and a ghostly figure appears briefly. Emma collapses from the psychic impressions and says that "she" is dead.
There's a knock at the front door and Alec hesitantly answers it. The Doctor jumps out and says that he's looking for a ghost. Clara introduces themselves as ghostbusters and they storm in. The Doctor knows Alec as a major and member of the Baker Street Irregulars, an expert in espionage. Emma isn't aware of Alec's activities and the Doctor explains that Alec's work is classified. Thanks to the Doctor's psychic paper, Alec accepts him as Army Intelligence and the Doctor claims that the Ministry sent him to make sure that everything's in order. He scans the room and then asks them to show him the ghost.
As they search the house, Alec insists that he won't have his work stolen, saying that Caliburn House is his. The Doctor says that they're just there for the mystery and Alec leads them to his study. As the Doctor looks around, Emma explains that she's an empathic psychic. When he talks about her abilities, Emma flinches briefly at his presence. Alec shows them his board with photos and drawings of the Witch of the Well, which has been there for over 400 years. Clara points out that in all of the images, the ghost is always in the same pose. Alec explains that the Witch's presence can only be recorded when a psychic is present. Emma stares at the photos and says that the Witch knows that she's there and is calling to her, begging for help.
The Doctor asks where the Witch's well is, and Alec shows him the oldest plans of the house. There's no known well on the property. The Doctor asks if Clara is coming to find the ghost, and she wonders why she would want to. She finally gives in and Emma directs them to the music room. As they go there, something moves in the shadows, secretly stalking them.
In the main room, Emma asks Alec if the Doctor is really from the Ministry. They both realize that the Doctor is lying and Alec admits that experience can make a liar of anyone. Emma points out that people lie about their feelings and Alec agrees. As she starts to take his hand, Alec pulls back and returns to his work.
In the music room, the Doctor and Clara both feel that they're being watched. The Doctor finds a cold spot and draws a chalk circle indicating its location. He goes running off and Clara runs after him.
Alec's equipment starts to register something.
The chalk circle starts emitting steam.
As the Doctor and Clara move through the house, they hear something knocking loudly. The candles blow out and the windows frost over.
Alec and Emma notice that the temperature is dropping. Emma warns that the Witch is coming.
The knocking continues and the Doctor and Clara see something hiding behind the drapes. They run to the main room just as an oval mirror-like object appears floating in mid-air. As it spins and cracks, Emma sees the Witch appear, apparently standing in a forest. Everyone hears it calling "Help me" and the Doctor snaps a few photos of it before it disappears. The words "Help me" appear on the wallpaper for a few moments and then fade away. The mirror disappears as well.
Clara gets Emma a glass of whiskey to steady her nerves but they decide to have tea. Meanwhile, the Doctor and Alec develop the photos and talk about Alec's espionage activities during the war. The Doctor wonders how a war hero ends up in a lonely house looking for a ghost, and Alec explains that he ordered hundreds to their deaths. Since then, he's been haunted by what he did.
Clara asks Emma what is going on between her and Alec, and Emma explains that psychic empaths sometimes get their signals mixed up and imagine feelings that aren't there. When she wonders how Clara knows, Clara assures her that it's obvious what the two of them are feeling.
Alec tells the Doctor that he was alone and didn't mind dying for the cause. When the Doctor asks what he would say if he could contact the ghosts of his victims, Alec says that he would thank them. They develop the photos and the Doctor admits that he thought the ghost would be fun. He then borrows Alec's camera and leaves the darkroom.
Emma asks what the relationship is between Clara and the Doctor, and warns her not to trust him. She warns Clara that there's a sliver of ice in his heart. The Doctor calls to Clara and they go out to the TARDIS. Clara worries that that the ship doesn't trust her, and the Doctor assures her that it will eventually. The Doctor starts setting coordinates and Clara realizes that they're moving through time but not space. As they depart, Emma and Alec look out into the storm wondering where the newcomers went... unaware that the Witch is standing behind them.
The TARDIS travels six billion years in the past and the Doctor dons a spacesuit to go outside and take photos. They continue moving through time while staying in the same spot, and the Doctor takes more photos. They finally travel into the distant future where Earth is a barren wasteland. Clara realizes that they've seen the entire life cycle of Earth, birth to death, and asks the Doctor if he's okay with that. When he says that he is, Clara realizes that they've traveled to a future where she's long dead and buried, meaning that she's a ghost to him and that everyone he knows must be nothing. The Doctor assures her that she isn't, and that she's is the only mystery worth solving.
The Doctor returns to 1974 and they go back into Caliburn House. Emma realizes that Clara is upset and she says that she realized that everything ends. The psychic says that love doesn't end and glances over at Alec. The Doctor has prepared a slideshow of the photos he took and explains that the Witch is trapped in a place where time runs more slowly. The "Witch" is actually Hila Tarcorian, a pioneer time traveler. Hila crash-landed in a collapsing pocket universe and is focusing on Emma to find her way home. Clara wonders what Hila is running from and the Doctor brings up a new slide of a creature in the background, a crooked man with limbs twisted askew. The Doctor tells Emma that she has to save Hila.
Back at the TARDIS, the Doctor gets rope and a crystal from Metebelis Three. Meanwhile, Alec tells Emma not to do it because Hila isn't as valuable as the psychic. Emma asks him what she's thinking and he says that he can't, but she tells him to look at her. Alec looks at her and smiles, and she says that he read her mind.
As he works, the Doctor explains that he can't fly the TARDIS into a pocket universe and escape. Using a subset of the Eye of Harmony and a group of clocks, the Doctor rigs a power device in the manor and then has Emma don a headpiece containing the Metebelis crystal. It will enhance her psychic abilities and the Doctor assures her it won't hurt. As the Doctor puts on a harness, Emma looks to Alec for reassurance and he nods in agreement with the Doctor. She calls to Hila and the clocks all begin speeding up. The mirror appears again, opening a portal to the pocket universe, and the Doctor explains that the "well" is a wormhole to the other universe.
The Doctor jumps through, the rope playing out behind him. He finally lands in a gloomy forest and ties the rope down, and then runs to the edge of the dimension. Reality is breaking away and he runs through the forest, calling to Hila. Something moves around him but refuse to reveal itself, and Hila calls out. She runs out of the mist and the Doctor says that they have to leave. When Hila warns that there's something in the mist, he tells her to run.
As they run through the mists, the Doctor discovers that the dimensional collapse has consumed the spot where he arrived. He tries to focus on Emma, still calling to him, and runs in that direction. The psychic manages to project an echo of Caliburn House for the Doctor to home in on and he runs inside with Hila. Once the Doctor locks the doors, he hears the Crooked Man outside, looking for a way in. They run to the music room and find the portal, and Hila puts the harness on. She tugs on the rope and Alec pulls her up on the winch.
The Doctor locks the music room door and goes to the portal, but Emma passes out from the pain. First the portal disappears and then the house, and the Doctor finds himself back in the forest... with the Crooked Man lurking nearby.
Clara hears the cloister bell in the TARDIS ring and tells Emma to wake up. Emma apologizes and Alec assures her that she's done enough, but Clara says that the psychic has to do it again. When she realizes that Emma can't help, Clara runs to the TARDIS only to discover that the doors are locked. When she yells at it, an image of Clara herself appears behind her.
Alec tells Emma that he was as lost as Hila but being with her gave him a reason to be. After a moment, Emma gets up and Alec puts the headpiece back on her. Hila comes over and the three of them join hands.
The Clara-image explains that it's the TARDIS voice-visual interface and has chosen the image of someone that Clara esteems. Clara says that it has to go to the pocket universe, but the TARDIS warns that the entropy would destroy it. It disappears and after a few moments, the TARDIS doors open. Clara goes inside and the TARDIS makes the passage between dimensions.
Emma opens the portal and calls to the Doctor. In the pocket universe, the echo of Caliburn House appears again and the Doctor calls out, wondering what the Crooked Man wants. He realizes that it wants his fear, and admits that he is afraid, but figures that it needs him alive so it can go back with him. Realizing it won't kill him, the Doctor runs to the house, daring the Crooked Man to chase him. The creature leaps on him... just as the TARDIS arrives. As it soars by, the Doctor pulls free and grabs his vessel.
As Emma screams in agony, the TARDIS materializes in the room, the Doctor holding to its sides. As Clara comes out, the Doctor makes sure that Emma is okay and looks out the window at the rising sun.
As everyone goes outside, Emma realizes that the Doctor wants to talk to her privately. She says that she knows he came there for her, not the ghost. The Doctor asks her what Clara really is. Emma assures him that Clara is just a girl but the Doctor isn't convinced.
As they go to the TARDIS, Hila explains that the Doctor can't take her back because she was reported missing and was never found. She tells Emma that she knew she was there and wonders if they've met, and the Doctor suggests that Hila is Emma's great-great-great-great granddaughter. The psychic link was so powerful because they were blood relations. Alec wonders what he and Emma are supposed to do now, and the Doctor tells them to hold hands. He then gets an idea and runs back to the manor. Looking up, he sees the Crooked House in an upstairs window, and tells Clara that the monster was yearning for a companion. They haven't lived out a ghost story, but a love story.
Realizing what he has to do, the Doctor asks Emma to open the portal once more. He then goes through to the pocket dimension and tells the Crooked Man that he now understands what it wants. The Crooked Man comes up to it just as Clara pilots the TARDIS back again and the Doctor tells it to get ready to jump.