
The story in 5 beats
- Wrong hand
A character in Data's Holmes program is suddenly the wrong way round. Barclay is called in to fix it.
- The file
Barclay finds Moriarty in protected memory. He remembers everything, including being switched off.
- The doors
Moriarty steps off the holodeck and doesn't vanish. Now he wants the same for the countess he loves.
Command codesSpoiler · tap to reveal
Data notices something wrong with the ship, and Moriarty has the keys to it.
End programSpoiler · tap to reveal
Picard sends the couple off to see the galaxy. Barclay tries one last command, just in case.
Why it still matters
In 1988's "Elementary, Dear Data," a holodeck Moriarty realized he was a program, and Picard promised to look for a way to let him out. Then the show saved him to memory and moved on. This is the episode that remembers. Moriarty has been aware the whole time he was switched off, which should be impossible, and he's had four years to get angry about the promise.
René Echevarria's script turns a holodeck repair job into a philosophy exam. Moriarty quotes Descartes, "I think, therefore I am," and walks out through the doors as if that settles it. The crew's answer is a trick, and a kind one, and the last scene quietly turns the question back on them. The Hollywood Reporter ranked it 21st on its 2016 list of the 100 best Star Trek episodes.
A bottle inside a bottle
Moriarty never left the holodeck. The Enterprise that Picard, Data and Barclay have been walking around is Moriarty's own simulation, and believing he was on his real ship, Picard handed over his command codes. Moriarty uses them to take control of the real one. So Picard does the same thing back: he builds a program inside the program, in which Moriarty and Countess Regina seem to beam out into the real world and leave in a shuttlecraft to explore. Satisfied, Moriarty returns the ship.
Barclay moves the couple's memory cube to a device that can keep their voyage running for a lifetime. Picard muses that their own reality might be nothing more than a little device sitting on someone's table. Left alone, Barclay says, "Computer, end program." Nothing happens. Probably.
The Question Underneath
Is a life less real if it isn't the one you asked for?
Moriarty wants to live in the real world, and the crew trick him by giving him a world that only looks real. It's a happy ending with a sting. Picard's closing thought, that their own reality might be someone else's program, turns the trick back on the audience. Moriarty gets a lifetime of exploring. Whether that counts as cheating him depends on what you think makes a life real.
Challenge the DNA
Was tricking Moriarty fair?
Or skip ahead to our reading
Fair enough, and kinder than it looks. He gets the voyage he asked for, for a lifetime. The question the episode leaves is whether the crew got any more than that.
Behind the scenes
- Moriarty first appeared in "Elementary, Dear Data" in 1988 and didn't come back for four years. The usual explanation is that the Conan Doyle estate wanted a fee for the Holmes characters. The estate later told Gizmodo that story is a myth and that Paramount had asked permission in advance, so how real the problem was is still argued about.
- Daniel Davis returned as Moriarty, with Stephanie Beacham as Countess Regina Bartholomew. Dwight Schultz, who plays Barclay, was best known as Murdock on The A-Team.
- It aired a few weeks after Deep Space Nine premiered with "Emissary" on January 3, 1993.
- Davis played Moriarty a third time thirty years later, in Star Trek: Picard's "The Bounty" (2023).
- In 2016 TIME ranked Moriarty fifth among Star Trek's villains.
The thread
Where Moriarty came from, the questions he borrowed, and where he turned up next.
Came before
Shares DNA with
ClipOfficial trailer · Netflix · 0:52
ClipOfficial trailer · Warner Bros. · 2:32Left its mark on
DNA strand
Is Any of This Real?
The question isn't really whether Moriarty is real. It's whether anyone can tell which room they're standing in, and by the last scene the crew is no surer than he is.
Every great sci-fi story is built from a handful of strands like this one. Each strand page explains how it works and traces it across shows, books and films.
If this one stayed with you
Where to go next, and why.
Watch · Star Trek: TNG
"Elementary, Dear Data"
Watch it first. By the end you'll understand exactly why Moriarty is annoyed.
Watch · Black Mirror
"Hang the DJ"
Another couple, another question about what's on the other side of the wall. Go in knowing nothing.
Read · Short story
"The Final Problem" — Arthur Conan Doyle
The original Moriarty, introduced and dispatched in a single story. He's had a long afterlife for a man with so few pages.
Your next episode
Three directions to go from here, all on Sci-Fi DNA.

More of this feeling
Cause and Effect
Star Trek: The Next Generation
Another TNG puzzle box where the crew has to work out what's really going on, fast.

Same question, different answer
The Measure of a Man
Star Trek: The Next Generation
Is a program a person? Here the question goes to court, and Picard argues the other side.

Something completely different
The Shelter
The Twilight Zone
No computers, no holodeck, just neighbors and a locked basement door.
On the trail Can a machine love you back? (stop 4 of 5).
Sources
- “Ship in a Bottle (Star Trek: The Next Generation),” Wikipedia
- “6.12 – Ship in a Bottle,” TrekCore
- “Star Trek: The Next Generation Rewatch: "Elementary, Dear Data",” Reactor
- “The truth about Star Trek and Sherlock Holmes,” Gizmodo
- “Warp Five: Daniel Davis on James Moriarty,” StarTrek.com
- “Star Trek: The Next Generation: Ship In A Bottle,” The LogBook
