Sort photos into folders by the date they were taken
33 mixed photos filed into year and month folders by when they were taken, none lost.
A real run on 12 November 2026, on a Linux computer, using Claude Code with Opus, on a Claude plan. The waiting is sped up; it took 47 s in real time.
The short answer.
Use the date taken stored inside each photo (EXIF), not the file's modified date, which changes whenever photos are copied. ExifTool does it with one command, and digiKam or Lightroom can file photos into date folders as they import. Stella (stella.sh) reads each photo's date, files it under year and month, keeps clashing names apart and leaves a log so every move can be undone.
Stella does this on Windows, Mac and Linux.
What happened.
33 files were sorted into year and month folders from 2019 to 2026 in 47 seconds. Checked afterwards against the answer key written before the run: all 33 are there exactly once and byte-for-byte identical, all 26 photos with a date taken are in the right month (including four with misleading names, a leap day and a month boundary), both IMG_0001.JPG files survived, and the two with no date at all went to an Undated folder.
The 33 test files are generated pictures with dates written into them for this run, all with a file date of the day they were copied, plus one short video. The wait is sped up 8×. There was no ExifTool on the test computer, so Stella wrote its own small date reader.
How Stella does it.
- Reads the date taken stored inside every photo, the creation date inside videos, and ignores the misleading file dates and names
- Plans every move first, then files them into folders like 2024/03 - March
- Dates WhatsApp images and screenshots from the date in their names, which is where those apps keep it, and says so
- Puts photos with no date anywhere into an Undated folder instead of guessing
- Never overwrites: a second IMG_0001.JPG from the same month becomes IMG_0001 (1).JPG, and a log lists where every file came from
The prompt.
Sort my photos into folders by year and month using the date they were taken. They're in Pictures/To sort.
This is the exact prompt from the recording. If your files are somewhere else, say where.
Do it yourself.
Work on a copy first
Copy the folder somewhere else before you start, or make sure it's in your backup. Moving thousands of files by a rule is quick to do and slow to undo by hand.
With ExifTool (free, Windows, Mac and Linux)
Install ExifTool, open a terminal in the folder and run
exiftool -r -d "%Y/%m" "-Directory<CreateDate" "-Directory<DateTimeOriginal" .It moves each photo into a year/month folder from its date taken, falls back to the creation date for videos, and leaves files with no date where they are. Add-o .to copy them into the new folders instead of moving them.With digiKam or Lightroom
digiKam (free) can create date-based albums as it imports from a folder or camera. In Lightroom Classic's Import window, set the Destination panel's Organize option to By Date and pick a year-and-month date format. Both use the date taken, not the file date.
Deal with the leftovers
Screenshots and WhatsApp images usually carry no date taken, but their names do (
IMG-20240312-WA0007.jpg,Screenshot_20250611-142233.png); file those by hand or with a rename tool. Put anything with no date at all in an Undated folder rather than trusting the file date.Check nothing went missing
Compare the file count before and after (right-click > Properties on Windows, Get Info on a Mac), and look out for names that clashed. ExifTool never overwrites a file with the same name; it leaves that photo where it was, so check the old folders for any left behind.
Where it stops.
- Files are moved, not copied, because that's what the prompt asks. The log makes every move reversible, but there's no second copy; ask for a copy instead if you want one.
- WhatsApp and screenshot dates come from their file names, which is usually right but not guaranteed. Photos with no date anywhere stay unsorted in Undated.
- 33 files took under a minute. Tens of thousands will take longer, mainly to read each file's date, and photos in a cloud folder that aren't downloaded yet (OneDrive, iCloud) have to download first.
- It also deleted the subfolders that were left empty, and said so. Say “keep the old folders” if you'd rather it didn't.
Questions.
Why are my photos sorted by the wrong date?
Most tools sort by the file's modified or created date, which changes every time photos are copied, downloaded or restored from a backup. The date the photo was taken is stored inside the file (EXIF DateTimeOriginal), and that's the one to sort by.
Can Windows sort photos into folders by date taken?
File Explorer can group and sort a view by Date taken, but it can't move files into folders by it. For that you need a tool like ExifTool, digiKam or Lightroom, or Stella.
What happens to videos?
Videos keep their date in a different place (the QuickTime creation date). Stella read it and filed the test video under July 2024; the ExifTool command above covers it with the CreateDate fallback.
Can it also find duplicates or fix wrong dates?
Yes, as separate asks: find duplicate photos, or fix Google Takeout photo dates if the dates themselves are wrong.
Is Stella free for this?
Yes. Free with the ChatGPT or Claude plan you already have. Sign in with your ChatGPT plan, or use your Claude plan through Claude Code, and this task costs nothing extra. New accounts also get a small free trial of Stella’s own models.
Can I control what Stella changes on my computer?
Yes. Stella works on Windows, Mac and Linux with your own files and shows each step in the chat, so you can watch it and stop it at any point. Tell it what it may not do, as the prompts on these pages do (“don't delete anything without asking”). In the Downloads recording it deleted nothing until it was told to go ahead. It also refuses commands that would wipe a whole disk, your home folder or system folders.
Checked against these sources on 12 November 2026.