Heaven Sent ( TV story ) The episode shows the Doctor dealing with and grieving over the death of Clara Oswald , whom he lost to the Quantum Shade in the previous episode . The vast majority of the episode includes just Peter Capaldi by himself as the Twelfth Doctor , with no other characters present save the veiled figure that menaces him throughout . Jenna Coleman appears only as a manifestation of Clara in the Doctor ' s imagination . The Doctor ' s TARDIS is also absent from this episode , except again in the Doctor ' s imagination . This episode also shows what has been referenced a few times - what is the Doctor like when he ' s all alone ? The episode is notable for a number of truths conceded by the Doctor , with him being inside his own confession dial . It is also notable for showing the Doctor finally finding his way back to Gallifrey since he found out that it was not in fact destroyed in the Time War , but instead placed in a pocket universe . This story takes place over an outstandingly long period of time , seeing the Doctor stuck in a recursive cycle during which he repeatedly perishes and comes back to life . In the following episode , " Hell Bent " , it is estimated that this cycle lasts for four and a half billion years , leaving it with one of the single - longest uninterrupted time spans of any given adventure in " Doctor Who " history . Synopsis . As if the death of his best friend wasn ' t enough , the Doctor ' s situation has only gotten worse . What initially started as an attempt to help clear someone of a false murder charge has evolved into to something much worse . Now trapped in an old rusty castle in the middle of an ocean , the Time Lord is being stalked by a mysterious creature that only pauses when he gives up his deepest secrets . What does this thing want ? And can the Doctor escape and find his way back home ? Plot . As gears turn inside the walls of a castle , a mysterious figure , with blood on his hands , makes his way into a room with a teleporter . He flips a switch and collapses to the ground , his body fading away into dust , as the teleporter activates , materialising the Doctor inside its chamber . The Doctor steps out of the teleporter , looking around the room . He bends down to grasp some of the sand on the ground , the memory of Clara ' s death still fresh in his mind . He then threatens the ones responsible for bringing him there , promising to never stop until he finds them . The Doctor steps out of the teleporter room and into a circular corridor , filled with windows and a monitor . Looking out one of the windows , he sees that he ' s inside the central tower of a castle . He speaks out to whoever captured him , again , mentioning that the technology in the teleporter means he can only have been moved a maximum of one light year from where he was before , and he knows he ' s still in the same time zone he was in before , so all he has to do is wait until nightfall , and then he ' ll be able to use the stars to figure out where he is . Walking down the corridor , he finds a spade , covered in dirt , leaning against one of the walls . He starts shouting again , trying to get the kidnappers to come out and face him . At that moment , the monitor in the corridor activates , showing the Doctor himself on the screen . Seeing that the image is being projected from something outside one of the windows , the Doctor runs over to said window and looks outside . He sees a hooded figure in another window , looking right at him . It is from this figure that the footage on the monitor is coming from . The Doctor backs away from the window in fright , watching as the figure turns and moves away . Looking at the monitor , the Doctor watches as the image moves down a corridor . The Doctor finds the particular corridor , and sure enough , the figure is coming towards him . The Doctor runs down another corridor to a door , but finds the door locked . He turns back in time to see the figure enter the hallway and realises he ' s seen this creature before . He turns back to the door and uses an old trick he knew when he was younger , to form a psychic link with the door , getting it to unlock . He opens the door , only to find a wall . He turns back to see the figure coming closer and closer to him . Unfortunately , he can ' t see a way out of this situation . As the figure reaches for him , the Doctor admits that he is scared of dying , and the figure freezes . The Doctor wonders if this is because of something he said . He notices that even the flies that were buzzing around the figure have also frozen in place . A noise causes him to step over to the window . He watches as the sections of the castle begin to revolve , rearranging themselves . He turns back to the door to see the wall slide open . Running through the new opening , the Doctor finds himself in a bedroom . The Doctor grabs one of the flowers , but freezes when he notices a portrait of Clara sitting on top of the fireplace . He smiles sadly at the picture , before grabbing a miniature magnifying glass , so he can take a closer look , not noticing the nearby monitor . The monitor is showing that the figure is on the move again , and is entering the bedroom . The Doctor deduce s that the painting is very , very old , before noticing a fly on it . He quickly turns and sees the figure . He talks about a time when he was a child . He had seen a dead , old woman , who was covered in veils . It was a hot day , so flies were buzzing around her corpse . The sight of this gave the Doctor nightmares for years . He recognises the figure as that very nightmare . . As he tries to question the Veil , he pulls out petals of the flower , letting them drop to the ground . Avoiding letting the Veil touch him , the Doctor deduce s that the castle is some type of torture chamber , to get information out of him ; whoever did this picked the thing he feared most out of his mind and gave him a tailor - made hell . The Doctor refuses to play along , and runs over to grab a stool , throwing it through a window . " I told you I was scared of dying , and I wasn ' t lying . Advantage me ! " He then jumps through the window himself , falling down towards the misty depths below . The Doctor walks into the TARDIS , apologising for being late . He says it ' s because of jumping through the window and asks if he should reveal how he got out of that situation alive . He turns to look at Clara , who is standing near a chalkboard , with her back to him . On the TARDIS monitors , the Doctor can see the fall , revealing that he isn ' t really in the TARDIS with Clara . He is actually still falling , but has sped up his thinking process to slow down his perception of time . The TARDIS he is standing in , is a " storeroom " within his own mind , which he has created to give himself more time to think . The Doctor reveals he had smelled the salty air earlier , which means the castle is standing in the sea . But jumping from a great height into the water doesn ' t guarantee that he will survive , so he needed to know the exact distance between the window and the water , which is why he threw the stool through the window . He listened for the splash of the stool reaching the water , which took seven seconds . Other things he had done in the room , including dropping the magnifying glass and the flower petals , were to determine other factors that he used to determine if he could survive the fall . " Rule One about being interrogated : you are the only irreplaceable person in the room . If they threaten you with death , show ' em who ' s boss . Die faster . " The Doctor successfully dives into the water , but falls unconscious , represented in the mind TARDIS by everything turning off . The lights start turning back on and the mental manifestation of the Doctor wakes up to the sound of Clara writing on the chalkboard . He looks at the chalkboard to see what is written : Question 1 - What is this place ? The Doctor asks why he can ' t just sleep . On another chalkboard , question two appears : What did you say that made the creature stop ? The Doctor asks if he has to know everything . On a third chalkboard appears another question : How are you going to win ? At that moment , the Doctor fully regains consciousness in the water . As he floats in the water , the Doctor makes a horrifying discovery . On the sea bed are many , many skulls . He quickly swims back to the surface , ending up at the base of the central tower . The Doctor walks inside and into a room with a lit fireplace . Warming his hands with the fire , the Doctor discovers an identical set of his clothes next to the fireplace . The Doctor takes the duplicate clothes and trades them with his own , making sure to place his clothes exactly as the other set were placed , before leaving the room . The Doctor finds a small room , with arrows pointing to a missing section of the stone floor . He looks up at the nearby monitor , noting that the Veil keeps coming for him . He asks why it does that . In the mental TARDIS , Clara writes on a chalkboard again : Wrong question ! Upon asking her what the right question is , he gets a written response : Not why . What ? The Doctor walks over to the monitor , pondering on the fact the Veil is tracking him . He realises that the Veil is trying to terrify him , as the monitors are set to show him where it is at all times . The castle and the Veil are a killer puzzle box designed to scare him to death . Smirking , the Doctor comments that it must be Christmas - this is exactly something that would be on his list . The Doctor heads down another corridor that leads him to an outside garden . He notices a rectangular mound of dirt in the centre of the garden , and a spade nearby , which means something is buried beneath the mound that he is supposed to dig up . Grabbing the spade , the Doctor contemplates whether to start digging , as it could be a trap , or a clue left by a previous prisoner . After all , the presence of the skulls proves that there were others here before the Doctor . Noting how slow the Veil is moving , the Doctor deduces he has an hour before it arrives , so he starts digging . Some time later , the Doctor is still digging , having not found whatever is buried , when he notices flies buzzing near him . Running to the nearby monitor he sees that the Veil is strangely standing in one place , staring at a smooth surface . The Doctor opens the door to leave the garden , only to discover the Veil standing on the other side . The Veil quickly tries to enter the garden , but the Doctor manages the force the door shut , and props the spade against the door in a way to keep it shut . The Veil continues to try to force the door open a few more times , before walking away . The Doctor looks at the monitor and notes that the Veil has walked into the room with the missing section of the floor . Wondering where it ' s going , the Doctor looks around . The door is the only way in or out of the garden . " Well , since you ' re going . . " he mumbles and grabs the spade , resuming his dig . Hours later , when night has fallen , the Doctor stops digging and looks up at the stars . He frowns in confusion , noting something wrong with them , before resuming his digging . His spade hits something . Digging with his hands , the Doctor uncovers the missing section of the floor from the other room . On it , words are written : I am in 12 . At that moment , the Veil emerges from the ground nearby , having dug its way from the room to the garden . The Doctor walks into his mental TARDIS again , thinking about how he is going to get out of this situation . He tells Clara to ask him a question and she writes something on the chalkboard : Tell no lies . She then rewrites question two again . The Doctor did note that it was when he admitted to being scared to die , that the Veil stopped . But , it ' s not just the truth that the Doctor ' s captors are trying to get out of him . They want his confessions , the secrets he never tells anyone . The problem is that there are truths the Doctor can never tell , not for anything . But now he is scared and alone . Back in the real world , the Doctor confesses that he didn ' t leave Gallifrey all those years ago because he was bored , but because he was scared . The Veil backs off and the castle shifts again . The Doctor quickly climbs out of the hole and escapes from the garden . The Doctor then makes another discovery . The castle is standing in the sea , alone , with no other land anywhere nearby . As time goes on , the Doctor uses his hand to tap out the seconds it takes for the Veil to walk from one side of the castle to the other , where he is , in order to work out how much extra time he can get before the Veil shows up again . He can get 82 minutes to himself if he leaves the Veil in one extreme end of the castle when he runs to the other extreme . Having some soup at one point , the Doctor wonders if the teleportation sent him to Hell ; he shrugs off the idea " That ' s okay . Hell ' s just Heaven for bad people . " During this , he is trying to locate room 12 , having noticed that the rooms are numbered , but due to the castle rearranging itself , the rooms are not in the correct order . He has also noticed that most rooms , after he has left them for a while , reset to the condition they were in before the Doctor arrived . The Doctor returns to the teleporter room , and looks at the nearby console . He then notices that two cords of the console are attached to a nearby skull . Detaching the skull , the Doctor notices that its owner had written one word in the sand before he died : bird . The Doctor wonders what it could mean , as he watches the word disappear from the ground . A wall nearby slides open , leading to a staircase . The Doctor uses the staircase , emerging at the roof of the tower . Setting the skull on a ledge , the Doctor looks around , knowing he is missing something . Earlier , he had located room 12 , but found a wall behind the door , meaning he has to give another confession to access the room . The Doctor knows that the room is a trap of some kind . This whole thing is someone ' s game that the Doctor can ' t stop playing , a game that everyone who came before him has lost . Looking up at the stars again , the Doctor asks what is wrong with them . They are all in the wrong place for this particular time zone . If he didn ' t know better , he would say that he has somehow travelled 7 , 000 years into the future , but he know for a fact that he hasn ' t time travelled . As he ponders this , the Veil arrives , but before it can grab the Doctor , he mentions the Hybrid . Turning to face the Veil , the Doctor talks about the Hybrid . Long before the Time War , the Time Lord s knew the War was coming . There were many prophecies and stories concerning it . One of the prophecies mentioned a creature called the Hybrid , who was half Dalek and half Time Lord , the ultimate warrior . The Doctor confesses that he knows that the Hybrid is real , that he knows where it is , and what it is . He confesses that he is afraid of it . The Veil backs off and the castle shifts again . When it does so , the skull falls from the ledge and into the water , joining all the other skulls already on the bottom of the sea . The Doctor quickly runs back to room 12 , to find that the wall has slid away , revealing a long hallway . Walking down it , the Doctor finds a room , with a semi - transparent wall , with the word " Home " written on it . The Doctor realises that this is the final obstacle . He believes that the TARDIS is on the other side of this wall , one confession away from him . Using the sonic sunglasses , the Doctor determines that the wall is made out of Azbantium , a mineral four hundred times tougher than diamond . He also determines the wall is twenty feet thick . He then thinks back to the word " bird " , and that ' s when his memory snaps back into place . The Doctor walks into the mental TARDIS , ranting over what he has remembered and what he must do . He tells Clara that he can ' t keep doing this . Clara writes question three again . The Doctor asks if he can just lose . It would be easy . All he would have to do would be to confess the secret details of the Hybrid . Asking Clara again , why he can ' t lose , he sees that she has written something new : No ! The Doctor tells her that he remembers everything , and that she doesn ' t understand . He can remember it all , every time , and she ' ll still be gone . The Doctor collapses onto a stair , finally letting out his grief over Clara ' s death . Suddenly , Clara is facing him and talking to him . She tells him that he is not the only person who has ever lost someone . It ' s the story of everybody . She tells him to get over it , to beat it , to break free . She tells him it ' s time to move on . She tells him to get up and win . In the real world , the Doctor stands back up , seeing that the Veil has reached the hallway and is walking towards him . He apologises to it , saying he has no confessions left for it , but he will tell it the truth . Turning back to the Azbantium wall , the Doctor starts punching it , while revealing that the Hybrid is a very dangerous secret that needs to be kept . So , instead of confessing the secret , he will instead get out of here and find the ones responsible for putting him in here . As he continues to punch the wall , he decides to tell the Veil a story from the Brothers Grimm . He continues to do so until the Veil finally reaches him and grabs him , severely burning him . As the Doctor collapses to the ground , the Veil steps back and vanishes . Inside the mental TARDIS , the Doctor says that Time Lords take forever to die , even when they are too injured to regenerate ; their bodies will try using all its regeneration energy to save them . As he says that , in the real world , he starts moving again , crawling out of the room . As the Doctor makes his way back to the teleporter room , he reveals everything he remembered . The castle was created specifically for him . There were no prisoners before him . The stars weren ' t in the wrong places and the Doctor didn ' t time travel . He ' s just been here a very , very long time . The Doctor reaches the teleporter room and stumbles over to the control panel . Since most of the rooms reset to their original condition , it ' s logical to assume that the teleporter room has also done so . As such , inside the teleporter ' s hard drive is a copy of the Doctor , as he was when he originally arrived 7 , 000 years ago . All he has to do is add energy to the teleporter to activate it , and the only energy source he has is himself . He has to burn the old him , to materialise the new one . Hooking up the two cords to his head , the Doctor pulls the switch . Collapsing to the ground , the Doctor only has enough time to write the word " bird " in the sand , before he dies , and his body fades into oblivion , leaving nothing but his skull . At that moment , the teleporter activates , materialising the Doctor in the chamber , exactly as he was when he first arrived , including the state of his memories , continuing the cycle he has been in for the last 7 , 000 years . He warns whoever brought him there that they will pay for Clara ' s death . The Doctor continues to repeat everything over and over again , each time getting further into the Azbantium wall ; he gets a bit more of his story out as the centuries pass . Each time , he is encouraged to continue trying to escape without revealing what he knew about the Hybrid ; he continues to accept that he needs to keep fighting on to honour Clara ' s memory . Finally , the Doctor successfully breaks through the wall . At that moment , the Veil falls apart , revealing it to be made of gears . The Doctor steps through the opening , onto a desert world . The opening closes behind him , and the item generating it drops to the ground . Picking it up , the Doctor discovers he had been trapped inside his confession dial the entire time . The castle and sea are then covered by a mass of gears and the cover of the dial comes back over it . Just then , a boy runs up to him . The Doctor tells him to go to the city and tell someone important . " Tell them I ' m back . Tell them I know what they did , and I ' m on my way . And if they ask you who I am , tell them I came the long way around . " The boy runs off towards the nearby Time Lord city , revealing that the Doctor is now on Gallifrey . The Doctor looks at the dial again and speaks to it . " You can probably still hear me . So , just between ourselves , you ' ve got the prophecy wrong . The Hybrid is not half Dalek . Nothing is half Dalek . The Daleks would never allow that . The Hybrid , destined to conquer Gallifrey and stand in its ruins , is Me . " Story notes . Filming location . " to be added " External links . Transcript of " Heaven Sent " at " Chrissie ' s Transcripts Site "