---
title: clone
description: Full per-session git clone. Use when worktrees fight your tooling.
---

<div style={{ display: "flex", alignItems: "center", gap: "0.75rem", margin: "0.5rem 0 1.25rem" }}>
  <Logo name="github" size={28} />
  <span style={{ fontSize: "0.8125rem", color: "var(--color-fd-muted-foreground)" }}>Slot: <code>workspace</code> · Name: <code>clone</code></span>
</div>

Every session gets a full `git clone`. Heavier on disk than `worktree`, but simpler for any tooling that gets confused by the worktree layout.

<PlatformSupport macos="full" linux="full" windows="full" />

## Use

```yaml title="agent-orchestrator.yaml"
workspace: clone
workspaceConfig:
  cloneDir: ~/.ao-clones       # default
```

| Config key | Default | What it does |
|---|---|---|
| `cloneDir` | `~/.ao-clones` | Base directory for all clones |

## How it works

- On spawn, AO runs `git clone --reference <source> <cloneDir>/{sessionId}`. The `--reference` flag means the new clone borrows objects from your existing checkout — much faster than a cold clone.
- The agent gets a fully independent working tree with its own `.git`.
- On cleanup, the directory is removed outright.

## When to pick this over worktree

- Your build tool walks `.git` and breaks on worktrees (rare but happens).
- You want each session to have a completely fresh `node_modules` / target dir with no shared parent.
- You're experimenting with agents on different remotes.

## Knobs

```yaml
projects:
  web:
    workspace: clone
    postCreate:
      - pnpm install --frozen-lockfile
```

`postCreate` runs after the clone succeeds. Useful for installing deps before the agent wakes up — the first impression matters.
