Flynn, a directionless 24-year-old in Baker City, Oregon, stands over a dying man in a supermarket, blood pooling at his feet. The man calls Flynn by name, blames someone named Lola for everything, and asks Flynn for his last name. Flynn does not know it. Flynn replies, "You ruined my life" (5). The novel rewinds to explain how Flynn arrived at this moment.
Flynn is unemployed, recently heartbroken, and living in his childhood bedroom. He walks into Muldoon's Grocery to apply for a job. Outside, a strange man asks him for a dollar; Flynn declines. Inside, assistant manager Ted Daniels hires Flynn as a "floater," a roving position across departments. On his way out, Flynn encounters the man from outside again: an employee named Frank who somehow already knows Flynn's name. Flynn settles into the store and begins taking notes in his notebook. Frank delivers eccentric monologues about nutrition and neuroscience, and Flynn finds him fascinating.
Flynn reveals his true purpose: He is a writer conducting research for a novel, and Frank satisfies every trait on his checklist for an ideal protagonist. Months earlier, his girlfriend Lola broke up with him, calling him a failure who never finishes anything. Flynn spiraled into severe depression. Among stacks of rejection letters, he found a note from Ed Nortan III, president of Darjeeling Publishing, expressing interest in Flynn's concept for a realist novel set in a supermarket. Flynn flew to New York, secured an advance, and returned home determined to immerse himself in the setting by working at Muldoon's. Before heading to the store, he had a disturbing experience: the bathroom lights flickered, he saw a double of himself in the mirror, and he felt as though he was being split in two.
At Muldoon's, Flynn is assigned to the bakery, where he meets Mia Torres, a 25-year-old law student. They bond over difficult childhoods and absent fathers. Flynn tells Mia everything except that he is writing a novel in which she and his coworkers are characters. Frank claims to have slept with Cara, a devout Mormon barista, describing a tattoo she does not have. Flynn recognizes Frank as a liar but suppresses the realization to preserve his inspiration. The strain catches up: Flynn collapses at work with a panic attack, and Mia accompanies him to the hospital, where she kisses him. During his recovery, Flynn researches derealization, a persistent feeling that one's surroundings are unreal, often associated with schizophrenia. He thinks of his father, who had schizophrenia and died by suicide in a psychiatric hospital.
Flynn and Mia begin dating. Frank pressures Flynn to set him up with Rachel, a sharp-tongued cashier, and Flynn passes along the message, hiding the interaction from Mia. On the store's roof, Frank reveals he has been skimming cash from the registers and outlines a plan to rob the safe. Flynn recognizes the robbery as the perfect climax for his novel and presses Frank for details.
Mia arrives at Flynn's apartment accusing him of cheating. Flynn confesses everything: the book deal, the novel, his claim that Rachel has been seeing Frank. Mia begins to believe him until she finds a sex scene written from Frank's perspective about Rachel and interprets it as proof of an affair. Desperate, Flynn hands Mia the phone, insisting Frank is calling to corroborate his story. After listening for a few seconds, Mia drops the phone in horror and leaves. The phone, Flynn later realizes, was never plugged into the wall.
Driven by anguish, Flynn commits to finishing the novel alone. On the evening before the store's monthly cash pickup, he dresses in all black, dons a ski mask, and types the robbery scene while drinking heavily, acting out Frank's movements as he writes. He wakes the next morning to find a revolver, cigarettes, and a coworker's stolen Zippo lighter in his locker. Ted announces the store was robbed overnight. Flynn confronts Frank publicly, shouting that Frank does not exist and challenging him to state his last name. Frank cannot, because Flynn never wrote one. Rachel confirms a sexual relationship with Flynn, not Frank. If Frank does not exist, Flynn committed every act he attributed to Frank. He recognizes himself on the security tape and is arrested.
Flynn awakens at the Mayberry Psychiatric Hospital. Dr. Olivia Cross, the head doctor, explains he has been institutionalized for over two years. She saw his televised trial, recognized his instability, and arranged for him to plead insanity. He was diagnosed with schizophrenia, multiple personality disorder, bipolar disorder, anxiety, and depression. A hospital worker named Ann administers daily psychiatric medication, though Flynn habitually pretends to swallow the pills and stores them in his jacket pocket instead. Dr. Cross reveals Flynn has been living in a recurring loop, reliving the events from Lola's breakup through the robbery and assigning hospital patients the roles of supermarket characters. This awakening, Dr. Cross notes, is Flynn's most lucid yet. Flynn's mother found his manuscript, mailed it to Darjeeling, and the resulting novel,
Muldoon's, became a bestseller earning nearly nine million dollars. His mother also reveals that Lola originally submitted Flynn's synopsis to Darjeeling before the breakup.
Flynn befriends William Redding Samson, called Red, a Black man in his midsixties who plays chess alone in the hospital. Red formerly had a heroin addiction and fell in love with Veronica, a nurse who aided his rehabilitation. After Veronica died in a skiing accident, Red spent years trapped in a similar loop. Red teaches Flynn that Frank cannot be defeated by denial; instead, Flynn must accept Frank as real so that Frank can be fought and killed. In a demonstration, Red slices his palm with a razor and wipes away the blood to reveal a healed hand, arguing that the mind can create and destroy physical reality. Dr. Cross urges a different approach, but Flynn follows Red's.
Mia, who has been visiting Flynn regularly at the hospital, arrives to say a final good-bye. She has graduated law school and accepted a position in New York. Flynn convinces her to help him escape, proposing that if his plan to destroy Frank works, they start a new life together. Red devises a Christmas Eve plan using a stolen key card and costumes from the hospital's holiday play. Disguised as Santa, Flynn slips out with Red's help, and Mia drives them to Baker City.
At the darkened Muldoon's, Flynn ventures alone into the aisles. Frank appears, and Flynn fires the revolver, but the figure that falls is Red. Frank emerges holding Mia at gunpoint and reveals that Red was another of Flynn's delusions, invented to manipulate Flynn into accepting Frank's reality and granting Frank the power to act through Flynn's body. Red's razor demonstration was designed to convince Flynn that the mind could make imagined entities physical. Frank announces a murder-suicide, reasoning he would rather die than keep losing control each time Flynn awakens.
Flynn notices they stand in the cereal aisle, surrounded by Cap'n Crunch, a callback to an earlier date with Mia. He shouts to her, and she screams "Crunch time!" before stomping on Frank's foot, a self-defense move she once demonstrated. A brutal fight erupts. During the struggle, hundreds of psychiatric pills spill from Flynn's jacket, medication he secretly hoarded instead of taking for over two years. Frank slips on the scattered pills and strikes his head on the floor with lethal force. The pills accomplish their purpose from the outside rather than the inside: The massive head trauma triggers a rebalancing of Flynn's brain chemistry, and he experiences total clarity for the first time.
The scene circles back to the opening. Flynn lights a cigarette with a silver Zippo lighter and places it at the dying Frank's lips. Frank exhales and dies. In the epilogue, the narrative reveals that the entire novel has been Flynn's memoir, titled
Supermarket, recounting the breakdown he endured while writing
Muldoon's. Flynn and Mia sit at the same diner where Lola once left him, about to fly to New York to start a new life. Flynn asks the waiter, whose name is Frank, for his last name. The man pauses, puzzled. The novel ends without the question being answered.