Somewhere in the San Francisco suburbs, Paul Harley has a surprise for his mistress, Larysa Zeryeva. He blindfolds her, leads her to his garage, and (surprise!) smashes her in the head with a tire iron. Harley then proceeds to cut up the body with a chainsaw.
Meanwhile, over at Police Headquarters, Captain Stottlemeyer is investigating an arson case that took place at a wig factory. But Commissioner Brooks, Stottlemeyer's ornery new boss, has a more pressing matter for investigation: a woman's torso has washed ashore in San Francisco Bay.
Stottlemeyer turns his attention to the torso murder, quickly bringing Monk on board. But before they can get started, something bizarre happens: an unknown man steals the Commissioner's hat during a press conference. Then, at the coroner's office, Monk examines the torso and deduces some important clues to the identities of both the killer and the victim. However, Monk's solid detective work is soon overshadowed by a colossal blunder: obsessed with some dirt on a computer keyboard, Monk accidentally erases years of forensic records. Infuriated, the Commissioner removes Monk from the case and takes away his detective's license.
With Monk unemployed and looking for a new job, Stottlemeyer and Disher home in on Paul Harley as their prime suspect. Harley fits the profile Monk established for the killer, and Harley was known to be dating Larysa Zeryeva, who fits Monk's profile for the victim. The only problem is they have none of Larysa's DNA to positively identify the torso, and Harley's house has been scrubbed clean.
Monk, meanwhile, finds a new job as a magazine proofreader. While he's a whiz at his new occupation, a story in the newspaper catches Monk's eye and reawakens his detective instincts: someone has once again attempted to steal the Police Commissioner's hat. Monk makes a realization: the hat thief is connected to the torso murder!
Monk gets Stottlemeyer together with the Commissioner and explains what happened: Paul Harley killed his girlfriend Larysa, cut her up, and dumped her body into San Francisco Bay. When her torso was recovered, Harley panicked and began obsessively destroying any traces of her DNA. He started by cleaning his house, but he soon made an alarming discovery: Larysa had sold her hair to a wig maker, which meant that somewhere out there, there was a wig full of Larysa's DNA! He tried burning down the wig maker's building, but Larysa's hair had already been made into a toupee and sold... to Commissioner Brooks. The "hat thief" was Paul Harley, and he wasn't after the Commissioner's hat - he was after the toupee!
It turns out that the solution to everything: the stolen hats, the wig factory arson, and the torso murder, were all sitting on the Commissioner's head the entire time! Embarrassed, the Commissioner has no choice but to restore Monk's license and return him to his rightful place among the world's great detectives.