The episode begins with a scene at the Pennebaker Club back in the ‘40s, where Castle is a detective cop, and Dr. Parish the jazz singer. He loves the music, and lets on to the bartender that he would need help for a date. The picture he shows him is none other than the woman he is looking at. He turns around, and finds a woman – the one who looks exactly like Beckett, but all fashioned up in a 1940s style. But that is all till then. Back to reality, Castle and Beckett are at the crime scene, where Stan Banks has been murdered. Although Castle is overflowing with stories from the ‘40s, Beckett reminds him that the only story they need now is about the victim. Stan is dead, which is news to the manager of the club – who doesn’t know what is to be done with the room in which he stayed.
So what is supposed to do with all the crap in his room? Ryan announces they will be taking a part of the crap, which will hopefully relieve her from the misery of having to deal with a crime scene. When Stan Banks’ ex-wife appears for questioning, she reveals the fact that she and Stan spoke only for a little while a couple of months back. It was a small conversation, and all he could reveal was that he was after a blue butterfly. That is the vague bit she knows. And besides, someone called her later, and he was looking for Stan. Stan better give him back the $10,000, or else. Later, the detectives find a way into Stan’s life – his books and stuff. Among those is a diary. It appears to be interesting to Castle, but Beckett wonders what could be relevant from something so old.
However, Castle finds it interesting, and as he reveals his interest, he also mentions he thinks there might be a clue for what Stan might have been looking for. Castle wants to take it home for the night, and figure out what it might hold. Moreover, he appears to be aware of the facts that are relevant to Stan’s case. Back home, Castle sinks into the diary from the 1940s. He pours himself a generous glass of Kentucky bourbon, and starts imagining how it could have been possible for the men to do what they did. And it turns out that Castle’s man – Joe – had been doing whatever he has imagined, and his secretary (of the detective), is the woman who resembles his mother. In comes the pretending tenant after a while. She will later turn out as someone among the adversaries. Castle looks like he is pretending he already knows that.
And later when he hits the bar for investigations, he gets attacked by the mobsters – lookalikes of Esposito and Ryan. When he returns to office the next day, he reveals what he has found from the diary – the blue butterfly is nothing but a necklace – and a very expensive one. And there is a book at the crime scene that could turn out to be relevant enough for investigations. And, not again! Castle slips back into the 1940s, where he sees himself talking the crime scene apart, but gets confronted by mobsters. However, the singer, who is a look alike of Dr. Parish, intervenes. Castle feels he’s gotten saved. Before long, the detectives discover that the pistol with which Stan was killed, was the same as the one that a researcher has owned. His name is Balasco.
He is the person that Stan said was the missing piece in the puzzle. Before long, they realize they should get this man into the interrogation cell. He turns out to be someone who has been truly researching for a number of years – and that too for the only attraction in the case – the jewel – the blue butterfly. When Dan is at interrogation, he reveals that amateurs in the field of investigation have been after him for information on the ‘blue butterfly’. They have been pounding his research. However, he is only a scholar, as it appears, and has interest in the 1940s, may be much like Detective Castle. And then, Castle realizes from the diaries, that Viera, who has been framed with her sister, doesn’t have one. Before long, they have Tom Demsey at the interrogation cell. He bears splitting resemblance to his grandfather, who was the gang leader that owned Pennabaker club.
Where did they find him? Right at the locker, which may have held the blue butterfly at another time. All he has to say is that Stan Banks was a low life butterfly hunter who figured in society as nothing better than a treasure hunter. And before long, in comes the real Joe – them man who has been in Castle’s dreams – as himself. Castle asks him if he remembers when Joe and Viera were murdered. He does, clearly. Tom shut down the whole club, and blah blah. However, he lets on about the blue butterfly, and that everyone knew about it. They could not figure out why the redheaded woman was such an attraction, except for her beauty. After the detectives interrogate a man from the West Side – Upper, he claims – it turns out the detectives need to be on the tail of the professor, whom they have interrogated before, and let go.
This time, he is smarter, but not until Beckett manage to make him say the truth. Yes, he was at the Pennebaker club, and yes, he did have a pistol with him, but he did not kill Stan Banks. He hopes the detectives believe that. Before long, information proves that his testimonial is true. When the detectives make their move, they reach the place were the oldies are staying – the real Joe and Viera’s apartment. They have been in hiding for aeons. However, they relate their story, Castle and Beckett realize the old couple’s moral highness. Joe was at the scene as a bartender. And the mobsters were after Viera, and her blue butterfly. Before they knew it, Viera was being attacked – no one knew what to make of it. However, Joe was wise enough to intervene, and knock down the men who had been working for the gang boss. But before they reveal the whole story, there is a young man in their apartment, who takes out a particular gun from the kitchen drawer.
However, Beckett has him arrested at gunpoint. The old couple go on revealing the facts. They took down the attackers, one of which was the woman who appeared in Castle’s imagination as the tenant. She holds a gun to Viera’s stomach, but gets killed as soon as Castle helps Viera. After they had two dead bodies, they put them in the car, and burnt it. Viera handed her necklace to Joe, and he put that behind a brick on the broken wall. And now, they don’t need it, they have seven grandchildren, and two great grandchildren. And more importantly, they have each other. Later, Beckett hopes Castle had told them about the real story about the blue butterfly. But why bother? That is the kind of stuff dreams are made of!