How to clone a folder on a Mac without using extra disk space
Copying a 10 GB project folder normally costs 10 GB. On a Mac with an APFS disk, you can make the copy in a fraction of a second and spend almost no space. This is how, and where it stops working. Checked on macOS 27.0.1.
The command
cp -c -R ~/Projects/Aurora ~/Projects/Aurora-before
-Rcopies the folder and everything in it.-caskscpto clone the files instead of copying their data. The macOScpman page describes it as copying withclonefile(2)where it can.
Both folders must be on the same APFS volume. The new folder looks like any other: you can open, edit and delete files in it.
What it costs: measured
We made a test folder with 2,000 small files and one 300 MB file on an APFS disk and cloned it:
| Result | |
|---|---|
| Time to clone | about 0.2 seconds |
| Extra disk space used | about 1.3 MB (from df, mostly for the 2,000 new directory entries) |
Size shown by du |
308 MB for the original, and 308 MB for the clone |
The last row surprises people. du and Finder’s Get Info count each copy’s full size, even though the data is shared. To see what a clone really uses, compare free space before and after:
df -k /System/Volumes/Data
Run it before and after the clone and subtract the two “Available” numbers.
When a clone stops being free
A clone shares data only until something changes. If you edit a file in either folder, APFS writes the new version to new space, and the shared original stays for the other folder. So:
- Edit a small text file: a few KB of extra space.
- Rewrite a 300 MB file: about 300 MB of extra space.
- Delete a file from the original: the clone keeps it, and that space is not freed until the clone is deleted too.
An old clone can therefore quietly hold on to gigabytes. Delete clones you no longer need.
It falls back to a normal copy in two cases
- Different volume. Cloning only works inside one APFS volume. To another disk,
cp -cmakes a full copy (the man page says it falls back to a normal copy when it can’t clone). - A disk that isn’t APFS, such as exFAT or a network share.
Check the file system with diskutil info / or diskutil info /Volumes/YourDisk and look for “File System Personality: APFS”.
Using a clone as an undo point
Make the clone before something risky: an AI agent run, a bulk rename, a script you wrote in a hurry. If it goes wrong:
diff -rq ~/Projects/Aurora ~/Projects/Aurora-before
diff -rq lists the files that differ or exist in only one folder. To go back, move the changed folder to the Trash and rename the clone to the original name.
That works, but it’s all by hand. You get no readable list of changes, no way to put back only some files, and nothing reminds you to clean up. It’s also not a backup, since it’s on the same disk.
Or let Mulligan do it
Mulligan uses the same APFS cloning. It saves the folder in one click, or with mulligan save . in Terminal, then shows what changed and puts back everything or just the files you pick. The old versions go to the Trash. In our tests on macOS 27.0.1, saving 20,000 files plus a 1 GB file took about two seconds. For when the changes were made by an AI agent, see how to undo Claude Code changes.
Questions
What is an APFS clone?
A copy of a file that shares its data blocks with the original until one of them changes. Only the changed parts take new space, so copying a large folder is fast and almost free at first.
Does a clone work on an external drive or network share?
Only inside one APFS volume. Copying to another disk, or to a drive that isn't APFS, makes a normal full copy. Check with Disk Utility or diskutil info that the volume's file system is APFS.
Is a cloned folder a backup?
No. It sits on the same disk as the original, so if the disk fails or you erase it, both are gone. Use it as an undo point and keep a real backup, such as Time Machine.