6. Cloud storage sync
- Code
- git — not a sync folder
- Documents
- iCloud / Drive / OneDrive
- Key setting
- Keep files downloaded
Cloud storage is a great way to hand documents to your agents — drop a spec into a synced folder from your phone, and an assistant on the Mac mini can read it. It’s a terrible place for source code.
Ground rules
Section titled “Ground rules”- Code lives in git, in a normal folder such as
~/code/, pushed to a remote. Never put a git repository,node_modules, a Python virtual environment or build output inside a synced folder: thousands of small, fast-changing files cause sync conflicts, corrupted repos and huge upload queues. - Documents live in cloud storage. Give agents a clear
Inbox(things for them to read) andOutbox(things they produce) inside your synced folder. - Keep synced files downloaded. All three services can replace files with online-only placeholders. A background job that opens a placeholder has to wait for a download — or fails if the sync client isn’t running. Tell each service to keep your agent folders on the Mac.
- Watch the sign-in. Sync clients occasionally need you to sign in again. Add them to
health-check.sh --app …so you notice when one isn’t running.
Where the files are
Section titled “Where the files are”| Service | Folder on the Mac |
|---|---|
| iCloud Drive | ~/Library/Mobile Documents/com~apple~CloudDocs/ (shown as iCloud Drive in Finder) |
| Google Drive for desktop | ~/Library/CloudStorage/GoogleDrive-…/ |
| OneDrive | ~/Library/CloudStorage/OneDrive-…/ |
Google Drive and OneDrive use Apple’s File Provider system, which is why they live under
~/Library/CloudStorage/. Use those real paths (or the Finder sidebar) rather than old ~/Google Drive
style paths from older guides.
iCloud Drive
Section titled “iCloud Drive”System Settings → [your name] → iCloud → Drive (called iCloud Drive on older versions).
- Turn Sync this Mac on.
- Turn Optimize Mac Storage off, so files stay fully downloaded.
- Consider leaving Desktop & Documents Folders off on a server, so tools that write to
~/Documentsdon’t upload everything they touch.
To keep a single folder downloaded when optimisation is on, right-click it in Finder and choose Keep Downloaded.
Google Drive for desktop
Section titled “Google Drive for desktop”Install Google Drive for desktop from Google, sign in, then open its Settings → Preferences:
- Stream files keeps files online-only until opened. If you use it, right-click your agent folders in Finder and choose Available offline.
- Mirror files keeps a full local copy of My Drive — simpler for an always-on server if you have the disk space.
OneDrive
Section titled “OneDrive”Install OneDrive from the Mac App Store or Microsoft, sign in, and choose which folders to sync. Files On-Demand is always on with File Provider, so right-click your agent folders and choose Always Keep on This Device.
Background access
Section titled “Background access”The first time a background process reads a cloud-storage folder, macOS may ask for permission. A LaunchAgent can’t answer that prompt. Run the job once by hand while you’re logged in (or connected with Screen Sharing) and approve it — see privacy permissions.
A simple agent inbox
Section titled “A simple agent inbox”iCloud Drive/└── AI Server/ ├── Inbox/ ← you drop files here from any device ├── Outbox/ ← agents write results here └── Archive/ ← processed inputs move hereYour agent (or a small LaunchAgent script with StartInterval) checks Inbox/, works on each file, writes
to Outbox/, and moves the input to Archive/. Keep it idempotent — if the Mac restarts halfway, running
it again should not duplicate work.