Skip to content
Download

DOCS / WORKSPACES

Resume & restart

Closing Birch doesn’t end your workspaces. The worktree, branch, agent kind, and launch command are all persisted; the agent’s own session is rediscovered from its CLI’s store and resumed the first time you re-enter the workspace in a new app run. This page explains exactly what persists, what resumes, and what starts fresh. See AI in Birch for how sessions fit the bigger picture.

Persisted?Notes
Worktree + branchYesOn disk; worktrees are kept even after the shell exits
Agent kindYesWhich agent the workspace belongs to
Exact launch commandYesIncluding --model / --effort / --settings flags
Creation promptNoOne-shot at creation, by design
Session idNoRediscovered live from the agent CLI’s own session store

The first time you open a workspace in a given app run, Birch locates the newest session the agent CLI itself recorded for that worktree and relaunches the recorded command with the right resume argument:

AgentSession store consultedResume command
Claude~/.claude/projects/ transcriptsclaude … --resume <id>
Codex~/.codex/sessions/ rolloutscodex resume <id>
OpenCodeOpenCode’s project/session storageopencode --session <id>
CustomThe store of the CLI named by the command’s first word, if that is claude, codex, or opencodeThe matching resume argument — otherwise relaunched unchanged

A Custom command isn’t opaque to resume: Birch looks at its first word, and a custom command that runs claude, codex, or opencode gets that CLI’s matching resume argument. Only genuinely unrecognized commands are relaunched exactly as recorded — Birch never guesses a resume flag that could error out and leave you with a bare shell. Workspaces created before Birch recorded agent kinds have every locator probed, with the newest session winning, so they resume too.

A resume happens once per app run, on the workspace’s first launch. If you quit the agent and re-select the workspace later in the same run, it starts fresh — the same behavior as before restarts were survivable. To continue a past session at any other time, use the Resume button on the properties panel’s AGENT SESSION card (“Continue this session in the workspace terminal”).

If no session is found — a brand-new worktree, a cleaned agent store — the recorded command simply runs without a resume argument: a fresh agent in the same worktree, with all the workspace’s files and commits intact.

Started an agent in a plain terminal? The birch-status plugin ships a /birch slash command that runs birch open with the current session id and working directory, handing that exact session over to a Birch workspace.

Closing Birch with live agents raises an “Agents are still running” confirmation that counts how many are working and how many are waiting for your input, and warns that closing will stop them and may lose unsaved work. Cancel keeps them running; Close anyway quits.

Worktrees are never deleted implicitly — exiting the agent keeps the workspace in the sidebar. To remove one:

  • Sidebar — right-click the workspace row → Delete workspace… (or its trash button). After a confirmation — which warns if the branch is unmerged or the worktree has uncommitted changes — Birch deletes the worktree and its throwaway branch.
  • CLIbirch worktree rm <name> removes the worktree; branch deletion is opt-in via --delete-branch. See birch worktree.