Deleted Folders re-appear immediately in iCloud Trash

I have deleted a few folders in my Obsidian Vault. I use iCloud Sync for sync the vault between mac and phone. There have been these few folders that I’ve deleted a while ago, but they always seem to appear back in trash immediately after deleting. I haven’t found a way to get rid of them. I’m not sure if this is iCloud’s fault, or obsidian or a system setting or something else entirely that’s causing this.

I’ve already restarted my system a few times. So, that didn’t solve the problem. I’ve attached a screen recording for understand how this happens.

https://share.cleanshot.com/RNxNbPlp

For Obsidian vaults in iCloud Drive, you want to make sure the vault folder is always downloaded or in older versions of macOS, that “Optimize Mac Storage” (in iCloud Drive’s settings) of off.


If you move or make a copy of your vault outside of / not touched by iCloud Drive and use that vault for a bit, how does it behave? Then you’ll know if it’s iCloud or not causing the issue.

I suspect iCloud Drive and I’d try the above to check.

Hey @ariehen. I have Keep Downloaded enabled on all my apple devices.

CleanShot 2025-03-24 at 8 .47.50

However, I’ve played around and messed with iCloud via shell a few times. But I don’t recall deleting folders from the shell. I’ve written a shell script which can automatically copy the vault folder from iCloud and push it to content folder on my Quartz setup and publish it in one command. I’ve realized that the custom shell script isn’t probably a better way and then switched to using the npx quartz CLI tool and updated my shell script to use it. Here’s the script for your reference.

#!/bin/bash
CONTENT_SOURCE="/Users/pranav/Library/Mobile Documents/iCloud~md~obsidian/Documents/content"

npx quartz create -s $CONTENT_SOURCE -X copy -l shortest

git checkout main
git add . 
git commit -m "fix: content-update $(date +'%D %T')"
git push -u origin head

echo "Uploaded to Git"

But, I’m almost sure that this isn’t the cause of the problem.