text-comparison-validator — subagent
A subagent that checks extracted text against an existing markdown file, line by line. It flags missing words, typos, formatting drift and paragraph structure problems, then reports them with line numbers.
npx claude-code-templates@latest --agent ocr-extraction-team/text-comparison-validatorWhat text-comparison-validator does
It runs as a separate agent inside Claude. You hand it two sources: the text after extraction (OCR output, for instance) and the file to compare against. From there it walks the lines and diffs them.
What lands in the report: missing and extra words, substituted characters, typos. Formatting gets its own pass — bullet markers • vs - vs *, numbering styles 1. vs 1) vs (1), heading level mismatches, indentation, stray or dropped line breaks. Then structure: paragraphs merged that should stay apart, paragraphs split that belong together, reordered sections.
Output order is fixed. A short summary with an overall accuracy percentage first. Then findings grouped by category: content discrepancies, character errors, formatting, structure. Each item quotes the relevant lines from both sources, explains the difference, gives the line number, and suggests a likely cause such as an OCR error or a formatting glitch. It closes with correction recommendations.
Findings are ranked by severity: critical for missing content, major for clusters of typos or broken paragraphs, minor for formatting and single characters. The agent carries only Read and Write, so it reads and writes files and runs nothing. When it cannot tell which version is correct, it does not guess — it shows both and asks. Worth knowing before you point it at a document where the right version is not obvious.
What it helps with
- check OCR output against the original markdown file
- catch missing and extra words across two document versions
- spot mismatched bullet markers and numbering styles
- find merged and split paragraphs
- get a correction list with line numbers
Example prompts for the agent
- Compare the extracted text in
output.txtagainstsource.mdand list the line-by-line differences - Check
draft.mdagainstreference.mdand flag typos and formatting issues - Diff these two files and rank the findings as critical, major and minor
How to install text-comparison-validator
1claude-code-templates
npx claude-code-templates@latest --agent ocr-extraction-team/text-comparison-validator2Manually: put the files in place
.claude/agents/text-comparison-validator.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/text-comparison-validator.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/text-comparison-validator.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about text-comparison-validator
How do I install text-comparison-validator in Claude?
Through the templates CLI: npx claude-code-templates@latest --agent ocr-extraction-team/text-comparison-validator. The agent file then sits at .claude/agents/text-comparison-validator.md.
What does text-comparison-validator do?
It compares extracted text with a markdown file line by line. It looks for missing content, typos, formatting drift and structural differences, and returns a report with line references.
Which tools does the agent have?
Only Read and Write. It reads both sources and writes the report; it does not execute commands.