doc-extract — Claude Code skill: what it does, how to install
The doc-extract skill for Claude Code extracts plain text from binary document formats without writing files to disk. The agent invokes it when turning contracts or EHR attachments into text.
no license 110 installs ★ 456 updated 2026-08-27
npx skills add anthropics/healthcare --skill doc-extract -a claude-codeWhat doc-extract does
The script reads an input file and prints JSON to stdout without creating caches or temporary files. Setting it up requires running bun install in the skill directory to pull in liteparse and rtf-to-text. Without this setup, PDFs still work via a pdftotext fallback if poppler is installed, but other binary formats require liteparse.
Multi-column tables can interleave cells line by line during extraction, requiring verification against the original page when an answer comes from such a table. The script accepts a --content-type parameter for files lacking a useful extension like downloaded EHR attachments. Because liteparse refuses extensionless files, those PDFs go through the pdftotext fallback.
Errors print to stderr and exit with code 1. Other skills import the extraction functions directly in TypeScript, and the contracts MCP server bundles its own copy to remain self-contained.
What it helps with
- extract plain text from a PDF file
- convert a DOCX or XLSX document into JSON
- parse an RTF document into readable text
- process an extensionless file with a custom mime type
Example prompts for the agent
- Extract text from the file
contract.pdf - Turn the document
report.docxinto JSON output - Parse the attached file using
--content-type application/pdf
How to install doc-extract
1Skills CLI (Vercel)
npx skills add anthropics/healthcare --skill doc-extract -a claude-code2Manually: put the files in place
~/.claude/skills/doc-extract/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/doc-extract/
1Skills CLI (Vercel)
npx skills add anthropics/healthcare --skill doc-extract -a codex2Manually: put the files in place
.agents/skills/doc-extract/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add anthropics/healthcare --skill doc-extract -a cursor2Manually: put the files in place
.cursor/skills/doc-extract/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install anthropics/healthcare plugins/healthcare/skills/doc-extract2Manually: put the files in place
.github/skills/doc-extract/SKILL.md1Skills CLI (Vercel)
npx skills add anthropics/healthcare --skill doc-extract -a gemini-cli2Platform CLI
gemini skills install https://github.com/anthropics/healthcare --path plugins/healthcare/skills/doc-extractManually: put the files in place
.devin/skills/doc-extract/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add anthropics/healthcare --skill doc-extract -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about doc-extract
How to install doc-extract in Claude Code?
Run npx skills add anthropics/healthcare --skill doc-extract -a claude-code, then check ~/.claude/skills/doc-extract/SKILL.md.
What does doc-extract do?
It turns binary documents such as PDF, DOCX, XLSX, PPTX, RTF, and HTML into plain text with page anchors and outputs a JSON object to stdout.
What is needed to run doc-extract?
The script requires Bun and npm packages liteparse and rtf-to-text, which are installed by running bun install inside the skill directory.