extracting-with-ocr

extracting-with-ocr is a skill for Claude Code, Codex from xberg-io/xberg. It costs 42 tokens per session (1,287 once invoked), scanned B, original, MIT.

A method for reading text from scanned PDFs, photographed pages, screenshots, and image files when the document has no usable text layer. OCR, or optical character recognition, converts the visible letters into text.

In plain words
What is it for?
Use it to extract text from scans and pictures, choose recognition languages or processing engines, and force a fresh scan when existing PDF text is unreliable.
Why use it?
It makes image-based documents searchable and extractable, including PDFs whose built-in text is missing or garbled.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Part of the xberg plugin — 7 skills, 1 MCP server shipped together

Good fit Use it to extract text from scans and pictures, choose recognition languages or processing engines, and force a fresh scan when existing PDF text is unreliable.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xberg-io/xberg/extracting-with-ocr
About the project

Xberg is a document-intelligence engine that reads files, URLs, archives, and source trees and extracts text, metadata, images, tables, and structured data, with additional code-language understanding. Developers use it through language bindings, a command-line tool, REST API, or MCP server, and the catalogue entries support those integrations.

xberg-io/xberg · 9,281 stars · on GitHub · docs.xberg.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add xberg-io/xberg --skill extracting-with-ocr
Clone the repo
git clone --depth 1 https://github.com/xberg-io/xberg

Made for: Claude Code, Codex.

Or install xberg, the plugin that ships this one along with the rest of its 7 skills, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for extracting-with-ocr

README.md
[![agentmods](https://agentmods.dev/badge/skills/xberg-io/xberg/extracting-with-ocr/github.svg)](https://agentmods.dev/skills/xberg-io/xberg/extracting-with-ocr)
Your own site
<a href="https://agentmods.dev/skills/xberg-io/xberg/extracting-with-ocr"><img src="https://agentmods.dev/badge/skills/xberg-io/xberg/extracting-with-ocr/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for extracting-with-ocr

Your own site · 80×15
<a href="https://agentmods.dev/skills/xberg-io/xberg/extracting-with-ocr"><img src="https://agentmods.dev/badge/skills/xberg-io/xberg/extracting-with-ocr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,287 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Privilege Escalation · line 58
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
  • medium Privilege Escalation · line 61
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.01287
Opus 5 $0.00021 $0.00643
Sonnet 5 $0.00008 $0.00257
Haiku 4.5 $0.00004 $0.00129

Measured 10d ago against content hash 78fd4c616c81, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

extracting-with-ocr scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo apt install tesseract-ocr-deu tesseract-ocr-jpn tesseract-ocr-fra
plugin/.ai-rulez/skills/extracting-with-ocr/SKILL.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Extracting with OCR

Use this when a document is image-based: scanned PDFs, photographed pages, screenshots, JPEG/PNG/TIFF with text. Xberg auto-OCRs raster images and auto-detects PDFs that lack a text layer. Force it on when extraction returned empty/garbled text from a PDF that "looks" textual.

When to force OCR

  • Extraction returned an empty content field, but the file opens visually.
  • The PDF text layer is junk (copy-paste from a viewer produces gibberish).
  • You want consistent output across mixed scanned + digital PDFs.
xberg extract scan.pdf --force-ocr=true
xberg extract scan.pdf --ocr=true --ocr-language eng

If a page has an unreliable text layer, --force-ocr=true re-rasterizes and runs OCR on every page.

Backends

Tesseract is the default and ships with the CLI — no extra install. Other backends are opt-in:

Backend Flag Install Notes
Tesseract --ocr-backend tesseract (default) bundled Best general-purpose, 100+ languages via tessdata.
PaddleOCR --ocr-backend paddle-ocr bundled (ONNX Runtime) Strong on Asian scripts. Not available on WASM or Windows.
Candle VLM --ocr-backend candle-trocr (and other candle-*) bundled (Candle) Local vision OCR models (candle-trocr, candle-paddleocr-vl, candle-glm-ocr, candle-deepseek-ocr).
VLM (hosted) --ocr-backend vlm + --vlm-model liter-llm provider (--vlm-api-key) Multimodal LLM via liter-llm. Use when OCR fails on dense or handwritten layouts.

Pick Tesseract first. Switch only when accuracy is unacceptable.

Read the full file on GitHub · 124 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 124 lines · 42 tokens per session scan B 78fd4c616c81

Subscribe to this mod's changes

extracting-with-ocr is a skill published in the GitHub repository xberg-io/xberg (9,281 stars, last pushed today), licensed MIT. It adds 42 tokens to every session and 1,287 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

cardputer-buddy

Iterate on the Cardputer-Adv MicroPython app bundle (Claude Buddy, Snake, Hello) after the device is already provisioned via m5-onboard. Use when the user wants to add a new app, push a single changed .py without re-flashing, watch device serial logs, or run a one-shot REPL command. Trigger on "add an app", "push to…

anthropics/claude-plugins-official · 109 tokens

holoscan-install-wheel

Install Holoscan SDK Python wheel via pip into a venv. Use for Python installs; not for native C++/apt or Conda installs.

NVIDIA/skills · 37 tokens

HA Integration Dev

Home Assistant custom integration development in Python. Covers customcomponents, DataUpdateCoordinator, configflow, OAuth2, conversation agent, HACS publishing, device registry, entity platforms, services, repair issues, diagnostics, Bluetooth integrations, and multi-coordinator patterns.

tonylofgren/aurora-smart-home · 55 tokens

triton-ascend

A guide to writing Triton kernels for Ascend NPUs. Triton is a Python-based language for describing parallel operations that run in blocks across the device.

mindspore-ai/akg · 28 tokens

triton-ascend-case-index-put

An optimization pattern for indexed assignment, which writes values into positions chosen by index arrays. It loads index data into fast on-chip memory so a loop can reuse it.

mindspore-ai/akg · 73 tokens

xpu-port

Execute a single-target CUDA-to-XPU port of a PyTorch repo with libcst-based scan, mechanical rewrite, and CPU FP64 vs target-dtype correctness verify on one forward pass. Use when the request says "port" — "port my repo to XPU", "port my repo at to XPU", "rewrite the CUDA calls to XPU", "apply the mechanical…

intel/gpu-ai-skills · 193 tokens