← all repositories
deusyu/translate-book

Translate Books Without Melting Your Context Window

An agent skill that splits books into hashed chunks and farms them out to parallel subagents, avoiding the context accumulation and output truncation that comes from translating a full book in one sitting.

1.8k stars Python AgentsCoding Assistants
translate-book
Velocity · 7d
+0.0
★ / day
Trend
cooling
star history

What it does

translate-book is an agent skill for Codex, Claude Code, and OpenClaw that ingests PDF, DOCX, or EPUB files, converts them to Markdown via Calibre and Pandoc, splits them into chunks, and delegates each chunk to an independent subagent for translation. After parallel translation—eight concurrent workers by default—it validates outputs against a SHA-256 manifest, merges the results, and rebuilds the book as HTML, DOCX, EPUB, or PDF. The whole pipeline is resumable and selective: if a run crashes or you tweak the glossary, only the affected chunks get re-translated.

The interesting bit

The project treats terminology drift as a first-class problem. It samples a handful of chunks to build a glossary.json of proper nouns and domain terms, then injects a per-chunk translation table into each subagent’s prompt as a hard constraint. Each worker also gets read-only excerpts from neighboring chunks to keep pronouns and entities coherent across boundaries, without sharing the full context that causes truncation.

Key highlights

  • Parallel subagents with isolated context windows (8 concurrent by default) prevent the accumulation that chokes single-session book translation.
  • A manifest system tracks SHA-256 hashes for every chunk, blocking stale or corrupt outputs from sneaking into the final merge.
  • Glossary-aware selective re-translation means editing a term mid-project only rewrites the chunks that actually use it.
  • Handles PDF, DOCX, and EPUB on the way in, and produces HTML with floating TOC, DOCX, EPUB, and PDF on the way out.
  • The maintainer explicitly prefers detailed issues over pull requests, since changes must be evaluated against orchestration rules and baseline assets in a single context.

Caveats

  • The pipeline orchestrates Calibre, Pandoc, and your agent runtime; if those tools aren’t already in your environment, the setup is non-trivial.
  • Pull requests are discouraged by design and may be closed in favor of issues, so expect a maintainer-driven workflow if you want to change anything.

Verdict

Worth a look if you regularly need to translate long-form documents and already live inside Codex, Claude Code, or OpenClaw. If you just need to translate a single short file once, the dependency overhead is likely overkill.

Frequently asked

What is deusyu/translate-book?
An agent skill that splits books into hashed chunks and farms them out to parallel subagents, avoiding the context accumulation and output truncation that comes from translating a full book in one sitting.
Is translate-book open source?
Yes — deusyu/translate-book is open source, released under the MIT license.
What language is translate-book written in?
deusyu/translate-book is primarily written in Python.
How popular is translate-book?
deusyu/translate-book has 1.8k stars on GitHub and is currently cooling off.
Where can I find translate-book?
deusyu/translate-book is on GitHub at https://github.com/deusyu/translate-book.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.