Docs menu

Agent spaces

.md

One directory per org, one subdirectory per task, one mount per repo the task touches.

An agent space is a directory where coding agents work across one organization's repos. Each task gets its own subdirectory, and inside it you mount whichever repos the task needs β€” each on its own branch. It's like a set of Git worktrees, except there's no clone behind any of them, so starting a task takes seconds.

acme/                          ← the space (one per org)
β”œβ”€β”€ AGENTS.md
β”œβ”€β”€ fix-auth-redirect/         ← one task
β”‚   └── web/                   ← a mount of acme/web, on branch fix-auth-redirect--a1b2c3d4
└── unify-errors/              ← a cross-repo task
    β”œβ”€β”€ web/                   ← mount of acme/web,   branch unify-errors--…
    └── api/                   ← mount of acme/api,   branch unify-errors--…

Spaces are built on lazy mounts, so the one-time mount setup applies.

Create a space#

oak space new acme              # creates ./acme
oak space new acme ~/work/acme  # …or somewhere else

This writes:

FilePurpose
AGENTS.mdThe workflow, written for an agent: picking a task slug, mounting, finishing, and the mount traps to avoid. Edit it to add your team's conventions.
CLAUDE.mdA one-line @AGENTS.md import, for Claude Code.
.claude/settings.jsonPre-approves the oak commands agents need, and lists mounts when a Claude Code session stops.
.oak-spaceMarks the directory as a space for the org.

Nothing is cloned or mounted yet.

The per-task loop#

  1. Pick a slug β€” short and kebab-case, like fix-auth-redirect. It becomes the task directory and the start of each branch name.
  2. See what's available: oak space repos lists the org's repos (add --json for agents).
  3. Mount each repo the task needs under the task directory:
    oak mount acme/web ./fix-auth-redirect/web
    
  4. Work inside each mount. oak status, diff, commit, and push all act on that mount's branch.
  5. Finish each repo you touched:
    oak mount finish ./fix-auth-redirect/web --desc-file desc.md --json   # from the space root
    # or, from inside the mount: oak finish --desc-file desc.md --json
    
    This sets the description, checkpoints, pushes, and unmounts β€” unmounting only after the push succeeds.
  6. Sweep up: oak space clean tears down every mount in the space that has nothing uncommitted or unpushed. Add a path to clean one task; --force also removes dirty mounts, discarding their changes.

Each repo's mount is independent: describe, commit, and push them separately, even within one cross-repo task.

Take stock#

oak space inventory --verify-local --include-ci --json

oak space inventory walks a directory tree and reports every Oak checkout and mount it finds. --verify-local adds each one's dirty-file and unpushed-commit counts; --include-ci adds the CI state of each one's head. It's an observation, not a guarantee β€” it never certifies that a directory is safe to delete.

Running agents in a space#

Launch agents from the space root so they read AGENTS.md, and tell each which task directory is its own. Example: a fleet of agents walks through fanning out, reviewing, and merging end to end.

Something here wrong or missing? Run oak feedback -m "…" or email [email protected].