This week's film noir episode, the team investigates the murder of Stan, an adventurous man searching for the elusive blue butterfly. Castle finds a diary among his possessions and takes it upon himself to investigate. The diary is about a detective named Joe. Beckett was not as enthused as Castle was until they find out that the blue butterfly is actually a diamond necklace shaped like a butterfly that is worth a million dollars.
Castle is on the search for more clues. Even Kate gets into it. She finds out that Castle has been casting people in the precinct into his readings. He cast himself and Beckett as Joe and Vera, two star-crossed lovers. The clues lead them to some red herrings who they interrogate.
The clues finally bring them back to the bartender at Pennybaker, where the film noir was set. It turns out that Joe and Vera did not die in a double homicide, but died living happily together. It was the nurse that killed Stan because he was bitter that Stan had the million dollars.