
Fix Story Gaps with Plot Hole Finder
Review possible plot holes tied to exact lines in one chapter. Get quoted evidence, line numbers, and a tentative fix to consider; the checker does not decide what is a plot hole. #Writing
Review possible plot holes tied to exact lines in one chapter.
Get quoted evidence, line numbers, and a tentative fix to consider; the checker does not decide what is a plot hole.
Plot Hole Finder — Story Gaps, Quoted From Your Chapter
Claude reads one chapter and drafts the plot holes it finds; a local checker verifies that every flagged gap quotes the chapter word for word, cites the right number of lines, and offers a tentative fix rather than a rewrite.
The checker never decides on its own what is a plot hole. It validates and formats a Claude-authored draft, so each item is tied to text you can see in your own chapter.
Use
Requires Python 3.9 or later. No dependencies, account, network, or external service is used. Claude writes a draft JSON with the chapter and a list of holes, then runs:
python3 scripts/plot_hole_finder.py check examples/draft.json
python3 scripts/plot_hole_finder.py check examples/draft.json --format json
python3 scripts/plot_hole_finder.py check examples/draft.json --format csv --output report.csv
Each hole has a type, a list of quotes, and a one-line fix:
no_motivation— a character acts with no reason shown. Cite one sentence.contradicts_earlier— two lines disagree. Cite both lines (exactly two quotes).unexplained— something happens with no cause or no reaction. Cite one sentence.
Every quote must appear verbatim in the chapter, on word boundaries (a quote may not start or end in the middle of a word, including accented words such as Renée or café). The fix must read as a suggestion: it must hedge with may, might, or could (in lower case), or perhaps, possibly, maybe, or seem(s). A modal immediately followed by not, never, hardly, or an n't contraction is a negation, not a hedge, and the capitalised name May never counts.
The tool checks the fix by shape only: it reads the hedge, whether the fix quotes a new sentence (prose in quote marks that is not in the chapter), and the word count — 25 words or fewer. It does not judge whether the fix is phrased as a rewrite command (rewrite…, delete…, I would replace…); that is left to the SKILL procedure, which has Claude write a hint rather than a rewrite. Quoting the chapter's own words inside a fix is allowed.
Checks and limits
The tool checks the draft shape, the allowed hole types, the exact quote count per type, that each quote occurs in the chapter on word boundaries, that fixes hedge and do not quote a new sentence or run past 25 words, and that no hole repeats (a contradiction citing two quotes is the same hole whichever order they are written in). It confirms the quoted words are present; the writer must separately confirm that a quote truly marks a plot hole. It does not read the chapter for meaning or invent holes.
Markdown punctuation is escaped, CSV formula-leading cells are prefixed with an apostrophe, and unsafe control characters and bidirectional overrides are replaced. Errors use one error: line and exit code 2. Output folders must already exist, and an output path may not overwrite the input. If the terminal cannot encode the report, use --output.
Drafts are limited to 200,000 bytes, 120,000 chapter characters, 40 holes, and 400 characters per fix. UTF-8 and BOM-marked UTF-16 are supported; BOM-less UTF-16 and other invalid encodings are rejected. The chapter and quotes are normalised to NFC first, so a composed and a decomposed Renée match. Japanese, Korean, Thai, and full-width prose can be quoted: a word boundary is only required where both the quote edge and the neighbouring character are letters of a space-delimited script (Latin, Cyrillic, Greek, and the like), so a quote may abut a CJK ideograph, kana (including the iteration marks 々〆 and half-width kana), a Hangul syllable, a Thai letter, or a full-width letter without cutting a word. Python standard library only.
Examples
The package holds five example drafts: four chapters with flagged holes and one clean chapter that returns a clear status, with the checker output for all five.
Tests
Run python3 -m unittest discover tests from the package folder.

