The Simpsons wins a free spa weekend. At the spa, Homer is nearly killed when a mysterious person locks him into an incredibly hot steam room with a spanner. Fortunately for Homer, Krusty the Clown unlocks the door, letting an unconscious yet alive Homer out. This prompts Homer and Marge to see Chief Wiggum, who suggests that they seek help from someone who can understand a murderer's twisted mind – Sideshow Bob, who is released from prison, much to Bart's discomfort. To ensure Bart's safety, Wiggum places a shock bracelet on Sideshow Bob's ankle to keep his murderous urges at bay when he comes to live at the Simpson house. Sideshow Bob asks Homer to list all the people who may want him dead, and decides to follow Homer around to investigate who the mystery assailant could be. During their day, they end up at a repair shop, where Homer chastises the mechanic, Junior.
Homer and Sideshow Bob go to Moe's Tavern, where a hand, holding a gun, appears at the door and fires at Homer, but it hits and shatters Moe's pickled egg jar. The person gets away in a tow truck. Sideshow Bob suggests that Homer should stay home and out of sight to be safe, but he is told that he was named the King of the Springfield Mardi Gras, in which he must ride on a float for the whole day. Sideshow Bob discovers that Homer won because someone filled the ballot box with ballots listing Homer's name, all in the same handwriting, but Homer takes part in the parade anyway in hopes of luring out his killer. At the parade, Sideshow Bob learns that Homer's engine is having a problem due to the repair by the mechanic (the brake line is cut), and draws a correlation between the wrench used to lock Homer in the steam room, the wrenches in the tow truck, a smudge on the spa invitation, and the tow truck driver (Junior). He saves Homer by getting fired out of a cannon, and grabbing Homer with his huge feet slipped under Homer's arm-pits, just before the float crashes into the Museum of Swordfish. Homer and Sideshow Bob end up giving chase to the killer, who is found out to be, indeed, Junior, Homer's mechanic. He admits his name is Frank Grimes Jr., and blames Homer for his father's death. When Homer questions how Junior could be Frank Grimes' son since he never married, Junior explains that his father "happened to like hookers." Junior attempts to kill Homer, but is foiled when the police arrive. Lisa thought it was Bumblebee Man, but she was wrong. Chief Wiggum places Grimes Jr. under arrest and has Sideshow Bob tranquilized with a dart.
That night, after Homer puts Bart in bed, Sideshow Bob, who was hanging to the back of the door to Bart's room, leaps down. Bart tries to get the shock bracelet remote control, but Sideshow Bob already has it and throws it out of the window, gags Bart with a piece of tape, picks him up and prepares to kill him with a knife, bent on killing him once again. However, Sideshow Bob realizes he is accustomed to Bart's face and he can not bring himself to do it. With that, Sideshow Bob tries to takes his leave, but gets zapped continuously by his shock bracelet (because of birds pecking the remote after it had landed in their nest).