School’s out at Third Street School, but T.J. is unhappy, because his friends have all decided to go to various camps to improve their skills. T.J. unhappily rides around town, doing things by himself, when he notices that there’s something going on at the school. He sneaks inside and finds them using a tractor beam to levitate a safe. Panicked, he tries to tell his parents and the police, but no one believes him. When he gets Principal Prickly to come to see what’s going on, he is dematerialized. T.J. uses his sister Becky’s diary to blackmail her into driving to all the camps to pick his friends up.
T.J. and his friends steal a box of documents, but when they find it filled with boring information, they accuse him of inventing a plot to bring them back. They are about to head back to camp when they see the tractor beam come out of the school and shoot out a green laser and agree that something is going on. The next day, T.J. finds Pricky’s golf pants in a Dumpster, so T.J. and his friends infiltrate the school at night. While there, they are caught spying and flee. T.J. is captured and his put in a storage room where Prickly is tied up. A man named Dr. Phillium Benedict comes in to talk to them.
After Benedict leaves, Prickly relates how, back in the 1960s, Benedict became principal of Third Street School and moved to abolish recess to improve test grades. Prickly went to the superintendent as a means of recourse. The superintendent fires Benedict and promotes Prickly to principal. Benedict’s girlfriend, Muriel P. Finster, breaks up with him. Later, Prickly says, Benedict went on to become Secretary of Education but was fired when he tried to abolish recess nationwide.
T.J. and Prickly escape, but are caught again. T.J. uses his walkie-talkie (in Prickly’s drawer) and tells his friends Benedict wants to destroy summer vacation. T.J.’s friends go through the box of documents again. Spinelli finds a date book that says lunar perigee on it; Gretchen deduces that Benedict is trying to move the moon’s orbit via tractor beam when it is closest to the Earth. Benedict reveals to T.J. and Prickly that his plan is to make it cold during summer so that kids will be forced inside to study.
T.J.’s friends get his sister, Becky, to drive to the camps again, where they pick up all the children. Gus draws up the plans to attack the school. T.J. and Prickly escape the cage that Benedict has imprisoned them in. Gus’ plan works, and most of the guards and ninjas are knocked out. All the kids pour into the auditorium. Another set of guards protects Benedict as he prepares to pull the lever. However, Muriel P. Finster arrives. After rejecting Benedict again, she brings the teachers in and a fight breaks out. Prickly punches Benedict, but as Benedict slumps, he triggers the beam and Prickly cannot reverse it. T.J. tosses his baseball to Vince, whose accurate arm destroys the machine. The police arrest Benedict and his cronies.