The CLI keeps its state in ~/.cf-opencode. Files that hold a secret have mode 600.
| Path | Secret | Content |
|---|---|---|
~/.cf-opencode/install.json |
No | The Worker URL, the Worker name and the account ID. Mode 600. |
~/.cf-opencode/config.json |
No | Your settings. You write it; init and upgrade read it and apply it. The CLI never writes it. See Configuration. |
~/.cf-opencode/skills.json |
No | The default skill list, as { "names": [...] }. cf-opencode skills default writes it. connect, run and skills push read it. It does not exist until you set a list. See Skills in a workspace. |
~/.cf-opencode/control-token |
Yes | The control token. Mode 600. |
~/.cf-opencode/workspaces/<workspace>.json |
No | The local record of a workspace: URL, directory, repository, branch and snapshot ID. Mode 600. |
~/.cf-opencode/workspaces/<workspace>.password |
Yes | The workspace password. Mode 600. |
~/.cf-opencode/ssh/id_ed25519 |
Yes | The SSH private key. The CLI makes it once. |
~/.cf-opencode/ssh/id_ed25519.pub |
No | The public key. The CLI installs it in workspaces. |
~/.cf-opencode/ssh/known_hosts |
No | The SSH host keys of workspaces. |
~/.cf-opencode/deploy/ |
No | The copy of the Worker and image sources that init deploys. init replaces it on each run. |
~/.cf-opencode/deploy.log |
No | The full wrangler output of the last deploy. Mode 600. |
~/.cf-opencode/deploying.json |
No | Exists only after a first init that failed. It lets the rerun continue without --adopt. |
What the CLI does with them
initwritescontrol-token,install.jsonand the deploy files.connectwrites the workspace files and the password file.list,sessionsandtasksread the workspace files. They show the workspaces that this machine connected to.shell,ssh,ssh-config,preview,skillsandbrowseread the workspace password file.sshmakes the SSH key on first use.skills defaultwritesskills.json.connect,runandskills pushread it.doctorreadsinstall.jsonandcontrol-token.deleteremoves the two files of that workspace and its line inknown_hosts.uninstall --yesremovesinstall.json. It keeps the rest.
To remove all state, delete the folder ~/.cf-opencode.
Inside a workspace
The Worker writes these files in /home/user of the workspace:
| Path | Content |
|---|---|
~/.cf-opencode-url |
The Worker URL. cf-opencode-browse and cf-opencode-preview read it. |
~/.cf-opencode-workspace |
The workspace ID. cf-opencode-browse and cf-opencode-preview read it. |
~/.cf-opencode/opencode-config.json |
The OpenCode model config. It holds a placeholder, not a key. The opencode command reads it. The Worker writes it on each wake, and removes it when ai is false. |
~/.config/opencode/AGENTS.md |
The workspace notes. The Worker writes them on each wake. A file there that you wrote, without the first-line marker cf-opencode workspace notes, is left alone. See What the agent knows. |
~/.config/opencode/skills/<name>/ |
Skills that you copied with cf-opencode skills push, connect --skills or run --skills. See Skills in a workspace. |
~/.ssh/authorized_keys |
A cf-opencode block with the CLI keys that connected in the last 30 days. Each SSH connect rewrites the block. Lines that you add stay. |
The project is at /home/user/project, unless you pass --dir.