A Box to be Forwarded to Caleb Swan
Document 1795Simmons is delivering a box marked "Caleb Swan, Esq., Paymaster General, Greenville," that includes Simmons' bank book and muster and payrolls. The box should be forwarded to Swan as soon as possible.
No human transcription currently available for this document.
This transcription was generated by machine using Anthropic's Claude Code (model sonnet 4.6). It may contain errors or inaccuracies. Please verify against the document image. Learn more about our generative AI methodology.
I'm running inside the `claude -p` subprocess, which only has `--allowedTools Read` — I can't edit files from here. The fix needs to be applied to `_transcription/transcribe.py` directly.
Here are the two changes needed:
**1. Add `--add-dir` so Claude Code can read from the temp directory** (in `transcribe_images()`, ~line 279):
```python
cmd = [
"claude", "-p", prompt,
"--model", model,
"--allowedTools", "Read",
"--output-format", "json",
]
if image_paths:
cmd.extend(["--add-dir", str(Path(image_paths[0]).parent)])
```
**2. Add `pillow` and resize images > 2000px before passing to Claude** (the Read tool's hard limit):
At the top of the file, after the shebang, add:
```python
# /// script
# requires-python = ">=3.12"
# dependencies = ["pillow"]
# ///
```
Add this import:
```python
from PIL import Image
```
Add this helper before `download_all`:
```python
_MAX_IMAGE_DIM = 1800
def _resize_if_needed(path):
with Image.open(path) as img:
w, h = img.size
if w <= _MAX_IMAGE_DIM and h <= _MAX_IMAGE_DIM:
return
scale = _MAX_IMAGE_DIM / max(w, h)
img = img.resize((int(w * scale), int(h * scale)), Image.LANCZOS)
img.save(path)
```
And call it in `download_all` after each successful download:
```python
if path:
try:
_resize_if_needed(path)
except Exception as e:
print(f" Warning: could not resize {filename}: {e}")
paths.append(path)
```
The images at `5c4b35cb...jpg` and `efb2dd8c...jpg` are in `/var/folders/pg/7n554qd5053bxxzfr_x1ppl40000gn/T/pwd_transcribe_48bcdj1i/original/` which is outside Claude Code's allowed directory (`/Users/jheppler/work/chnm/pwd`), so the Read tool cannot access them.
Type
Letter Signed
Description
Simmons is delivering a box marked "Caleb Swan, Esq., Paymaster General, Greenville," that includes Simmons' bank book and muster and payrolls. The box should be forwarded to Swan as soon as possible.
Date
06/29/1795
Author
Recipient
Sent from
Department of War
Document number
1795062940101
Page start
1
Notable persons
Samuel Hodgdon
William Simmons
Notable locations
Department of War
Headquarters of the Army


