local-doc-ocr

local-doc-ocr is a skill for Claude Code, Codex from XiaoLuoLYG/GOD. It costs 221 tokens per session (3,307 once invoked), scanned A, original, Apache-2.0.

A local OCR tool that turns scanned PDFs and images into editable text. OCR, or optical character recognition, reads text from pictures; one available mode works offline after its initial setup.

In plain words
What is it for?
Use it to extract text from scanned PDFs or images, convert scans into Markdown files, and prepare scanned material for a knowledge base.
Why use it?
It makes scanned documents searchable and reusable without sending sensitive files to an online service. It can also handle documents containing tables, handwriting, or stamps through an image-reading mode.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is # 随后由支持多模态的 Agent 读取 ./pages/page_01.png 验证.

Good fit Use it to extract text from scanned PDFs or images, convert scans into Markdown files, and prepare scanned material for a knowledge base.

Compare 6 skills from other repositories ↓
About the project

GOD is a control room for observing and directing societies of language-model agents running in simulated worlds. It lets researchers inspect replays, question individual agents, alter future events, reset simulations, and export experiments for reuse. The catalogue entries are skills and agents for operating and investigating these simulations.

XiaoLuoLYG/GOD · 1,292 stars · on GitHub · xiaoluolyg.github.io

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/XiaoLuoLYG/GOD
agentmods
npx agentmods add skills/xiaoluolyg/god/local-doc-ocr

Made for: Claude Code, Codex.

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 local-doc-ocr

