Agents · Codex

What Codex leaves on your Mac.

Sessions, archived sessions, temporary git repositories, caches and Codex worktrees. Devbroom finds them all, and tells you which ones Codex manages itself, which are left to you and which are never touched.

What it looks at

Every folder has its own rule.

Devbroom handles every place the way Codex 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.
With codex deleteOnly through Codex's own command. Devbroom shows these as Blocked and tells you the command.
Codex managesThe agent cleans up old ones itself; Devbroom only shows them.
Never touchedShown, never deleted.

Temporary git repositories

Leftover git-* temporary repositories. What they're for isn't documented; have a look before cleaning.

~/.codex/.tmp
Assessed

Cache and logs

The cache is rebuilt when needed; logs are only logs.

~/.codex/cache~/.codex/log~/Library/Logs/com.openai.codex
Assessed

Sessions

Deleting the log files by hand leaves stale rows in the database. Codex's own command, codex delete <id>, should be used.

~/.codex/sessions~/.codex/archived_sessions
With codex delete

Codex worktrees

The desktop app keeps the newest 15 and takes a snapshot before deleting one.

~/.codex/worktrees
Codex manages

Shell snapshots

Codex deletes the ones older than 3 days itself.

~/.codex/shell_snapshots
Codex deletes

Plugins

Codex manages its plugins.

~/.codex/plugins/cache
Never touched

Desktop app data

The app's state and internal database; never edited or deleted directly.

~/Library/Application Support/Codex~/.codex/*.sqlite
Never touched
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.

Credentials~/.codex/auth.json
Settings~/.codex/config.toml
Prompt history~/.codex/history.jsonl
Desktop database~/.codex/sqlite
Worktrees

Recognizes Codex's worktrees by their traces.

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

  • CertainCodex's codex-thread.json marker in git metadata
  • LikelyInside the ~/.codex/worktrees folder
  • PossibleA branch name starting with codex/
  • 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 knows which Codex sessions are running. It never touches a running session's processes; its folder stays Blocked while the session lasts.

Compatibility

Checks Codex'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 versions0.115.0 - 0.159.2

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

Format checkcwd

The log files in ~/.codex/sessions must start with a metadata line that carries the session's folder.

Your versiondevbroom compat

If its folders live elsewhere, it follows CODEX_HOME.

Let Codex work. Devbroom cleans up after it.