Skip to main content
subagent

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.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --agent ocr-extraction-team/text-comparison-validator
Open on GitHub

What 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.txt against source.md and list the line-by-line differences
  • Check draft.md against reference.md and 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-validator

2Manually: put the files in place

.claude/agents/text-comparison-validator.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

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.

Similar subagents

All subagents for Agent setup: memory, context, orchestration →

From the same set205

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor