# Compare two folders and copy what's missing

> Markdown version of https://stella.sh/how/files-folders/compare-two-folders for agents and LLMs.
> Compare an old and a new copy of a folder and copy across only what's missing, without overwriting anything: robocopy, rsync, or Stella (stella.sh) by file content.

Free tools compare folders by file name: robocopy on Windows or rsync on a Mac copies files that aren't there yet without overwriting, and WinMerge shows the differences side by side. Names mislead, though: a photo renamed in one copy gets copied again, and two different photos with the same name get skipped. Stella (stella.sh) compares by what's inside the files, copies only what's truly missing into the matching subfolders, keeps both photos when names clash, and never overwrites.

- Checked: 14 November 2026
- Stella does it on: Windows, Mac, Linux

## Stella doing it

Recorded 14 November 2026 on Linux (Omarchy) with Claude Code with Opus, on a Claude plan.
Result: About a minute. Checked afterwards against an answer key written before the run: all 11 files only in the old copy now in the Pictures folder, in their matching subfolders, both same-name-but-different photos kept, every photo already there unchanged, renamed photos not copied again, no Thumbs.db copied, and the old copy untouched. The photos are made up for this run, in two folders laid out like an old and a new copy. The work is sped up 4×.

Video (44 s): https://stella.sh/media/proofs/files-folders/compare-two-folders/proof.mp4

Transcript:

- 0:00 Stella on a Linux computer. Family photos in Pictures, and an older copy from an old laptop in Documents.
- 0:02 The prompt: copy anything only in the old copy into Pictures, and don't overwrite anything.
- 0:14 Stella replies: it will compare by what's in the files, so renamed photos don't count as new.
- 0:19 Comparing the two folders, sped up 4×.
- 0:30 Done: 11 files added, two name clashes kept side by side, 36 already there under other names.

What Stella does:

1. Compares Family photos in Pictures with the older copy in Documents by file content, not names
2. Recognises six photos that were only renamed or moved in the newer copy, so they aren't copied twice
3. Copies the 11 files only in the old copy into the matching subfolders, including a whole 2018 Wedding folder and a video
4. Keeps both versions where two different photos share a name, adding “(old laptop)” to the older one's name
5. Skips two Windows and Mac system files, leaves the old copy untouched and saves a list of what was added

## The prompt to paste

```text
I have two copies of our family photos: the Family photos folder in my Pictures, and an older copy from my old laptop in my Documents called 'Family photos (old laptop)'. Compare them and copy anything that's only in the old copy into the Pictures one, so nothing gets lost. Don't overwrite anything.
```

## Compare them yourself

1. **Back up first.** Before merging, copy the newer folder somewhere safe, or make sure it's in your backup. A wrong copy command can overwrite photos, and an overwritten file doesn't go to the Trash.
2. **Windows: robocopy.** In Command Prompt: `robocopy "%USERPROFILE%\Documents\Family photos (old laptop)" "%USERPROFILE%\Pictures\Family photos" /E /XC /XN /XO` copies files whose name isn't there yet, with subfolders, and skips any that exist. Add `/L` first to only list what it would do.
3. **Mac: rsync.** In Terminal: `rsync -av --ignore-existing ~/Documents/'Family photos (old laptop)'/ ~/Pictures/'Family photos'/`. Add `-n` to try it without copying. It also matches by name, so renamed photos come across again.
4. **Or see the differences side by side.** WinMerge (free, Windows) compares two folders and shows files only on the left, only on the right, or different. Filter to left-only and copy those across. Turn on content comparison to catch same-name files that differ.
5. **Check the same-name files.** Name-based tools skip a file that exists in both places even if the photos are different. Look at those by eye and copy any different ones across with a new name.

## Where Stella stops

- It copies one way, as asked. Two-way syncing, where deletions are mirrored too, is a different job; say so if that's what you want.
- A photo that was edited in one copy (rotated, cropped) counts as different, so both versions are kept.
- File names and folder structure go to the AI model you use in Stella; the photos themselves are compared on your computer.
- Recorded on Linux, where Stella used Python, built in on Mac and Linux. On Windows it may install Python first, which wasn't recorded.

## Questions

**How do I compare two folders on Windows 11?**
Windows has no built-in folder compare. Use robocopy with `/L` to list differences without copying, or the free WinMerge to see them side by side.

**How do I compare two folders on a Mac?**
`diff -rq folder1 folder2` in Terminal lists files only in one or different in both. Apple's FileMerge does it with windows but comes with Xcode.

**Will it delete the old copy?**
No. It copies and leaves the old copy alone, and says when it looks safe to delete. For duplicates within one folder, see [find duplicate photos](https://stella.sh/how/photos-files/find-duplicate-photos).

**Can it put everything from many subfolders into one?**
Yes: see [move files from subfolders into one folder](https://stella.sh/how/files-folders/move-files-from-subfolders-into-one-folder).

**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.

Sources: [Microsoft Learn: robocopy](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy), [WinMerge (free folder and file compare)](https://winmerge.org/).

## Related problems

- [Find duplicate photos, including resized copies](https://stella.sh/how/photos-files/find-duplicate-photos.md)
- [Move all files from subfolders into one folder without losing any](https://stella.sh/how/files-folders/move-files-from-subfolders-into-one-folder.md)
- [Sort photos into folders by the date they were taken](https://stella.sh/how/photos-files/sort-photos-into-folders-by-date.md)
- [Extract multiple zip files at once, each into its own folder](https://stella.sh/how/files-folders/extract-multiple-zip-files-at-once.md)
- [Find files containing text, whatever type of file they are](https://stella.sh/how/files-folders/find-files-containing-text.md)
- [How to open a 7z file, even one split into parts](https://stella.sh/how/files-folders/open-7z-file.md)

Get Stella: https://stella.sh/download. Free with the ChatGPT or Claude plan you already have.
