# Workspaces

Source: https://cohalen.com/docs/workspaces



Each workspace has its own git worktree, so parallel agents never write to the same
checkout. Run as many as your machine holds.

## Launch [#launch]

Launch a workspace from its repository's group in the sidebar. Two launch modes
decide the branch:

<Tabs items="[&#x22;New branch&#x22;, &#x22;Existing branch&#x22;]">
  <Tab value="New branch">
    Forks a fresh branch for the task. This is the default for new work.
  </Tab>

  <Tab value="Existing branch">
    Checks out a branch that already exists: your own work in progress, a teammate's
    branch, or a pull request. One branch, one workspace at a time.
  </Tab>
</Tabs>

The first prompt you send is the workspace's starting line, the one place the task
is written down. Keep it to one task, so the changeset you read later reads as one
thing too.

## The base branch [#the-base-branch]

Every workspace has a base branch: the repository branch its changes merge into,
and what its git status and changeset are measured against.

It starts as the repository's default branch. You can point it somewhere else later
in **Checks**, where the merge happens.

## Working in parallel [#working-in-parallel]

Launch more workspaces for more tasks. Each one has its own agent and runs on its
own, and the sidebar shows you which one needs you.

When two workspaces in flight touch the same file, Cohalen marks the collision, so
you see the merge conflict coming before it lands.

## Resume [#resume]

The conversation is a session the coding agent itself writes to disk. Re-open a
workspace, even after an app restart, and the agent picks up its context instead of
starting over.

## Archive, Restore, Delete [#archive-restore-delete]

A workspace has two exits.

<Callout type="warn">
  **Archive** you can undo. **Delete** you can't.
</Callout>

<Mermaid
  chart="`stateDiagram-v2
accTitle: The workspace lifecycle
accDescr {
  Launch creates an active workspace. Archive moves it to archived, and Restore
  brings it back to active. Delete ends it for good, from either state.
}
[*] --> Active : Launch
Active --> Archived : Archive
Archived --> Active : Restore
Active --> [*] : Delete
Archived --> [*] : Delete`"
/>

**Archive** retires a finished workspace from the active list. Cohalen commits
whatever you left behind so nothing is lost. Then it runs the repository's archive
script, takes the worktree off disk, and keeps the branch and the record under
**History**.

**Restore** rebuilds the worktree from that branch, and the session picks up where
it stopped. Archiving can also happen on its own when the pull request merges,
which you set per repository.

**Delete** removes the worktree and the branch Cohalen created, then drops the
record. A branch you brought yourself is never deleted. Delete asks first, and asks
again when git turns it down for a dirty worktree or an unmerged branch.