README.md
[![agentmods](https://agentmods.dev/badge/skills/xiaoluolyg/god/local-doc-ocr/github.svg)](https://agentmods.dev/skills/xiaoluolyg/god/local-doc-ocr)
Your own site
<a href="https://agentmods.dev/skills/xiaoluolyg/god/local-doc-ocr"><img src="https://agentmods.dev/badge/skills/xiaoluolyg/god/local-doc-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 local-doc-ocr

Your own site · 80×15
<a href="https://agentmods.dev/skills/xiaoluolyg/god/local-doc-ocr"><img src="https://agentmods.dev/badge/skills/xiaoluolyg/god/local-doc-ocr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 221 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,307 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00221 $0.03307
Opus 5.5 $0.00088 $0.01323
Sonnet 5.5 $0.00044 $0.00661
Haiku 4.5 $0.00022 $0.00331

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

Security

Grade A, and why

local-doc-ocr scanned grade A with 0 findings 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 17d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/ocr_offline.py, scripts/pdf_to_images.py, scripts/preprocess_img.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

jiuwenclaw/jiuwenswarm/resources/agent/workspace/skills/local-doc-ocr/SKILL.md · 144 lines

How it starts

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

本地文档 OCR(扫描件 / 图片 → 文字)

30 秒快速开始

  1. 准备一份扫描件 PDF 或图片(技能包内已附 examples/sample_scan.png / sample_scan.pdf 可直接试跑)。
  2. 终端运行(首次会自动装好依赖,需联网一次):
    python scripts/ocr_offline.py "examples/sample_scan.png"
    
  3. 同目录生成 sample_scan_OCR.md,即为识别结果;examples/sample_scan_OCR_example.md 是预期效果示意,可对照。
  4. 含表格 / 手写 / 印章、想要更高质量?走「路线 B:多模态读图」。
  5. 涉密资料?全程用「路线 A(RapidOCR)」即可,数据不出本机。

运行环境要求

  • Python 3.8+:本技能无法替你安装 Python 解释器,请先确保本机已安装。
  • 能执行本地脚本的 Agent:本技能由 Python 脚本驱动,需运行环境支持调用 python / bash(如 WorkBuddy、Claude Code、Cursor)。纯对话型 Agent(不能运行本地脚本)不适用。
  • **引擎 B(多模态读图)**额外需要 Agent 支持图片输入(如 WorkBuddy 的 Read 工具);不支持多模态时自动退回引擎 A。

依赖自动配置(首次使用)

⚠️ 透明说明:本技能首次运行会联网一次,仅安装声明过的 4 个白名单依赖(rapidocr-onnxruntime / pymupdf / pillow / numpy),装好之后全程离线、不再联网,绝不安装任何未知包。如环境不允许自动安装,可手动 pip install -r requirements.txt 预装(效果等价)。

本技能带环境自检 + 自动安装机制(A 档):

  • 首次运行脚本时,setup.py 会检测 rapidocr-onnxruntime / pymupdf / pillow / numpy 四个依赖,缺失哪个自动从 PyPI 安装哪个(优先清华镜像,PyPI 官方兜底)。
  • ⚠️ 首次自动安装需联网一次(仅安装声明过的白名单依赖,不装任何未知包,透明可控);装好之后全程离线、不再联网。
  • 也可手动预装(等价效果):
pip install -r requirements.txt

依赖清单(详见 requirements.txt):

  • rapidocr-onnxruntime:引擎 A 的离线 OCR 核心(ONNX,纯 CPU)
  • pymupdf:PDF 渲染为图片
  • pillow、numpy:图像处理与计算
  • 若自动安装失败,按上方命令手动安装即可。

何时使用

  • 用户发来一份 PDF,但 markitdown / pdfplumber 提取为 0 字(扫描件 / 图片型 PDF)。
  • 用户发来照片、截图、扫描图片,需要提取其中文字(含手写体、表格、印章)。
  • 用户用「识别」「读一下这份」「把这个读出来」「转成文字」等模糊说法要求处理 PDF / 图片时(⚠️ 若明确要求「识别隐患 / 安全隐患」则属安全检查类技能,本技能只做文字提取,不判安全)。
  • 任何「读取这个文件/图片里的字」「OCR 一下」「把扫描件变成可编辑文字」类请求。
  • 用户要将扫描件 PDF / 图片(文字提取为 0 字)整理进知识库时,本技能可作为预处理自动介入。
  • 涉密 / 敏感或隐私资料,要求本地处理、不联网、不外传。

核心原理

扫描件 PDF 本质是「一页页图片打包」,传统文本提取工具读不到字。本技能用双引擎解决:

  • 引擎 A · RapidOCR(离线保底):PyMuPDF 渲染 → RapidOCR(ONNX, 纯 CPU) 逐页识别 → 自动拼 .md 落盘。不依赖多模态、不联网、不占 token、可批量,是默认与涉密首选路线。
  • 引擎 B · 多模态读图(高质量):PDF 渲染为 PNG → 由支持多模态读图能力的 Agent 逐张读取(如 WorkBuddy 的 Read 工具),模型「看图识字」。擅长表格还原、手写签名、印章、模糊图,质量高于引擎 A,但消耗多模态额度。注意:引擎 B 的隐私性取决于 Agent 的多模态实现是否本地运行;敏感资料请优先走引擎 A。

两步均在本机完成;图片与文字不上传任何外部服务,满足涉密与隐私要求。

Read the full file on GitHub · 144 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 17d ago First seen · 144 lines · 221 tokens per session scan A a2c9422fad7b

Subscribe to this mod's changes

local-doc-ocr is a skill published in the GitHub repository XiaoLuoLYG/GOD (1,292 stars, last pushed 5d ago), licensed Apache-2.0. It adds 221 tokens to every session and 3,307 once invoked, about $0.0009 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-13.

Related

local-doc-ocr compared with skills from other repositories

local-doc-ocr next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
local-doc-ocrXiaoLuoLYG/GODSkill1.3k5d agoApache-2.0A221Claude Code, Codex
paddleocr-doc-parsingPaddlePaddle/PaddleOCRSkill93k2mo agoApache-2.0A140Claude Code, Codex
paddleocr-text-recognitionPaddlePaddle/PaddleOCRSkill93k2mo agoApache-2.0A125Claude Code, Codex
adelanding-ai/ade-cliSkill2.4k1mo agoApache-2.0A65Claude Code, Codex
mineruopendatalab/MinerUSkill85kyesterdaynoneA147Claude Code, Codex
document-processingericrisco/rsc-harnessSkill6825d agoMITA84Claude Code, Codex
bank-statement-parsingjohnsonhk88/AI-Bank-Statement-Document-Automation-By-LLM-And-Personal-Finanical-Analysis-PredictionSkill6383d agoApache-2.0A23Claude Code, Codex