Batch parse a folder of PDFs and images to markdown with LaTeX, tables, and layout boxes using baidu/Unlimited-OCR locally, with checkpoint/resume and incremental writes.
Ships in unlimited-ocr. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Process an entire folder of images and PDFs without losing work to interruption, using the same proven baidu/Unlimited-OCR model that powers unlimited-ocr-parse-document. Results are written incrementally to a manifest, so a long run that gets interrupted can be resumed without reprocessing.
Self-Evolving Skill: every number and guarantee below was measured on this hardware, not copied from upstream documentation. If a guarantee stops holding, fix this file and references immediately rather than deferring. Re-verify before changing a documented fact.
../../references/PITFALLS.md § 3.0 if all files succeeded without repetition, 1 if some files had repetition suspected (check before trusting), 2 if any files failed with hard errors. Per-file status is always recorded in the manifest.Charts come back empty. Fed a nine-panel matplotlib figure, the model returned nine perfectly-placed chart bounding boxes and zero characters. That is correct for a layout parser and catastrophic if you assumed an image captioner.
If you need the content of charts, use unlimited-ocr-segment-figure to crop each detected region independently, then hand the crops to a vision model that does describe images.
S=~/eon/cc-skills/plugins/unlimited-ocr/scripts/unlimited_ocr_batch_folder_parser.py
# Process a folder, writing results incrementally to ~/results/
uv run --no-project $S --folder ~/my_documents --output ~/results
# Resume from where it left off (skips everything in the manifest)
uv run --no-project $S --folder ~/my_documents --output ~/results
# Collapse character-spaced math (c u r v e -> curve), keep tables as HTML
uv run --no-project $S --folder ~/my_documents --output ~/results \\
--collapse-math --table-format html
# Use a specific backend (mlx on Apple Silicon, cuda on NVIDIA)
uv run --no-project $S --folder ~/my_documents --output ~/results --backend mlx
# Suppress per-file progress (quieter stderr)
uv run --no-project $S --folder ~/my_documents --output ~/results --quiet
~/results/
manifest.jsonl # One JSON object per file, newline-delimited
progress_report.txt # Summary at the end
<image_stem>.md # Markdown for each input image
<pdf_stem>.md # Markdown for each page of each PDF
<pdf_stem>.json # Layout boxes and metadata (optional)
Every line in manifest.jsonl is:
{
"source_path": "/path/to/image.png",
"output_md": "image.md",
"output_json": null,
"status": "done",
"elapsed_seconds": 2.4,
"backend": "mlx",
"page_count": 1,
"error_message": null
}
Statuses are:
done — parsed successfully, no repetition detectedrepetition_suspected — parsed, but a repetition detector fired; inspect before trustingfailed — error (see error_message)| Flag | Values | Default | Meaning |
|---|---|---|---|
--folder | PATH | (required) | Input folder; searched recursively for images + PDFs |
--output | PATH | (required) | Output folder; created if missing |
--backend | auto, mlx, cuda | auto | Which backend: MLX for Apple Silicon, CUDA for NVIDIA GPU |
--collapse-math | (flag) | off | Rejoin c u r p d f into curpdf inside math (measured fix for the model's output format) |
--table-format | html, pipe | pipe | HTML tables or pipe-markdown; pipe is suitable for concatenating into markdown documents |
--strip-det | (flag) | off | Remove layout bounding box markers from output |
--quiet | (flag) | off | Suppress per-file progress to stderr |
--allow-withheld-prompt | (flag) | off | Force a withheld prompt mode (rarely needed; see ../../references/PITFALLS.md § 1) |
The script is safe to interrupt (Ctrl+C) at any time:
To re-process a file: delete its line from manifest.jsonl and re-run.
--backend auto (default) prefers MLX on Apple Silicon, CUDA on NVIDIA.
| Apple Silicon (MLX) | NVIDIA (transformers) | |
|---|---|---|
| Model | mlx-community/Unlimited-OCR-mxfp8 (3.66 GB) | baidu/Unlimited-OCR (6.67 GB bf16) |
| Measured on | M3 Max, 36 GB | RTX 4090, 24 GB, Ada SM 8.9 |
| Single image | 2.4 s, 5.2 GB peak | 3.7 s, 8.3 GB peak VRAM |
| Determinism | greedy, T=0 | byte-identical on re-run |
Full benchmarks and platform notes: ../../references/EMPIRICAL.md.
Exit code 1 means repetition was suspected, NOT that the run failed. The detector is structural (short chunks repeating in the tail), not probabilistic, so a NEW repetition is caught, not just the known ones from the reference table.
Measured base rate: ~4 % on tables (103 real images from the quantml corpus). Budget for it, but do not discard the output automatically — check it first. Most will be valid despite the warning.
All repetition detections are recorded in the manifest, so you can filter afterward:
jq 'select(.status == "repetition_suspected")' ~/results/manifest.jsonl
Q: Can I run this on a CPU?
No. The model's only published runtimes are MLX (Apple Silicon, GPU-backed) and transformers/CUDA (NVIDIA GPU). A CPU implementation does not exist. On a Mac, you have Apple Silicon MLX available.
Q: How long does a 1,000-image folder take?
~2 hours on a single M3 Max at ~7 s/image median. Every image runs in its own process, so if you have spare cores, parallelizing across multiple invocations (folder splits) will help. A separate tool for that is outside scope.
Q: What if a file is corrupted or unreadable?
It gets marked failed with an error message in the manifest. The batch continues without stopping.
Q: Can I change the output folder without reprocessing?
No. The manifest is tied to the output folder. To reprocess everything, use a new output folder.
All documented in ../../references/PITFALLS.md (every entry was hit while building this plugin) and ../../references/EMPIRICAL.md (every number was measured on the two machines it supports).
Key ones:
.jpg URLs; the CLI reads the first bytes to detect the truth.c u r v e). Pass --collapse-math to rejoin it.<table>, never as pipe-markdown — measured at 88 of 103 real
tables. This batch parser converts them to pipe-markdown by default; pass --table-format html to
keep the model's own serialization.--pad-pixels 0 clips the axis labels off every chart crop. If you use segment, start with the default (12 px) and raise it only if captions are clipped.After this skill completes, check before closing:
../../references/PITFALLS.md § 3; the base rate is ~4 % on tables.progress_report.txt for the final counts.jq 'select(.status == "failed")' manifest.jsonl to see which files errored.--table-format pipe, and charts come back empty.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
batch-ocr, pdf-ocr, image-ocr, checkpoint-resume, document-parsing
3 skills in this plugin
/unlimited-ocr-parse-documentParse an image, PDF, or directory into markdown with LaTeX formulas, HTML/markdown tables, and per-block layout bounding boxes, using baidu/Unlimited-OCR locally — free, offline, no API key, no upload quota. Runs on Apple Silicon via MLX (~2.4 s/image, ~5 GB) or an NVIDIA GPU via transformers. Use when transcribing scanned or image-based documents, extracting equations from a paper, converting a PDF to markdown, OCR-ing screenshots, or replacing a paid vision-API OCR call with a local one. TRIGGERS - unlimited-ocr, ocr this, ocr a pdf, extract text from image, transcribe document, pdf to markdown, document parsing, extract formulas, extract equations, latex from image, local ocr, offline ocr, scanned pdf, image to text, layout parsing, bounding boxes from document./unlimited-ocr-segment-figureSplit a composite figure, screenshot, or dashboard into its individual panels by cropping the layout bounding boxes Unlimited-OCR detects, so each panel can be described separately by a vision model that is good at charts. Turns Unlimited-OCR's refusal to transcribe charts into a pre-processing win — one chart per prompt beats a nine-panel collage per prompt. Use when a vision model is misreading a dense multi-panel image, when you need per-figure crops from a paper or report, or when building a two-stage OCR pipeline that localises first and describes second. TRIGGERS - segment figure, split panels, crop charts from image, multi-panel figure, extract subfigures, per-panel description, layout segmentation, chart crops, split a screenshot into regions, dashboard panels, figure extraction./unlimited-ocr:unlimited-ocr-batch-folderfrom unlimited-ocr
npx claudepluginhub terrylica/cc-skills --plugin unlimited-ocrOther plugins' skills for the same job