Malcolm is trying to impress Wendy, a girl at Lucky Aide, and gets excited when he hears his mother will be doing the graveyard shift during spring break. This means Malcolm can be alone with Wendy. Unfortunately, Lois has decided to move Malcolm to the late shift too. Reese also has a job for spring break, as an assistant to an exterminator. His boss makes him spread caterpillars around the neighborhood, just before his van shows up there.
Malcolm gets terribly bored during the graveyard shift and notices strange things. Certain areas are cleaned mysteriously, an empty candy wrapper is left behind with some money. After the shift, Lois and Malcolm join the rest of the family for breakfast/dinner. Reese doesn't have to go to his job any more as his boss was arrested for shady dealings. It means Reese is left with a box of caterpillars.
The next night Malcolm studies the surveillance tapes at Lucky Aide. He sees a man appearing several times but never actually leaving the store. Eventually he finds the man hiding between some racks. Apparently, Norm has been living at the store for three years. He promises to help Malcolm with Wendy if he doesn't tell anyone about his situation. From his hiding place Norm can hear the staff's conversations.
At home Lois is disgusted by Reese's caterpillars. She orders him to kill the bugs. Reese just hides them in the yard as he's grown attached to the creatures. For the first time in his life Dewey can sleep alone in his bed. To his surprise he grows half an inch in a week.
Thanks to Norm's advice Malcolm can say just the right things to Wendy. When Malcolm smuggles in some fresh fruit and a good book into the store, Lois becomes suspicious. She understands Malcolm is hiding someone and threatens the stranger over the p.a. system. Norm comes out of his hiding place and Lois decides to report him to the police. After all, she must obey the rules. When her shift is over, however, she walks away. The police haven't arrived yet and Norm is allowed to escape. Wendy is creeped out by the things Malcolm knows about her, and she fears he's been stalking her.
During the cold night Reese brings his cardboard full of caterpillars back into the house. The next morning he wakes up to the sound of hundreds of butterflies flapping their wings. At first he finds it beautiful, but he eventually runs off screaming.
In the final scene Dewey scares Reese by imitating the sound of flapping insect wings.