From run-llama-llamaparse-agent-skills
Extract text and tables from PDF, DOCX, PPTX, XLSX, and images using the local `lit` CLI. Teaches cost-efficient patterns to avoid re-parsing and minimize context usage.
How this skill is triggered — by the user, by Claude, or both
Slash command
/run-llama-llamaparse-agent-skills:liteparseThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Extract text from documents locally with the `lit` CLI — a fast, model-free parser. This skill is
Extract text from documents locally with the lit CLI — a fast, model-free parser. This skill is
about using it cheaply: each lit parse re-runs full extraction, and every line you dump into
the conversation is paid for on every subsequent turn. The patterns below come from analyzing real
agent traces where the same PDF was parsed up to 9 times and single image reads cost
140k+ characters of context. Don't repeat those mistakes.
lit parse re-extracts the whole document every time you call it. Re-parsing per search is the #1
waste seen in traces. Parse a document exactly once, to a temp file, then run all your searches
against that file:
# ONE TIME, per document. --no-ocr for born-digital PDFs (almost all reports) — much faster.
lit parse "/abs/path/doc.pdf" --format text --no-ocr -o /tmp/doc.txt && wc -l /tmp/doc.txt
Then search the file with cheap shell tools — never re-run lit parse to search again.
Every Bash call is a full model round-trip (latency + re-read of context). The biggest waste after
parsing is a serial loop: grep → look → grep again → sed to read the window → grep again. In
traces this doubled the turn count versus just reading the doc. Two rules fix it:
1. Get context in the SAME command — don't grep then sed. Use grep -C so the surrounding
lines come back with the hit. This removes the follow-up sed turn for the common case:
grep -n -i -C4 "total assets" /tmp/doc.txt | head -40 # location AND its window, one turn
Only fall back to sed -n 'A,Bp' when you already know the exact line and need a wider window
than -C gave you.
2. Batch independent lookups into ONE command. When a question needs several distinct facts (e.g. emissions and revenue), don't spend one turn per term. Probe them together with labels:
for q in "carbon intensity" "scope 1" "total revenue"; do \
echo "=== $q ==="; grep -n -i -C3 "$q" /tmp/doc.txt | head -25; done
Then keep results small:
head and use -n for line numbers.search.py (below) — don't keep firing keyword variations one per turn.grep/sed on the saved file over the Read and Grep tools — fewer round-trips and
you control output size precisely.When two targeted greps haven't pinned the answer, stop greping — don't iterate keyword variants one turn at a time. Run the bundled BM25 ranker ONCE to surface the most relevant line-windows in a single command:
./.claude/skills/effective-liteparse/scripts/search.py /tmp/doc.txt -q "materiality assessment priority topics" -k 8 -e 5
-k = number of matches, -e = lines of context around each (so the window comes back inline — no
follow-up sed turn). It returns ranked windows with line numbers. Use a rich natural-language query
(several synonyms in one string), not a single keyword. This replaces a long chain of speculative greps.
--no-ocr. It's much faster and the text is identical. Leaving OCR on wastes time.--no-ocr. If the value is missing or digits look wrong, read the
page visually (see below) rather than trusting OCR.Screenshots are the most expensive thing you can put in context: a single high-DPI page PNG ran ~140k characters in one trace, and agents often rendered the same page twice (default + hi-res).
Only screenshot when text/tables genuinely can't answer the question (dense multi-column tables, figures, charts). Then:
--target-pages "N" (note: it's --target-pages, NOT --pages).lit screenshot "/abs/path/doc.pdf" --target-pages "13" --dpi 150 -o /tmp/shots/ # then Read the PNG
Parsing once to a file already covers this: keep the /tmp/doc.txt and reuse it across every
question instead of re-parsing.
Skip lit --version, ls -la, and lit … --help unless something actually failed. Go straight to
the parse. Core flags you need:
--format text|json · --no-ocr · --target-pages "1-5,10" · --dpi <n> (default 150) ·
--ocr-language <iso>. Use --format json only when you need bounding boxes/layout — it's much
larger; still search it, never load it whole.
PDFs work out of the box. If lit is missing: npm i -g @llamaindex/liteparse. Office docs need
LibreOffice; images need ImageMagick (both auto-converted to PDF).
npx claudepluginhub joshuarweaver/cascade-data-analytics --plugin run-llama-llamaparse-agent-skillsLocally parses PDFs, DOCX, Office files, and images into layout-preserved JSON with bounding boxes, OCR, and page screenshots for RAG and multimodal agents.
Parses complex documents with PaddleOCR to extract text, tables, formulas, charts, and layout structure. Use for invoices, academic papers, multi-column layouts, or any document needing structured understanding.
Multi-format document parsing tools for PDF, DOCX, HTML, and Markdown with support for LlamaParse, Unstructured.io, PyPDF2, PDFPlumber, and python-docx. Use when parsing documents, extracting text from PDFs, processing Word documents, converting HTML to text, extracting tables from documents, building RAG pipelines, chunking documents, or when user mentions document parsing, PDF extraction, DOCX processing, table extraction, OCR, LlamaParse, Unstructured.io, or document ingestion.