Three kinds of files — three different situations
Everything you work with in OpenCode falls into one of three categories. They behave very differently and need different treatment.
Working files
Context packs, playbooks, project notes, meeting transcripts, outputs. Everything you create and use day to day.
One-time setup, then automaticOpenCode config
Your MCP connections, global instructions, custom commands, and personal settings. Small but took time to build.
One-time setup, then automaticSession history
Every conversation you've had with OpenCode — including anything sensitive or private you've discussed or pasted in.
Local only — never cloudWorking files — set up hourly GitHub sync
Your working files need to be connected to a GitHub repository so they back up automatically. This is a one-time setup — once it's done, an hourly sync runs silently in the background.
What the setup does:
- Creates a private GitHub repository to hold your files — only you can access it.
- Connects your working folder on your Mac to that repository.
- Schedules an hourly sync that pushes any changes to GitHub automatically.
You don't need to understand how any of that works. Just ask OpenCode to do it:
Once it's running, you never need to think about it again. There's no manual backup command — it happens on a schedule.
OpenCode config — back it up once
Your OpenCode configuration is a separate folder that holds everything you've customised: which tools are connected (MCPs), your global instructions, and any personal commands. If your laptop died today, you'd need to rebuild all of this from scratch.
The fix is exactly the same as for working files — connect this folder to its own private GitHub repository. Once connected, it syncs automatically alongside everything else.
Session history — keep it local
Every conversation you have with OpenCode is stored as a transcript on your machine. This can include sensitive content — internal project details, customer context, anything you've pasted into a session.
You don't need to do anything to set this up — the right behaviour is already the default. Just make sure Time Machine (or equivalent) is running.
What to do today
- Set up working file sync. Ask OpenCode: "Are my working folders syncing to GitHub hourly? If not, set that up for me."
- Back up your config. Ask OpenCode: "Is my OpenCode config folder backed up to GitHub? If not, set that up."
- Check Time Machine. Open Time Machine on your Mac and confirm the last backup completed recently. This covers your session history and everything else on your machine.
The technical details — git, launchd, auto-sync scripts — are intentionally not covered here. If you want to understand or customise your setup, ask OpenCode to walk you through it.