Recover iPhone Photos with Claude Code¶
| Category | Creative & Real-World AI Builds |
| Status | ๐ก Partially completed |
| Repo | nextwork-recover-iphone-photos-with-claude-code |
| Original NextWork guide | nextwork.ai |
Learning project
Practice work following a NextWork guide, separate from my production projects.
๐ NextWork learning project. This is a practice project I built while working through NextWork's Recover iPhone Photos with Claude Code guide. It is part of my Learning portfolio and is fully separate from my production projects.
Category: Learning โบ Creative & Real-World AI Builds
Status: ๐ก Partial
Overview¶
A local iPhone backup hides photos behind hashed file names. Manifest.db is the index that maps each hash back to a path like Media/DCIM/100APPLE/IMG_0001.JPG. This tool reads a copy of that index, never writes to the backup, and turns the camera roll back into dated folders you can browse.
Summary¶
The full recovery tool is built and tested: it previews camera-roll paths from a copy of Manifest.db, recovers media into year folders with date-based names, writes a CSV audit of every outcome, and builds a local gallery plus a one-year gallery from the audit without copying media again (secret mission). It ran against a synthetic backup with the real on-disk layout, not a real iPhone backup.
The checks behind this are in docs/verification.txt.
Skills & tools¶
Python, SQLite, iOS backup format, EXIF, Read-only forensics, Static HTML gallery
What I built¶
make_sample_backup.py: builds a synthetic backup with the real layout:Manifest.db,<first-2-hex>/<sha1>files, plists, generated JPEGs with EXIF dates, a PNG, MOV/MP4/HEIC stubs, one missing file, and non-camera rows that must be ignored.recover.py preview: copies Manifest.db to a temp folder and lists camera-roll media, marking missing files.recover.py recover: copies media torecovery-output/<year>/<YYYY-MM-DD_HHMMSS>_<name>, using EXIF date, then the Manifest date, then the file time. It writesaudit.csv(recovered/missing, date source, SHA-256), buildsgallery.html, and proves the backup is hash-identical afterwards.recover.py gallery --year 2021: the secret-mission one-year gallery, built from audit.csv with no media copied.test_recover.py: end-to-end tests, including refusing an encrypted backup.
How to run¶
pip install pillow
python make_sample_backup.py sample-backup/DEMO # or point at your own backup folder
python recover.py preview sample-backup/DEMO
python recover.py recover sample-backup/DEMO --out recovery-output
python recover.py gallery --year 2021 --out recovery-output
python -m http.server 8000 --bind 127.0.0.1 --directory recovery-output
~/Library/Application Support/MobileSync/Backup/.
Verification¶
I ran the verification command on 2026-12-02. The full output is in docs/verification.txt.
rm -rf demo && /workspace/nextwork-portfolio/.venv/bin/python make_sample_backup.py demo/backup && /workspace/nextwork-portfolio/.venv/bin/python recover.py preview demo/backup && /workspace/nextwork-portfolio/.venv/bin/python recover.py recover demo/backup --out demo/recovery-output && /workspace/nextwork-portfolio/.venv/bin/python recover.py gallery --year 2021 --out demo/recovery-output && /workspace/nextwork-portfolio/.venv/bin/python -m pytest -q -p no:cacheprovider test_recover.py && rm -rf demo
Notes¶
Browsers can't show HEIC or most MOV files, so the gallery shows a labelled placeholder for those and the audit notes it. The guide pins ExifTool and the ios-backup-browser package; I read EXIF with Pillow and the index with Python's sqlite3 instead.
What isn't done, and why¶
Two things are missing. First, real hardware and data: I have no iPhone or real backup on my build machine, and a real backup is personal data I keep out of a public repo, so everything ran against a synthetic backup with the same structure. Second, the guide has Claude Code generate recover.py in a live session, and here I wrote it myself. To finish, run recover.py on your own unencrypted backup.
Original project: https://nextwork.ai/projects/970ea045-830e-4311-8f7b-af23ff830fd9 ยท Part of my NextWork Learning portfolio (hub).
Verification output¶
From docs/verification.txt:
$ rm -rf demo && /workspace/nextwork-portfolio/.venv/bin/python make_sample_backup.py demo/backup && /workspace/nextwork-portfolio/.venv/bin/python recover.py preview demo/backup && /workspace/nextwork-portfolio/.venv/bin/python recover.py recover demo/backup --out demo/recovery-output && /workspace/nextwork-portfolio/.venv/bin/python recover.py gallery --year 2021 --out demo/recovery-output && /workspace/nextwork-portfolio/.venv/bin/python -m pytest -q -p no:cacheprovider test_recover.py && rm -rf demo
synthetic backup at demo/backup: 8 camera-roll rows (1 missing file), 2 non-camera rows, 1 directory row
present Media/DCIM/100APPLE/IMG_0001.JPG
present Media/DCIM/100APPLE/IMG_0002.JPG
present Media/DCIM/100APPLE/IMG_0003.JPG
present Media/DCIM/101APPLE/IMG_0104.PNG
present Media/DCIM/101APPLE/IMG_0105.MOV
present Media/DCIM/101APPLE/IMG_0106.HEIC
MISSING Media/DCIM/101APPLE/IMG_0107.JPG
present Media/DCIM/102APPLE/IMG_0201.MP4
8 camera-roll media rows (index read from a temporary copy of Manifest.db)
examined 8: recovered 7, missing 1; audit.csv + demo/recovery-output/gallery.html; original backup unchanged (11 files hash-identical)
serve locally: python -m http.server 8000 --bind 127.0.0.1 --directory demo/recovery-output
wrote demo/recovery-output/gallery-2021.html (2 items, no media copied)
.. [100%]
2 passed in 1.01s
[exit code 0]