1. After meditatiing on the roof of the TARDIS (and very likely calling up old memories), the Doctor begins to putter around the TARDIS and talk to himself, and starts to wonder what if you really aren't talking to yourself? What if there is something you can't see, something in the corner of your eye, that is always with you.
2. Grabs Clara and attempts to prove this by trying to go back in her timeline and find the "dream" where you wake up and you're not alone, and a hand grabs your foot. But she is so preocupied with her mangled date with Danny that she accidentially uses the TARDIS mental circuits to send them back to Danny's past in an orphanage.
3. Not to be cowed the Doctor investigates with child Danny (Rupert) and there does appear to be something in his room on his bed. The Doctor recites a speech about turning fear to a superpower and using it to ones advantage (Twelve's best speech so far!). He is convinced that the thing in the room is a creature of some kind that accompanies us through life and does things when we aren't looking. This is the thing under your bed, and in the corner of your eye.
4. The Doctor, after droppping Clara off for Chance#2 with her date with Danny, goes forward in time to find how childhood Danny (Rupert) is tied to Clara and finds future descendant Orson, who has pioneered human time travel and as a result ended up stranded at the end of the universe on the last planet. The Doctor is convinced that there is something outside the station too, for fear has made Orson believe something nefarious is out there trying to get in. Orson is packing and Clara notices that he has chidlhood Danny's (Rupert's) one toy figure of the soldier without a gun, and he explains it was an heriloom handed down through the family, he hands it to Clara and she says "No, it's a family heirlooom" and Orson says "Yes, it is." and continues to hold it out for her. The implication being that Clara and Danny do end up in a relationship and she is more than likely Orson's great grandmother, or somehing along those lines.
5. Then the reveal happens. As they run from the future world the Doctor is unconscious from trying to see what was trying to get in therough the airlock, so Clara uses the mental circuits again to take them away...but what happens is they travel back into the Doctor's past instead of either of theirs. They end up in a barn-like structure where a child is laying in a bed weeping. As Clara moves towards him she looks around and recognizes the barn, but hears voices and slips under the bed. The voices talk about how he will never be able to go to the academy and become a time lord if he continues to be scared of everything, and sleep in the barn (the implication SEEMS to be that he's an orphan), and that he will have two life otpions, the military or a time lord. They leave and the Doctor goes to get up and Clara reaches out and grabs his foot, therefore implanting the memory of the "dream" that someone is under your bed that he was ruminating on in the beginning of the episode. She calms him, tells him it's just a dream. Then after he's laid back down she crawls out from under the bed and begins to recite the "fear is your superpower" speech the Doctor gave childhood Danny (Rupert) earlier on (indicating that Clara is actually who he first heard such a thing from), but she delivers it as a dream in a lullabye-like voice, and then she reveals that the barn is the same barn that the Doctor comes to when he is the War Doctor, on the last day of the Time War and that on that day he will be more scared than he has ever been, but that he will make the right decision, and will confront his fear. She then leaves him the heirloom figure that Orson gave her of the soldier with no gun, the soldier who didn't need a gun to be brave and save the planet. Giving him, I assume, the strength to become that man later in life. To confront fear and use it as a superpower.
6. The point of the episode, other than the callbacks to Gallifrey, the connections for Danny and Clara, and even the Doctor's choice between soldier and time lord...is that there never was anything under the bed or on top of it (another kid playing a gag on childhood Danny), or anyone outside Orson's airlock (the hull settling like the Doctor mentions), or indeed under the Doctor's bed (Clara hiding). Fear was the monster in this ep.
There, hope that helps. It was a bit all over the place, but dovetailed nicely in the end.