
Check Story Facts with Continuity Check
Find story details that may disagree across scenes or chapters. #写作
Find story details that may disagree across scenes or chapters.
Review each candidate with exact quotes, line numbers, and a question for the author.
Continuity Check — Paste Scenes, Get Facts That Disagree
Send scenes or chapters; get a table of facts that disagree between places (ages, eye colours, objects, days, places), each with two or more exact quotes and line numbers. Every item ends with a question for the author that names both versions; the checker does not check whether a question leans towards one of them (the skill steps ask Claude to keep it neutral).
Claude reads the scenes and writes a draft JSON. The local checker verifies every quote word for word, the line it is on, the cautious wording and the question form, then renders Markdown, JSON or CSV. A candidates helper lists names next to ages, colours, counts and dates so the reader knows where to look; candidates are hints, not conclusions.
Use
Requires Python 3.9 or later. Standard library only. No account, network or external service.
python3 scripts/continuity_check.py check examples/draft.json --text examples/scenes.md
python3 scripts/continuity_check.py candidates --text examples/scenes.md
python3 scripts/continuity_check.py check examples/draft.json --text examples/scenes.md --format csv --output report.csv
What you can do:
- Where to look first:
candidates --text scenes.mdlists names whose age, colour of a thing, count, date, weekday or year differs between lines (hints only; it misses many disagreements). - A fact sheet per name:
candidates --text scenes.md --alllists every name-and-value fact, including ones that appear once. - A checked report for the author:
check draft.json --text scenes.mdgives Markdown with each disagreement, line, section, quotes, why and a question. - A spreadsheet of disagreements:
check ... --format csv --output report.csvgives one row per quote, with formula-leading cells prefixed with'. - Data for another tool:
check ... --format jsongives status, line count, and items with line and section per quote. - Things you could not settle: an
unclearlist in the draft becomes a separate "Unclear — ask the author" section (one quote is enough). - Pin a quote to a line:
"line": 14on a source makes the checker fail if the quote is not on that line.
Draft shape
{
"conflicts": [
{
"subject": "Mara",
"detail": "age",
"sources": [{"quote": "Mara Quill was twelve years old"}, {"quote": "Mara, fourteen years old"}],
"why": "Scene 1 and Scene 3 may be days apart, so the two ages could disagree.",
"question": "Is Mara twelve or fourteen during these scenes?"
}
],
"unclear": []
}
What the checker verifies
- Each quote appears in the text exactly (case and spaces as written, NFC-normalised), on word boundaries, on one line. A quote may not stop inside a contraction or a number (
isn'ofisn't,12of12.5). Two quotes in one item must not overlap: the same or an overlapping stretch of text counts as one place. - A quote without
"line"that appears more than once is placed at its first free match, and the report says so (5 (match 1 of 2; add "line" to pin)). - A conflict cites 2 to 6 places and its quotes are not all identical. An unclear item cites 1 to 6.
whyuses lower-case could, may or might, a sentence-opening May/Might/Could (not "May 14", the month), perhaps, possibly, maybe or seem (or かもしれ/可能性), or is itself a question that passes the question check below.questionends with?or?(a closing quote or bracket after it is fine:?"), whatever character it starts with. In English, a clause must start with a question word or auxiliary (is, did, which…), have which/what/when… in its first three words, or offer options with "or" ("Brown or grey?"). A statement followed by a short tag is refused ("…, isn't she?", "…, right?", "…, is she not?").- A conflict's
questionmust name both versions: for at least two of the quotes it uses a word that only that quote has ("Is Mara twelve or fourteen?" passes; "Should Scene 3 say twelve, as Scene 1 does?" and "Which is wrong, Scene 1 or Scene 3?" are refused). Number words and digits count as the same word (twelve = 12); words such as the, her or was do not count, unless the versions differ only in such words, or differ in his/her (or another pronoun) on both sides ("His sister arrived" / "Her sister waited": "Is she his or her sister?" passes). The checker does not check whether a question leans towards one version ("Is Scene 3 wrong to say fourteen when Scene 1 says twelve?" names both and passes); keeping it neutral is the writer's job. - No extra keys (there is no field for the "right" answer), no repeated subject and detail, no two items citing the same places.
It does not judge whether a quote really supports the item, and a hedge word does not prove the sentence is neutral; the writer confirms that.
Limits and errors
Draft up to 200,000 bytes; text up to 1,000,000 bytes; 40 conflicts, 20 unclear items, 6 quotes per item, 80 characters per subject or detail, 400 per quote, why or question. UTF-8 and BOM-marked UTF-16 are read; a file without a BOM that contains a NUL byte, or whose control bytes fall on every other byte (BOM-less UTF-16 of Greek, Cyrillic, Hebrew and similar scripts), is refused, as are other encodings. Numbers in the draft may have at most 30 digits. Section labels come only from lines starting with # (# Chapter 3, # 第二章) and from scene-break lines made only of symbols (***, ---, * * *, labelled "Section N"). Any other line is text, however short: a one-line paragraph such as "Mara was fourteen years old" or "Chapter 3" without # is not a heading. The line count does not include an empty line after the final newline. Bad input gives one error: line and exit code 2 (on every Python version). --output must be a non-empty path in an existing folder and must not be an input file; an existing output file keeps its permissions, and a symbolic link is written through to the file it points at. Control and direction-override characters are replaced with � in output. If the terminal cannot show the report, use --output.
candidates is a hint and misses many disagreements: it only sees ages written "N years old" or "N years of age", a colour word right before a noun, a number right before a plural noun, dates, weekdays and years. It reads English names only: a capitalised word that never appears in lower case and occurs twice, or once mid-sentence. Pronouns (he, she, they, it, I, we, you and their forms; 彼, 彼女) are never names. A value belongs to the name that opens its clause (clauses split at commas, semicolons, dashes, "and" and "but"; a clause opened by a pronoun has an unknown owner), to every name of a plural subject ("Mara and Jonah were twelve", "Mara, Jonah and Odile were all twelve"), to "X" when written "X's grey eyes", or to "X's father" when written "X's father was forty". A clause that is only the value or starts with "who" ("Mara, fourteen years old", "Lucia, who was twenty-six years old") takes the name from the clause before. Otherwise the owner is unknown; a name from an earlier sentence is never used. Twenty-six = twenty six = 26, May 14th = May 14 = 14th of May. At most 200 groups are shown; the Markdown and JSON output (and a note: line on stderr for CSV) say how many were cut.
Examples
The package includes a three-scene story, the draft Claude wrote for it, and the expected outputs of the first two commands above.
Tests
Run python3 -m unittest discover tests from the package folder.


