Check Your Twine Story for Dead Ends and Broken Links
Open the check page, paste your story as Twee or open the HTML file Twine saves, and press Check. It lists every link to a passage that does not exist, every passage no player can reach, every dead end, and every variable that is read but never set or set but never read. Each finding names the passage and, where a player can get there, the passages that lead there from the start. It runs in your browser, and your file is not uploaded.
What breaks a Twine story?
Most mistakes in a Twine story come from small edits that touch a passage far away:
- You rename a passage. Every link that used the old name now goes nowhere. Twine's story map draws a broken
[[link]]as a red line ending in a "no entry" sign, but a(go-to:)or<<goto>>with the old name gets no line at all. - You write a passage and forget to link it. It sits on the map, and no player ever sees it.
- A passage has nothing to click. If it is not meant as an ending, the player is stuck reading the same text.
- You mistype a variable. You set
$lampand later ask about$lamb. Harlowe's manual says a variable that was never set reads as 0, so the condition is simply false, and the sentence behind it never shows. Nothing warns you.
Playing finds them only on the paths you happen to take, and a story with ten choices of two options each has 1,024 paths. The check looks at every passage and every link at once.
Try it on a small story
This story is in Harlowe, Twine's default story format, written as Twee, the text form of a Twine story. Four mistakes are planted in it, one of each kind above. The check page has it loaded, so you only need to press Check.
:: StoryTitle
The Dark Lighthouse
:: StoryData
{
"ifid": "5B0F6A4E-2C1D-4E8B-9F3A-7D6C5B4A3921",
"format": "Harlowe",
"format-version": "3.3.9",
"start": "Shore"
}
:: Shore
The lighthouse on the cliff has been dark for a week.
[[Climb the rocks->Rocks]]
[[Take the boat->Jetty]]
:: Rocks
(set: $lamp to true)Between the rocks you find an old oil lamp.
[[Go up to the door->Door]]
:: Jetty
The boat bumps against the jetty below the lighthouse.
[[Walk up to the door->Door]]
[[Row out to sea->Sea]]
:: Door
(if: $lamb is true)[Your lamp lights the narrow stairs.]
[[Climb the stairs->Lamp room]]
[[Row home->Home]]
:: Lamp Room [end]
You light the great lamp. Ships can see the coast again.
:: Home [end]
You row home. Behind you, the lighthouse stays dark.
:: Sea
The fog closes in around the boat.
:: Cellar
Barrels of oil, long forgotten.
[[Back up->Door]]
What the check finds
This is the report the check writes for this story, word for word. The check page shows the same findings as a list, with a box to tick next to each dead end.
Story "The Dark Lighthouse", read as Harlowe 3.3.9 (as the file says).
Found 6 problems.
Start: "Shore". Story passages: 8, 6 of them reached from the start.
Variables: 2.
missing-passage: "Door" links to "Lamp room" with [[Climb the stairs->Lamp room]], and there is no passage of that name. Did you mean "Lamp Room"? (line 26)
Path: Shore > Rocks > Door
dead-end: Dead end at "Sea": it has no link out, and it is not tagged as an ending. (line 37)
Path: Shore > Jetty > Sea
unreachable: No player can reach "Lamp Room": no link leads to it. The link to "Lamp room" in "Door" looks meant for it. (line 31)
unreachable: No player can reach "Cellar": no link leads to it. (line 40)
read-never-set: $lamb is read in "Door", and nothing in the story sets it. Did you mean $lamp? That one is set. (line 26)
set-never-read: $lamp is set in "Rocks", and nothing in the story reads it. Did you mean $lamb? That one is read. (line 17)
Ending "Home": Shore > Rocks > Door > Home
Four mistakes give six findings, because two of them cause a second one:
- The stairs link has a small "r". Passage names in Twine are case-sensitive, so "Lamp room" is not "Lamp Room". The good ending can no longer be reached, which is why it is listed as unreachable too, with the link that was meant for it. Only the sad ending, "Home", is still there.
- The sea is a dead end. The path shows how a player gets there: take the boat, then row out.
- The cellar is never linked. Nothing on the way to it is wrong; it is simply missing a way in.
$lambis a typo for$lamp. That is two findings from one mistake: one name is read and never set, the other is set and never read. Each points at the other.
The line numbers are where each passage starts in the Twee file. In Twine itself, look for the passage name on the story map.
How to fix the four mistakes
- In "Door", write
[[Climb the stairs->Lamp Room]]. - In "Sea", give the player a way back, such as
[[Row back->Jetty]]. If the sea is meant to end the story, tag itendinstead. - In "Door", add
[[Go down to the cellar->Cellar]]. - In "Door", write
$lampinstead of$lamb.
Check again, and the report says "No problems found."
What counts as an ending?
A passage with the tag end or ending is an ending, in upper or lower case. In Twine, open the passage, press the Tag button and type end. A passage that is not an ending and has no way on is a dead end.
If you have not tagged your endings yet, every ending shows up as a dead end. On the check page, tick the box next to each one that is meant as an ending, and the check runs again. An ending may still have links on, such as "Play again". The check follows them.
A way back also counts as a way on: Harlowe's (undo:) and (link-undo:), SugarCube's <<back>>, <<return>> and previous(), and Chapbook's {back link}. It leads to any passage that links to this one.
What the check reads in each story format
The story format comes from the file: StoryData in Twee, the format of a Twine 2 HTML file. When the file names none, the check guesses from the markup and says so.
- Every format: the links
[[Target]],[[Text|Target]],[[Text->Target]]and[[Target<-Text]], read the way Twine's story map reads them. - Harlowe 3, links and passages shown inside others:
(go-to:),(link-goto:),(link-reveal-goto:),(click-goto:),(mouseover-goto:),(mouseout-goto:),(redirect:),(display:),(undo:),(link-undo:),(restart:). Variables:(set:),(put:),(move:),(unpack:),bindand2bindset them; every other$namereads one. - SugarCube 2, links and passages shown inside others:
<<link>>,<<button>>,<<goto>>,<<include>>,<<back>>,<<return>>,<<actions>>,<<choice>>, the passage of<<textbox>>and<<numberbox>>,data-passage,previous()and widgets. Variables:<<set>>,<<run>>, link setters,<<for>>, the input macros such as<<textbox "$name">>, andState.variablesin the Story JavaScript. - Chapbook 2, links and passages shown inside others:
{link to},{back link},{restart link},{embed passage}, and{reveal link}with a passage. Variables: the vars section above--,{name},[if]and[unless], the inserts "for" a variable such as{text input for: 'name'}, andengine.statein[JavaScript]. - Snowman and other formats: the links above and
data-passage; variables are not checked.
Passages the story format uses on its own are read as the format uses them. A Harlowe header or footer passage, and SugarCube's PassageHeader and PassageFooter, appear with every passage, so their links count for each one. A link in SugarCube's StoryMenu or StoryCaption makes its passage reachable from anywhere, but it is not a way on from a dead end. StoryInit, PassageReady, PassageDone and passages tagged startup or init count for their variables only. A passage that only ever appears inside others, through (display:), <<include>> or {embed passage}, is checked as part of those.
What the check does not do:
- It does not work out conditions. A link inside
(if:)or<<if>>counts as always there. A dead end that only happens when a condition is false is not found. For stories where that matters, the story path check walks every combination of yes-or-no facts, once your AI has written the story down as scenes and choices. - It cannot follow a passage named while playing, such as
(go-to: $next). The report lists each one. A passage with one is not called a dead end, and a passage reported as unreachable could still be reached through one. - It skips temporary variables (
_name), which live in one passage only. - It does not read Ink. For Ink, the Inky editor and its compiler already warn you while you write about diverts to knots that do not exist, and about places where the story runs out without
-> ENDor-> DONE.
Your file stays on your computer
The check page reads your file with your browser and checks it there. Nothing you paste or open is uploaded, and the page is not allowed to send it anywhere. The check page says how that works.
Which other tools check Twine stories?
Several, and some may suit you better. What each does, from its own documentation, as of November 2026:
- Twine itself draws a broken
[[link]]on the story map, and Story > Details counts broken links. It does not read macros or report dead ends. - Tweego, the command-line compiler for Twee, warns about two passages with the same name and stops when the start passage is missing.
- twee-ts is a command-line tool whose
--lintoption reports broken links, dead ends and orphans. - Knot is a VS Code extension that reports broken links, unreachable passages, dead ends and uninitialised variables, in full for SugarCube.
- DotGraph is a proofing format for Twine that draws your story as a graph and marks missing and unreachable passages.
- Harlowe's Debug Mode and SugarCube's test mode show errors in the passages you actually play.
This check runs in the browser with nothing to install, reads the macros and variables of Harlowe, SugarCube and Chapbook, and gives the path from the start to every dead end and broken link.
Have your AI check it too
If your AI writes passages for you, have it run the same check in your project after every change. Paste this:
My Twine story is in [file name]. Check it with the tested code from
Spielerando, and show me what the checker says, not what you think.
1. First draw my story as a Mermaid flowchart: one box per passage, one
arrow per link, my endings marked. Ask me which passages are endings
if they have no "end" tag.
2. Take the code of the Twine story check
(https://spielerando.com/en/recipes/twine-story-check) and the story
path check it uses for the walk
(https://spielerando.com/en/recipes/story-graph-check). Run its tests
first and show me that they pass.
3. Run the check on my story file and show me the report exactly as it
is printed.
4. For each finding, tell me the fix you suggest. Change nothing until I
say yes.
5. After the fixes, run the check again and show me the new report.
Never tell me the story is fine unless the report says
"No problems found."
Where to go next
- How to build a branching story that does not break shows how to check a story whose links depend on what the player did.
- How to write a game ending players remember is about making each ending worth reaching.
- The Twine story check recipe has the code and its tests.