pdf-text-extraction

pdf-text-extraction is a skill for Claude Code, Codex from cxcscmu/SkillLearnBench. It costs 15 tokens per session (361 once invoked), scanned A, original, MIT.

A guide to extracting text from PDF files for later analysis. It shows a main method using pdfplumber and an alternative using PyPDF2, including basic error handling.

In plain words
What is it for?
Use it to retrieve text from PDFs, inspect representative pages, and prepare document content for analysis or subject classification.
Why use it?
It removes the need to read PDF content manually before analyzing or classifying it. Reading only the first few pages can provide a quick sample.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/cxcscmu/skilllearnbench/pdf-text-extraction
Any agent
npx skills add cxcscmu/SkillLearnBench --skill pdf-text-extraction
Clone the repo
git clone --depth 1 https://github.com/cxcscmu/SkillLearnBench

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 pdf-text-extraction

README.md
[![agentmods](https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/pdf-text-extraction.svg)](https://agentmods.dev/skills/cxcscmu/skilllearnbench/pdf-text-extraction)
Your own site
<a href="https://agentmods.dev/skills/cxcscmu/skilllearnbench/pdf-text-extraction"><img src="https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/pdf-text-extraction.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 361 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00015 $0.00361
Opus 5 $0.00008 $0.00180
Sonnet 5 $0.00003 $0.00072
Haiku 4.5 $0.00002 $0.00036

Measured 4d ago against content hash 85e63d606a0e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pdf-text-extraction 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 4d 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.

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.

skills/b1-one-shot-claude-haiku-4-5/organize-messy-files/pdf-text-extraction/SKILL.md · 58 lines

What it actually says

PDF Text Extraction

Overview

Extract text content from PDF files to analyze their content and classify them by subject.

Installation

pip install pdfplumber PyPDF2

Usage Examples

Using pdfplumber (Recommended)

import pdfplumber

def extract_pdf_text(pdf_path, max_chars=5000):
    """Extract text from PDF with character limit for efficiency"""
    try:
        with pdfplumber.open(pdf_path) as pdf:
            text = ""
            # Read first few pages to get representative content
            for page_num in range(min(3, len(pdf.pages))):
                text += pdf.pages[page_num].extract_text() or ""
                if len(text) > max_chars:
                    break
            return text[:max_chars]
    except Exception as e:
        return f"Error reading PDF: {str(e)}"

Using PyPDF2 (Fallback)

from PyPDF2 import PdfReader

def extract_pdf_text_pypdf(pdf_path):
    """Alternative PDF text extraction"""
    try:
        reader = PdfReader(pdf_path)
        text = ""
        for page in reader.pages[:3]:  # First 3 pages
            text += page.extract_text()
        return text
    except Exception as e:
        return f"Error: {str(e)}"

Best Practices

  • Extract from first 2-3 pages only (faster, usually contains abstracts/titles)
  • Handle errors gracefully for corrupted PDFs
  • Cache extracted text to avoid re-processing
  • Use reasonable character limits (3000-5000 chars) for classification
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. 4d ago First seen · 58 lines · 15 tokens per session scan A 85e63d606a0e

Subscribe to this mod's changes

pdf-text-extraction is a skill published in the GitHub repository cxcscmu/SkillLearnBench (82 stars, last pushed 1mo ago), licensed MIT. It adds 15 tokens to every session and 361 once invoked, about $0.0001 per session on Opus 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-08-30.

Related

Other skills, from other repositories

pdf

PDF manipulation toolkit. Extract text/tables, create PDFs, merge/split, fill forms, for programmatic document processing and analysis.

benchflow-ai/skillsbench · 29 tokens

filler-word-processing

Process filler word annotations to generate video edit lists. Use when working with timestamp annotations for removing speech disfluencies (um, uh, like, you know) from audio/video content.

benchflow-ai/skillsbench · 42 tokens

whisper-transcription

Transcribe audio/video to text with word-level timestamps using OpenAI Whisper. Use when you need speech-to-text with accurate timing information for each word.

benchflow-ai/skillsbench · 35 tokens

ffmpeg-video-editing

Video editing with ffmpeg including cutting, trimming, concatenating segments, and re-encoding. Use when working with video files (.mp4, .mkv, .avi) for: removing segments, joining clips, extracting portions, or any video manipulation task.

benchflow-ai/skillsbench · 59 tokens

agentsop-llamaindex

Operating-system distillation of LlamaIndex — the leading RAG / document-agent framework. Activate when the calling agent must build, debug, harden, or evaluate a Retrieval-Augmented Generation pipeline over unstructured/private data, decide between RAG primitives (Index types, retrievers, query engines, routers…

agentsope/SkillAlchemy · 178 tokens

csv-processing

Use this skill when reading sensor data from CSV files, writing simulation results to CSV, processing time-series data with pandas, or handling missing values in datasets.

benchflow-ai/skillsbench · 34 tokens