Eleven-year-old Harriet M. Welsch is an aspiring writer who lives in New York City's Upper East Side. A precocious and enthusiastic girl, Harriet enjoys writing and hopes to become a secret agent. Encouraged by her nanny, Ole Golly, Harriet carefully observes others and writes her thoughts down in a notebook as practice for her future career, which she dedicates her life to. She follows an afternoon "spy route", during which she observes her classmates, friends, and people who reside in her neighborhood. Her best friends are Sport, a serious boy who lives with his father, and Janie, who wants to be a scientist.
Harriet enjoys having structure in her life. For example, she regularly eats tomato sandwiches and adamantly refuses to consume other types of sandwiches. However, Harriet's life changes abruptly after Ole Golly's suitor, Mr. Waldenstein, proposes and she accepts; when Mrs. Welsch exclaims, "You can't leave, what will we do without you?!" Ole Golly replies that she had planned to leave soon because she believes Harriet is old enough to care for herself. Harriet is crushed by the loss of her nanny, to whom she was very close. Her mother and father, who have been largely absentee parents during Ole Golly's tenure as nanny due to their obligations to work and social life, are at a loss to understand Harriet's feelings and are of little comfort to her.
Later at school, during a game of tag, Harriet loses her notebook. Her classmates find it and are appalled at her brutally honest documentation of her opinions of them. For example, in her notebook she compares Sport to a "little old woman" for his continual worrying about his father. The students form a "Spy Catcher Club" in which they think up ways to make Harriet's life miserable, such as stealing her lunch, passing nasty notes about her in class, and spilling ink on her.
Harriet regularly spies on them through a back fence and concocts vengeful ways to punish them. She realizes the consequences of the mean things she wrote, and though she is hurt and lonely, she still thinks up special punishments for each member of the club. After getting into trouble for carrying out some of her plans, Harriet tries to resume her friendship with Sport and Janie as if nothing had ever happened, but they both reject her. Harriet spends all her time in class writing in her notebook as a part of her plan to punish the Spy Catcher Club. As a result of never doing her schoolwork and of skipping school for days at a time and taking to her bed out of depression, her grades suffer. This leads Harriet's parents to confiscate her notebook, which only depresses Harriet further. Harriet's mother takes her daughter to see a psychiatrist, who advises Harriet's parents to contact Ole Golly and encourage Harriet's former nanny to write to her. In her letter, Ole Golly tells Harriet that if anyone ever reads her notebook, "you have to do two things, and you don't like either one of them. 1: You have to apologize. 2: You have to lie. Otherwise you are going to lose a friend."
Meanwhile, dissent is rippling through the Spy Catcher Club. Marion, the teacher's pet and self-appointed queen bee of her class, and her best friend and second-in-command, Rachel, are calling all the shots, and Sport and Janie are tired of being bossed around. When they quit the club, most of their classmates do the same.
Harriet's parents speak with her teacher and the headmistress, and Harriet is appointed editor of the class newspaper, replacing Marion. The newspaper—featuring stories about the people on Harriet's spy route and the students' parents—becomes an instant success. Harriet also uses the paper to make amends by printing a retraction, defeating Marion and is forgiven by Sport and Janie.