CLI tool that ingests unorganized PDF documents from an inbox folder, classifies each one using Claude AI, generates a human-readable filename, extracts a plain-text transcript, and files everything into a structured library.
- Classifies and renames PDFs using Claude Sonnet
- Extracts full-text transcript as a
.mdfile alongside each PDF - Organizes library by category and year
- Maintains a machine-readable
index.jsonof all processed documents - Detects drift between index and filesystem
- Archives originals before any operation
- Python 3.12+
- Anthropic API key
pip install -e ".[dev]"Copy .env.example to .env and set your API key:
cp .env.example .env
# edit .env and set ANTHROPIC_API_KEYProcess inbox:
paperclaw processCheck for drift between index and filesystem:
paperclaw checkReview last N classifications:
paperclaw review --last 10~/inbox/ ← drop PDFs here
~/archive/ ← immutable originals
~/library/
index.json
invoices/2024/
bills/2025/
contracts/
bank-statements/
tax/
other/
Files are named {YYYY-MM-DD}_{vendor}_{short-description}.pdf with a matching .md transcript.
| Category | Examples |
|---|---|
invoices |
Online orders, shop receipts |
bills |
Electricity, gas, internet |
contracts |
Rental agreements, insurance |
bank-statements |
Monthly bank statements |
tax |
Finanzamt letters, Steuerbescheid |
other |
Low-confidence or unrecognized documents |
Documents with classifier confidence < 0.8 are filed under other and flagged for manual review.
# Run all checks
pre-commit run --all-files
# Run tests
pytest
# Type check
mypy --strict paperclaw/All tool configuration lives in pyproject.toml.
- Only first-page text is sent to the Claude API (account numbers and transactions on later pages are never transmitted)
ANTHROPIC_API_KEYis read from.env, which is gitignored- Originals are archived before any move or rename — zero data loss guarantee
index.jsonis updated atomically to prevent corruption