After we see Lt. Reg Barclay beating up Riker and Geordi in 10-Forward, he is called to Cargo Bay 5, and exits the holodeck, saving the program he just ran. At Cargo Bay 5, Geordi and Riker discuss Barclay as a problem (always late, doesn't work well with others, eternally nervous, etc.), and then dress him down as he comes in. After dealing with a broken canister of tissue samples, the team gets to work analyzing a broken antigrav- and despite all of Barclay's assurances, it continues to malfunction.

Later, Picard tells Geordi in private that he should try harder to get to know Barclay, leave his prejudices in his cabin, and above all, forget Wes's nickname for Barclay, "Broccoli". Geordi immediately gets on that, inviting Reg to take part in the next morning's briefing. Unfortunately, he's a little late then, too- and most of his suggestions are shot down by Wesley as unworkable. While Barclay unwinds in the holodeck with another fantasy (this one involving Troi as "the goddess of empathy"), Wes, Geordi, Data, and Duffy (another engineer) discuss Barclay in 10-Forward. Then, inexplicably, Duffy's glass starts leaking.

Upon further analysis, they find the molecular structure of the glass has been altered. When Geordi asks Reg to run a full Level-1 diagnostic to check into this, he's surprised to find Reg was already going to, to check on the antigrav. Data suggests the two incidents could be related, but later claims it was Reg's idea to Picard. Picard is happy to hear it, but accidentally calls Barclay "Broccoli" himself, further dampening Reg's self- confidence. Later, Guinan defends Reg to Geordi, saying that most of his actions are because of how he's been treated, not just the reverse. Unfortunately, when Geordi finds Reg this time, Reg is living out a fantasy of beating Geordi, Data, and Picard in swordplay. Geordi later tells Reg that although it's unusual, he won't report it or demand a transfer, but suggests he root himself a bit more in reality, and consult Troi. Then, as if that weren't enough, Transporter 3 malfunctions.

Reg goes to see Troi, but quickly leaves, too nervous to stay around. Later, when Reg doesn't show up on the bridge when called, Riker, Troi, and Geordi go to find him on the holodeck- and find him living out several fantasies at once (not amusing Riker or Troi one bit). As all four leave, Geordi and Reg head to Engineering, and Geordi tells Reg that he's needed out in the real world right now. Then, to make matters worse, the matter and antimatter injectors to the warp engines jam, making the ship accelerate out of control. Before long, Reg proposes that one of them might be the problem, and Geordi quickly finds that the broken canister contained traces of Invidium, which caused all the problems. They cool the Invidium down until it's inert, and manage to power down the warp engines. Finally, Barclay bids the holodeck-bridge goodbye, and erases all programs- "except program 9".