/pdf-split:pdf-splitfrom pdf-split
Splits PDF documents into individual chapter files using pypdf. Detects chapter boundaries from embedded bookmarks or text patterns like 'Chapter 1:' or 'Part One'.
Ships in pdf-split. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Split PDF documents into individual chapter files based on table of contents or text pattern detection.
This skill handles PDF splitting when:
Install pypdf via uv inline script dependency:
# /// script
# dependencies = ["pypdf"]
# ///
Run scripts/extract_toc.py to analyze the PDF:
uv run ${CLAUDE_PLUGIN_ROOT}/skills/pdf-split/scripts/extract_toc.py <pdf_path>
Output includes:
Based on Phase 1 output, define chapter boundaries as a list of tuples:
chapters = [
(start_page, end_page, "chapter_name"),
# ...
]
If bookmarks exist: Use bookmark page numbers directly.
If no bookmarks:
Run scripts/split_by_chapters.py with the chapter definitions:
uv run ${CLAUDE_PLUGIN_ROOT}/skills/pdf-split/scripts/split_by_chapters.py <pdf_path> <output_dir> --chapters '<json_chapters>'
Example:
uv run ${CLAUDE_PLUGIN_ROOT}/skills/pdf-split/scripts/split_by_chapters.py \
~/book.pdf \
~/book_chapters \
--chapters '[[1,22,"00_Intro"],[23,45,"01_Chapter1"]]'
| Pattern | Regex | Example |
|---|---|---|
| Numbered | Chapter\s+\d+ | "Chapter 1", "Chapter 12" |
| Part + Chapter | Part\s+\w+.*Chapter | "Part One: Chapter 1" |
| Section | Section\s+\d+ | "Section 1.1" |
| Roman numerals | Chapter\s+[IVXLC]+ | "Chapter IV" |
When a detected chapter exceeds 100 pages, verify the boundary:
When no bookmarks or clear patterns exist:
Filter results to keep only actual chapter starts:
output_dir/
├── 00_Front_Matter.pdf
├── 01_Chapter_Name.pdf
├── 02_Chapter_Name.pdf
├── ...
└── Appendix.pdf
Naming convention: {index:02d}_{sanitized_name}.pdf
Split PDFs are suitable for NotebookLM sources:
Chapter-level splitting provides natural semantic boundaries for:
| Script | Purpose |
|---|---|
scripts/extract_toc.py | Analyze PDF, extract bookmarks and detect chapter patterns |
scripts/split_by_chapters.py | Execute split with provided chapter definitions |
references/pypdf-guide.md - pypdf API quick reference for custom operationsWhat SKILL.md sets; muted values are Claude Code's defaults
sonnetThree short reads, in order
npx claudepluginhub jongwony/cc-plugin --plugin pdf-splitOther plugins' skills for the same job