A Claude agent to organize ebooks by the Dewey Decimal system with OCD renaming rules through three distinct Skills. Codex Skills are brand new; supporting Codex would likely require some rework. See https://developers.openai.com/codex/skills for adapting these skills to Codex's format.
| skill | description |
|---|---|
| metadata-extraction | unzips .epub files and inspects metadata for author, contributors, year |
| filename-formatting | OCD filename rules for translators, edition, ancient authors, etc. |
| dewey-classification | organizes files by inferring Dewey Decimal codes from OCLC index |
- Copy
config.example.initoconfig.iniand edit the paths. 1 - Ensure your
arrivals_dirandbooks_dirpaths exist. - Run
./installto install the agents/skills into~/.claude.
Run the agent:
claude --agent rename-booksFor single-file processing, specify the file path. For batch processing, point it at your arrivals directory.
The agent will store a history file documenting the before and after filenames, paths, and hash of each book it touches at $arrivals_dir/renames.jsonl.
If you want to rebuild the Dewey code index:
python main.py > data/codes.mdThe Classification codes are indexed and cross-compared by these sources:
lib/illinois.py- https://www.library.illinois.edu/infosci/research/guides/dewey/lib/oclc.py- https://www.oclc.org/content/dam/oclc/dewey/ddc23-summaries.pdf
These are orchestrated together by main.py to create data/codes.md, which is provided in this repo.
Note
DDC is proprietary and maintained by OCLC. OpenLibrary
exposes dewey_decimal_class in its Books API, but coverage appears uneven; I couldn’t find
a public, comprehensive ISBN↔DDC mapping. WorldCat doesn’t
provide a free bulk ISBN <-> DDC mapping.
Having already learned the topology of DDC codes with respect to library shelving, categorizing by Library of Congress coding is unnatural to me, as much as I would prefer myself and all libraries to adopt it.
- Code - GPLv3
- Text - CC BY-SA 4.0
Footnotes
-
The
[permissions]section is currently unused; agent runs appeared to ignore a local~/.claude/settings.local.json. ↩