Agents · OpenCode

What OpenCode leaves on your Mac.

Session database, undo snapshots, old session files, logs and worktrees. Devbroom only reads the database and checks its format on every scan; if the format doesn't hold, none of OpenCode's data counts as ready to clean.

What it looks at

Every folder has its own rule.

Devbroom handles every place the way OpenCode itself behaves. What the agent cleans itself it leaves to the agent; what has its own command it leaves to that command.

AssessedEach item is checked on its own; if it comes out Ready you can clean it.
Through OpenCode itselfOnly through OpenCode's own command. Devbroom shows these as Blocked and tells you the way.
OpenCode deletesThe agent cleans up old ones itself; Devbroom only shows them.

Undo snapshots

Shadow git repositories; orphaned when projects or worktrees are deleted.

~/.local/share/opencode/snapshot
Assessed

Session files from before 1.2

Copied into SQLite on migration and never deleted.

~/.local/share/opencode/storage
Assessed

Logs and cache

A single log file that's never rotated, and a cache documented as safe to delete.

~/.local/share/opencode/log~/.cache/opencode
Assessed

Session database

Read only. The file never shrinks by itself; clean it with opencode session delete <id>.

~/.local/share/opencode/opencode.db
Through OpenCode itself

OpenCode worktrees

Should be removed from the OpenCode app; they never expire by themselves.

~/.local/share/opencode/worktree
Through OpenCode itself

Tool output

While running, OpenCode deletes the ones older than 7 days itself.

~/.local/share/opencode/tool-output
OpenCode deletes
Protected

Your account and settings stay untouched.

These files and folders are protected. No verdict ever opens them to cleaning; they stay where they are whatever their size.

Session database and its journalsopencode.db · -wal · -shm
Credentialsauth.json
MCP credentialsmcp-auth.json
Worktrees

Recognizes OpenCode's worktrees by their traces.

It tells a worktree belongs to OpenCode from these traces; the stronger the trace, the more certain the ownership it shows.

  • LikelyInside OpenCode's worktree folder
  • PossibleA branch name starting with opencode/
  • Blocked if it holds unsaved work. git won't remove such a worktree without --force; Devbroom never uses --force.
  • Blocked if a session runs in it or in its parent folder.
  • Review if it has ignored files: git worktree remove deletes them without asking.
Running sessions

Sees them, leaves them alone while they run.

Devbroom reads from the database which OpenCode sessions are in which folder. It never touches a running session's processes; its folder stays Blocked while the session lasts.

Compatibility

Checks OpenCode's files first.

Before trusting an agent's data, Devbroom checks that its files are in the expected format. If they aren't, that data is only read; none of it counts as ready to clean.

Tested versionsnone yet

A version outside this range still works if the format holds, and shows as “not tested yet”.

Format checkid and directory

opencode.db must open read only and its session table must have these two columns.

Your versiondevbroom compat

If its folders live elsewhere, it follows XDG_DATA_HOME, XDG_CACHE_HOME, OPENCODE_DB.

Let OpenCode work. Devbroom cleans up after it.