translate-book: one subagent per chunk, a manifest of SHA-256 hashes, and Calibre doing the conversion
Agent skill for Codex, Claude Code, and OpenClaw that translates entire books (PDF/DOCX/EPUB) into any language using parallel subagents.
At a glance
- What is it?
- translate-book is an agent skill for Codex, Claude Code and OpenClaw that converts a PDF, DOCX or EPUB to Markdown, splits it into chunks, translates each chunk in its own subagent, validates the results against a manifest, and rebuilds HTML, DOCX, EPUB and PDF.
- Who is it for?
- Use translate-book if you already work in Codex, Claude Code or OpenClaw, can install Calibre and Pandoc, and want a resumable book translation where a stale chunk cannot slip into the merge. Skip it if you want a hosted service or a plain command line tool, because the translation itself runs through your agent runtime and its API limits.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- deusyu/translate-book2,473 ★ · +358
| Repository | 2026-10-13 | 2026-11-25 |
|---|---|---|
| deusyu/translate-book | 2.1k | 2.5k |
358 Stars in the last 43 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Each chunk gets a fresh subagent so a whole book never sits in one context window
The core design choice is stated in one sentence in the README: each chunk gets its own independent subagent with a fresh context window. That avoids the context accumulation and output truncation that happen when you translate a full book in a single session.
The pipeline has a fixed order. Input is converted to Markdown, split into files named chunk0001.md, chunk0002.md and so on, and sent to subagents. By default 8 run concurrently, and the work is batched to respect API rate limits. Each subagent reads one chunk, translates it, and writes an output_chunk*.md file.
After translation the pipeline validates, merges, and builds. The validation step checks the manifest hashes and requires a 1:1 match between source and output chunks. Only then does the merge run through Pandoc to HTML with a table of contents, and Calibre turns that into DOCX, EPUB or PDF.
The repository's top level shows the shape of the thing: SKILL.md is the skill definition, scripts/ holds the Python, and AGENTS.md and CLAUDE.md carry instructions for the agents themselves. The project is a skill that drives scripts, not a standalone program.
manifest.json and SHA-256 hashes stop stale chunks from being merged
A manifest named manifest.json tracks the hash of every chunk. The README describes SHA-256 hash tracking that prevents stale or corrupt outputs from being merged. If you edit a source chunk after its translation was written, the hash no longer matches, and the validation step rejects the mismatch before merge.
This matters for a book with hundreds of chunks. A parallel run can fail halfway, leave a truncated output file, or complete against an older source. Without a check, those files would merge silently into the final DOCX.
Resuming works at the same level. The README promises chunk-level resume, with run_state.json tracking glossary-sensitive re-translation. If you change a glossary term, only the chunks affected need to be redone. The README does not describe the glossary file format, so look at SKILL.md and scripts/ before relying on that feature.
One more detail helps quality. Each chunk can see short read-only excerpts from adjacent chunks, for pronoun and entity resolution, so a sentence that begins a chunk can still resolve who he or she refers to.
Calibre's ebook-convert and Pandoc are hard prerequisites, and PDF extraction is the weak step
Before the skill can run, three things must be installed. An agent runtime (Codex, Claude Code or OpenClaw), Calibre with the ebook-convert command available, and Pandoc for HTML and Markdown conversion. Python 3 is also needed, with pypandoc required and beautifulsoup4 optional for better table of contents generation.
The conversion path for ordinary input is Calibre ebook-convert, then HTMLZ, HTML and Markdown. That works for EPUB and DOCX. PDF is harder, and the README admits it: formula heavy and table heavy PDFs can be pre-extracted to Markdown with MinerU or Marker, and Markdown input skips Calibre entirely. MinerU and Marker are optional and are named only for this case.
The consequence is concrete. A scientific PDF with equations may come out of Calibre badly structured, and every chunk you translate afterwards inherits that structure. The README does not show a quality comparison between routes, so run the conversion step first, open the Markdown, and decide whether to extract with MinerU or Marker before you spend tokens on translation.
Install paths differ per runtime, and Codex needs a restart if the skill does not show
Each runtime has its own install command. For Codex:
npx skills add deusyu/translate-book -a codex -gThe manual route creates a skills directory and clones the repository into it:
mkdir -p ~/.agents/skills
git clone https://github.com/deusyu/translate-book.git ~/.agents/skills/translate-bookThe README adds that you should restart Codex if the newly installed skill does not appear. Claude Code uses npx skills add deusyu/translate-book -a claude-code -g, or a clone into ~/.claude/skills/translate-book. OpenClaw uses openclaw skills install @deusyu/translate-book.
Invocation also differs. In Codex you enter $translate-book followed by the request, for example Translate /path/to/book.pdf into Chinese. In Claude Code and OpenClaw you ask in plain language, and Claude Code also accepts a slash command, /translate-book translate /path/to/book.pdf to Japanese. Codex can select the skill on its own when your request matches its description.
Everything lands in {book_name}_temp, relative to wherever you ran it
Outputs are written under a directory named {book_name}_temp. The files are output.md for the merged translated Markdown, book.html for the web version with a floating table of contents, book.docx, book.epub, and book.pdf described as print ready.
The repository section on test assets points out a side effect. scripts/convert.py writes {book_name}_temp/ under the current working directory, so the location depends on where you started. For repository tests, the README says to run from inside tests/.artifacts/ so generated files stay out of the repo root, and that directory should not be committed.
The baseline example shows the commands:
mkdir -p tests/.artifacts
cd tests/.artifacts
python3 ../../scripts/convert.py ../baselines/standard-alice/standard-alice.epub --olang zh
# then run translation via the skill
python3 ../../scripts/merge_and_build.py --temp-dir standard-alice_temp --title "test"Note the middle comment. Translation is not a script you run. It is the step where you ask the skill to translate. The README also lists optional output controls, an explicit EPUB cover, a custom temp root, and user facing export aliases, without giving flag names on the front page.
Target languages are a fixed seven, and cost is whatever your agent runtime bills
The README lists seven languages: zh, en, ja, ko, fr, de and es, and says the list is extensible. The baseline example passes --olang zh, so the output language is an option on the conversion script.
The repository has no price, and the README gives no estimate of tokens or time for a book. Because each chunk runs in a subagent through Codex, Claude Code or OpenClaw, the work counts against whatever plan or API key that runtime uses. Eight concurrent subagents per batch multiplies usage quickly on a long book. The repository is MIT licensed, so the skill is free to use, but the translation is not free unless your runtime is.
This answers a common question about free apps for translating books. The skill itself costs nothing. The model calls behind it are billed by your agent runtime, and Calibre and Pandoc are downloaded separately.
There is also no web interface. It does not translate books online, and it runs on your machine through your agent.
An independent rewrite of claude_translater, maintained through issues, not pull requests
The README credits claude_translater by wizlijun as inspiration. The original used shell scripts as its entry point, coordinating the Claude CLI with multiple step scripts for chunked translation. This project restructures that as an agent skill with parallel subagents, manifest driven integrity checks, resumable runs and unified multi format output. The author says the structure and implementation differ significantly, so it is an independent project and not a fork.
Contributions are narrow. The README asks for a detailed GitHub issue before any pull request, because the project is maintained as an AI assisted skill pipeline whose orchestration rules, chunk and manifest contracts, baseline assets and release flow are evaluated in one maintainer owned context. Pull requests may be closed in favour of an issue. A useful issue states current and expected behaviour, input format and environment including Calibre and Pandoc versions, reproduction steps, and logs.
The repository is not archived. The last push was on 2026-10-12, and there are no GitHub releases, so you track the main branch and not tagged versions. A README.zh-CN.md exists for Chinese readers.
Editorial conclusion
Use translate-book if you already work in Codex, Claude Code or OpenClaw, can install Calibre and Pandoc, and want a resumable book translation where a stale chunk cannot slip into the merge. Skip it if you want a hosted service or a plain command line tool, because the translation itself runs through your agent runtime and its API limits. Before starting a long book, run the baseline example on the bundled public-domain EPUB to confirm Calibre and Pandoc work on your machine.
Frequently asked questions
Is there a way to translate a book with translate-book?
Yes, as an agent skill for Codex, Claude Code and OpenClaw. It converts a PDF, DOCX or EPUB, translates chunks in parallel subagents, and rebuilds HTML, DOCX, EPUB and PDF.
Can translate-book translate a book online?
The README describes a local pipeline run through your agent runtime, with Calibre and Pandoc installed on your machine. It describes no hosted web interface.
Is translate-book a free app for translating books?
The skill is MIT licensed. The README lists Calibre, Pandoc and an agent runtime as prerequisites and gives no pricing, so model usage is billed by whichever runtime you use.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/deusyu-translate-book)Star history chart for your README
[](https://hysenlabs.com/projects/deusyu-translate-book)Was this useful?