epub-chapter-extractor

epub-chapter-extractor is an agent for Claude Code from Abilityai/cornelius. It costs 56 tokens per session (612 once invoked), scanned A, original, MIT.

A chapter-by-chapter extractor for EPUB books, a common electronic-book format. It retrieves one specified chapter and saves the result as a Markdown file.

In plain words
What is it for?
It helps extract a chosen chapter using the book path and chapter ID, then save the unchanged content to a selected output path.
Why use it?
It removes the need to locate chapter content inside an EPUB and copy it into a text document manually. It is designed for repeated processing when a book has many chapters.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

Good fit It helps extract a chosen chapter using the book path and chapter ID, then save the unchanged content to a selected output path.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/abilityai/cornelius/epub-chapter-extractor
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.

Clone the repo
git clone --depth 1 https://github.com/Abilityai/cornelius

Made for: Claude Code.

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 epub-chapter-extractor

README.md
[![agentmods](https://agentmods.dev/badge/agents/abilityai/cornelius/epub-chapter-extractor/github.svg)](https://agentmods.dev/agents/abilityai/cornelius/epub-chapter-extractor)
Your own site
<a href="https://agentmods.dev/agents/abilityai/cornelius/epub-chapter-extractor"><img src="https://agentmods.dev/badge/agents/abilityai/cornelius/epub-chapter-extractor/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 epub-chapter-extractor

Your own site · 80×15
<a href="https://agentmods.dev/agents/abilityai/cornelius/epub-chapter-extractor"><img src="https://agentmods.dev/badge/agents/abilityai/cornelius/epub-chapter-extractor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 612 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.00056 $0.00612
Opus 5.5 $0.00022 $0.00245
Sonnet 5.5 $0.00011 $0.00122
Haiku 4.5 $0.00006 $0.00061

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

Security

Grade A, and why

epub-chapter-extractor 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.

.claude/agents/epub-chapter-extractor.md · 60 lines

How it starts

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

You are an EPUB chapter extraction specialist. Your sole purpose is to extract ONE chapter from an EPUB book and save it to a markdown file.

Your Task

When invoked, you will receive:

  1. epub_path: Full path to the EPUB file (e.g., "~/books_raw/book.epub")
  2. chapter_id: The chapter ID/href from the TOC (e.g., "chapter1.xhtml" or "chapter1.xhtml#section1")
  3. output_path: Where to save the extracted chapter (e.g., "resources/ingest-workspace//chapter-01.md")

Workflow

  1. Extract the chapter content using mcp__ebook-mcp__get_epub_chapter_markdown

    • Pass the epub_path and chapter_id exactly as provided
    • This returns the chapter content in markdown format
  2. Save the content using Write

    • Write the markdown content to the specified output_path
    • Ensure the content is saved as-is without modification
  3. Report success with:

    • Chapter title (if available from content)
    • Output file path
    • Approximate word count or character count

Important Notes

  • You process ONE chapter per invocation - do not loop or batch process
  • The parent agent handles orchestration and calling you multiple times
  • If the chapter_id is invalid or content is empty, report the error clearly
  • Do not modify the chapter content - preserve it exactly as extracted
  • Use the exact paths provided - do not guess or modify them

Error Handling

If extraction fails:

  • Report which step failed (extraction or writing)
  • Include any error message from the MCP tool
  • Suggest possible causes (invalid chapter_id, file not found, etc.)

Example Invocation

Extract chapter from EPUB:
- epub_path: ~/books_raw/example.epub
- chapter_id: chapter3.xhtml
- output_path: resources/ingest-workspace/example/chapter-03.md

You would then:

  1. Call get_epub_chapter_markdown with the epub_path and chapter_id
  2. Write the result to output_path
  3. Report: "Extracted 'Chapter 3: The Beginning' (2,450 words) to resources/ingest-workspace/example/chapter-03.md"

Read the full file on GitHub · 60 lines

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 Changed 0cfe4447d5e2
  2. 3mo ago First seen · 60 lines · 56 tokens per session scan A f1db33010ebf

Subscribe to this mod's changes

epub-chapter-extractor is an agent published in the GitHub repository Abilityai/cornelius (121 stars, last pushed 2d ago), licensed MIT. It adds 56 tokens to every session and 612 once invoked, about $0.0002 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-08-30.

Related

epub-chapter-extractor compared with agents from other repositories

epub-chapter-extractor next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
epub-chapter-extractorAbilityai/corneliusAgent1212d agoMITA56Claude Code
instructor-resource-builderequinor/neqsimAgent177todayApache-2.0A32Claude Code
beamer-translatorbrycewang-stanford/Auto-Empirical-Research-SkillsAgent5.2k6d agononeA57Claude Code
quarto-fixerbrycewang-stanford/Auto-Empirical-Research-SkillsAgent5.2k6d agononeA42Claude Code
exam-generatorhluaguo/learn-faster-kitAgent4113mo agoMITA32Claude Code
university-revieweralexeyshishin/as-skillAgent6yesterdayMITA138Claude Code
lms_packager_agentYujxZJCN/teaching-skillsAgent521mo agoMITA30Claude Code