Ensign Andrew Dahl has just graduated from the Universal Union’s space academy and assigned to the Intrepid, a starship on an intergalactic mission to explore new worlds. He quickly discovers that there’s a problem with this ship: On every away mission, at least one ensign dies a horrible death.
When Dahl is assigned to work in the Xenobiology Lab, he notices strange behavior among his co-workers. His fellow lab mates avoid Captain Abernathy and Chief Science Officer Q’eeng whenever they come to the lab to ask for mission volunteers.
On Dahl’s first mission, he notices that while several ensigns die, anyone who is in a group with Kerensky, a member of the bridge crew, survives. Dahl speaks to his lab mates about the bizarre experience and demands that they explain it to him. It turns out that the Intrepid’s crew has noticed that crewmembers near Captain Abernathy, Commander Q’eeng, Chief Engineer West, Medical Chief Hartnell and Lieutenant Kerensky have a higher chance of dying.
Beside the unnaturally high death rate, Dahl also notices other strange things, such as the Box, a device in the science lab. The Box functions like magic. When a difficult problem arises, the scientists put the problematic object inside the Box and wait to hear a dinging sound, which lets them know the problem is solved.
One programmer, Jenkins, has a wild theory about all the strange incidences on the ship, but Dahl’s lab mates say Jenkins is impossible to locate. Dahl’s lab mates use a tracking system Jenkins developed so they can avoid the captain and Q’eeng, and thus avoid missions with them. They don’t want to anger Jenkins by trying to find him.
Dahl and his four friends Duvall, Finn, Hester and Hanson begin to investigate the Intrepid’s problems more directly. Finn finds Lieutenant Kerensky’s medical records and discover that in the past three years, Kerensky has been shot, burned, crushed and injured more than a dozen times, but still manages to recover in record time. They decide they need to find Jenkins and ask him what’s going on, but Jenkins remains elusive.
While on shore leave, Dahl tries to find blueprints for the Intrepid, to help him find Jenkins. When he joins his four friends in their hotel suite, he’s displeased to discover a drunken Lieutenant Kerensky trying to befriend them. Dahl asks Kerensky about his miraculous ability to heal, and Kerensky says that he is also disturbed by the amount of life-threatening injuries and illnesses that befall him. Kerensky doesn’t want to go on nonsensical missions, but every time the captain and Q’eeng ask him to go, it’s like he loses his free will and immediately accepts the mission.
Dahl uncovers too much about Jenkins, so his boss in the Xenobiology Lab transfers him to the bridge crew. As the junior science officer on the bridge, his odds of dying increase dramatically. As he stomps around the ship in frustration at his new assignment, Jenkins suddenly appears and pulls him into a closed corridor. Jenkins tells Dahl to bring his friends and meet him in a secret delivery cart storage area.
Jenkins gives the ensigns a presentation of his findings about the Intrepid. Five years ago, when Abernathy became captain, crewmember deaths spiked, although they weren’t engaging in more dangerous missions then before. Jenkins can only find one spaceship in recorded history that has sustained similar loss of crewmembers lives — the U.S.S Enterprise, a fictional ship on a science fiction television show.
Jenkins tells the ensigns that they are all real, but the plot of a poorly written science fiction show keeps overtaking their reality. Jenkins refers to this phenomenon as the Narrative and tells the ensigns about how the episode plots usually work and how the Narrative overtakes people’s logic and makes them act more dramatically than necessary.
Finn is skeptical, but Dahl believes Jenkins’ interpretation of events. When Finn dies dramatically on a mission, his acquaintance begs Dahl on Finn’s behalf to find a way to end the Narrative. Jenkins says the Narrative can’t be changed, only avoided, but Dahl disagrees. He notes that the deaths caused by the Narrative aren’t only limited to the Intrepid; entire planets suffer plagues so the Intrepid can come and solve their problems.
Jenkins comes up with a strategy to stop the Narrative. He calculates that their show, “The Chronicles of the Intrepid,” began in 2010, so if the ensigns time travel back to the 2000s and stop the writers, it will stop the Narrative but allow them to continue existing. They can’t bend the laws of physics and time-travel without a main cast member, so Dahl, Duvall, Hanson and Hester knock out Lieutenant Kerensky, launch their shuttle into a black hole and travel back in time to Burbank, California, 2012.
They discover that there are actors for each of their characters, so they go to meet Brian, Dahl’s actor, who looks identical to him. Brian helps Duvall and Kerensky get into a club where they meet Kerensky’s actor, Corey. They tell Corey they need to meet with the creator of “The Chronicles of the Intrepid,” Charles Paulson.
The trouble is, Paulson hasn’t wanted to take any meetings lately because he’s depressed. Paulson’s adult son, Matthew, is in a coma following a motorcycle accident, but when they meet him, they discover that Hester is a doppelganger for Matthew, who was also briefly an extra on the show.
Dahl formulates a plan where the ensigns and Kerensky will take Matthew back to the Intrepid and heal him with their futuristic technology, leaving behind Hester. Nick, the show’s head writer, will have to create an episode where Hester is injured and then healed in order for their plan to work, but if everything goes well, the healed Matthew on the Intrepid will become Hester and the version of Hester in Burbank, California, will become Matthew. As a reward for saving his son, Paulson agrees that he won’t kill off any of the ensigns left on the show and that the show will end after the current season, freeing them all to live the rest of their lives untroubled by the Narrative.
The ensigns and Kerensky fly their shuttle back through the black hole and evade ships from Forshan, which are attacking them. Once the shuttle is on the Intrepid, the Narrative takes over and Dahl, Duvall and Kerensky rush Matthew/Hester to sick bay where Medical Chief Hartnell takes samples of his/her cells to decode an important, potentially war-ending message about the Forshan religion, which Matthew/Hester has encoded in his/her DNA. Dahl gets injured horribly as the Intrepid is attacked. As he fades into unconsciousness, he thinks that it’s OK if he’s the last dramatic death on the show, so long as he saves his friends and Matthew/Hester.
Dahl regains consciousness after four days in sickbay. He learns that Matthew/Hester recovered, and Hester/Matthew is back in Burbank. In the Intrepid’s world, the message in Matthew/Hester’s DNA was broadcast to the Forshan people, ending their religious war. For his role in helping with the mission, Commander Q’eeng tells Dahl that he has been promoted to lieutenant. Q’eeng reads Dahl a message from Paulson, the show’s creator, thanking Dahl for saving his son’s life and promising to uphold his end of the bargain and end the show peacefully.
Now that order is restored, and people are in control of their own lives, Dahl notices that his friend Hanson doesn’t really fit in with the past plot. Dahl also realizes something strange about himself. Like Kerensky, he keeps getting horribly injured and almost dying before making miraculous recoveries. He speculates that he’s the protagonist.
Hanson says that’s ridiculous because Dahl is obviously an extra. Dahl replies that he’s an extra on the show but a protagonist elsewhere and asks Hanson to explain it to him because, since Hanson hasn’t contributed to the show significantly in any way, he must still have something important left to do. Dahl believes that he and the other ensigns are actually the protagonists of a second work of fiction, which Hanson confirms is true. The characters all live happily ever after.
The novel has three codas, additional chapters from alternate points of view.
Coda I shows a blog from Nick, head writer of “The Chronicles of the Intrepid,” as he asks the internet audience for advice on how he should change his writing for the show, now that he has met his characters and knows that he actually kills them by writing their deaths. He writes the script for the Hester/Matthew episode and feels much better.
Coda II follows Matthew Paulson, as he wakes up from a coma and discovers that he’s completely healed. With injuries such as the ones he sustained in his motorcycle accident, he should be disfigured and disabled for life, but he doesn’t even have any scars. His family says he had a miraculous recovery, but he learns the truth when he discovers a video from Hester—from himself—encouraging him to live his life well and to stop floundering aimlessly.
Coda III focuses on Samantha Martinez, former actress of a character who lived and died in a single episode of the show. Her character, Margaret, was married to Jenkins, and Jenkins went slightly mad with grief after her death. Jenkins gave Dahl some videos and letters to give Samantha because she’s the closest connection he has to his deceased wife. Over a few weeks, Samantha watches and rewatches the footage of Margaret and Jenkins’ happy married life. When she is finally ready to destroy these love letters from the future, she happens to meet Nick, who played Jenkins in one episode. They feel a sense of connection right away and agree to go out to dinner together.