Use managed workspaces
Managed workspaces keep provider edits out of the project root by placing source files in separate Git-backed worktrees or writable snapshots.
1. Decide whether to use workspaces
Understand the boundary
Workspace isolation is optional and disabled by default. Use the project-root execution model for a first run or for a non-Git project.
Managed workspaces isolate the source tree, not the provider process. Provider CLIs and setup commands retain their configured permissions, approval settings, network access, credentials, and filesystem access.
Workspace boundary
Source-tree separation is not a sandbox or security boundary.
Check repository and invoker support
Use an ordinary supported Git repository and an invoker that honors the runtime-supplied working directory. Setup must be expressible as audited argument lists. Use this when source lineage or optional local branch export is useful; uncommitted manual edits cannot be included in the provider-visible source tree.
blob_exact requires provider-visible bytes to match Git blobs. LFS, custom filters, text/eol or encoding conversions, submodules, sparse or partial clones, and symlinked .gitignore or .gitattributes are unsupported. Use a full clone, replace and commit symlinked control files, or disable isolation as appropriate. Native Windows is unsupported; use WSL or another POSIX environment. Ordinary ignored caches are excluded from lineage.
Repository support
Unsupported source features fail before provider invocation.
2. Enable and declare workspaces
Enable the workspace gate
Set settings.workspace.enabled: true to allow workspaces. This alone allocates nothing: without workflow worktrees, providers use the project root and no workspace source policy, state, snapshot, worktree, or bundle is created. settings.default_workspace is not supported.
An optional cache_root must be absolute. Without one, the default is ~/Library/Caches/crewplane on macOS or ${XDG_CACHE_HOME:-~/.cache}/crewplane elsewhere.
settings: workspace: enabled: true cache_root: /absolute/path/to/crewplane-workspaces cleanup_on_success: true worktree_contract: "blob_exact" clean_start: "strict" setup_profiles: {} setup_timeout_seconds: 600 identity: include_cache_root: false max_concurrent_materializations: 1 disk: warn_free_bytes: null fail_free_bytes: null Gate and declaration
Both configuration and workflow selection determine allocation.
Hover or focus a node to preview its explanation; click to keep it.Tap a node to select its explanation.
- Config gate → Workflow worktrees
- Workflow worktrees → Node selector
Allow workspace use
The config gate permits managed workspaces, but setting it to true alone does not create one. Without workflow worktree declarations, providers continue to run at the project root.
Declare available workspaces
The workflow names its logical worktrees and chooses their kinds. A worktree carries a mutable source line, while a snapshot is a disposable writable checkout for scratch or review work.
Choose where a node runs
A provider node selects a declared workspace, inherits the only one when applicable, or opts out with worktree: none. Multiple declared worktrees require an explicit choice or opt-out.
Declare logical source lines
A worktree is mutable and can produce source lineage and optional local branch export. A snapshot is a writable, disposable checkout for review, audit, test discovery, or scratch work; it produces neither source lineage nor a branch. Names are local to the workflow; none is reserved.
worktrees: implementation: kind: worktree create_branch: true scratch: kind: snapshot Workspace kinds
Different declarations create independent logical workspaces.
Select a workspace per provider node
With one declared worktree, provider nodes inherit it unless they select another option. With multiple declarations, each provider node must select one or set worktree: none for project-root execution with no lineage. Input nodes cannot select worktrees and never allocate provider workspaces.
Nodes using the same mutable worktree continue one source line only when the DAG orders them. Each mutable worktree node may have one executor provider; sequential review loops may still have reviewers. Parallel writers to one logical worktree fail validation. Different names are independent and are not merged automatically.
nodes: - id: implement mode: parallel providers: ["codex"] worktree: implementation
- id: summarize mode: sequential providers: ["claude"] worktree: none Node workspace selectors
These selectors choose different working locations; the example does not declare an ordering dependency.
Understand the source snapshot
Crewplane creates working directories for projects in repository subdirectories even when they contain no tracked files. Under clean_start: tracked_only, untracked files are excluded.
Source selection
The managed source comes from supported Git state.
3. Prepare files and prompts
Run setup before providers
Define a setup profile as lists of program and arguments, then select it on a kind: worktree declaration. Commands run inside the new workspace before the provider; output and status are saved.
Put initialization here because managed worktree creation does not run Git checkout hooks. Ignored dependency files, such as virtual environments installed by setup, are not included in saved code results.
settings: workspace: setup_profiles: bootstrap: run: - ["uv", "sync"] worktrees: implementation: kind: worktree setup_profile: bootstrap Setup order
Setup prepares the workspace and records its result.
Hover or focus a node to preview its explanation; click to keep it.Tap a node to select its explanation.
- Materialize → Setup
- Setup → Provider
Create the workspace
Crewplane materializes the managed worktree before running its selected setup profile. The workspace contains the managed source tree; ignored dependency caches are not carried into saved code results.
Prepare dependencies
A setup profile lists programs and arguments to run inside the workspace. Crewplane records their output and status, and the profile can perform initialization that Git checkout hooks do not run here.
Start the provider afterward
The provider works in the prepared workspace after setup. Its process retains its configured permissions and access; a managed workspace is a source-management boundary, not a security sandbox.
Resolve file templates from source
With isolation disabled, repo-relative {{file:path}} reads UTF-8 text from the project root during static preflight. In managed workspaces it becomes a workspace-file locator: runtime injects Git blob bytes from the invocation source commit, not unchecked checkout or workspace bytes. Reviewer and remediation rounds use the current candidate commit.
Absolute paths are blocked unless allowlisted through settings.file_access.allowed_template_paths. Allowlisted absolute files are static external resources and are outside Git lineage.
File template resolution
A file token inserts content; it does not invoke a provider.
4. Export and clean up
Export a verified result locally
Branch export is opt-in for a kind: worktree. After success, duplicate skip, or resume has a verified final checkpoint, Crewplane creates or verifies the local branch. It never pushes, opens a pull request, merges, rebases, switches the checkout, or updates the current branch.
worktrees: implementation: kind: worktree create_branch: true branch_name: ai/implement-authentication Local branch export
Export exposes verified workspace results locally.
Hover or focus a node to preview its explanation; click to keep it.Tap a node to select its explanation.
- Verified checkpoint → Local branch
- Local branch → Review
Require verified lineage
A successful workflow, duplicate skip, or resume must have a verified final checkpoint for the logical worktree before branch export can proceed. Snapshot workspaces do not produce this source lineage.
Expose a local branch
When create_branch is enabled, Crewplane creates or verifies the configured local branch from that checkpoint. Export does not push, switch the checkout, or update the current branch.
Decide what comes next
The local branch makes the verified result available for your review. You decide whether to inspect it, push it, open a pull request, or integrate it using your normal process.
Inspect lineage and snapshots
Successful worktree nodes save workspace-state*.json and Git bundles under workspace-bundles/ in the node stage directory. Snapshots record changed source files and then discard the changes instead of adding source history.
A snapshot can succeed when the change summary is too large, has too many changes, or times out, but reports that the full set could not be determined. Unsafe files, changing files, or cancellation cause failure.
Workspace records
Worktree lineage and snapshot summaries serve different purposes.
Respect traversal limits
Workspace state snapshots accept directories, regular files, and symlinks. FIFOs, sockets, devices, disappearing entries, and type changes fail closed without blocking on special files. Each traversal is limited to 250,000 entries, 4 GiB of regular-file data, and 30 seconds; hashing checks for cancellation.
Snapshot traversal
These limits bound a single traversal.
Preview and clean managed caches
Preview cleanup first. The confirmed cleanup removes managed cache folders only after the run has ended, related processes are inactive, and saved records agree; otherwise it leaves the workspace and explains why.
Temporary Git data is removed only if it still exactly matches what Crewplane recorded. Changed or unrelated data stays. Saved .crewplane/ run history and results, including lineage, bundles, output, findings, manifests, branch export records, and final results, are never removed by workspace cleanup.
crewplane cleanup workspaces --dry-runcrewplane cleanup workspaces --yes Cleanup checks
The dry-run command makes no cleanup changes.
Hover or focus a node to preview its explanation; click to keep it.Tap a node to select its explanation.
- Preview → Verify
- Verify → Cleanup
Inspect cleanup candidates
A dry run lists matching managed cache paths without deleting them. Check the project scope and listed paths before asking Crewplane to remove cache data.
Check whether removal is safe
Crewplane checks that the run has ended, related processes are inactive, and saved workspace records agree. A candidate that cannot be verified is left in place with an explanation.
Remove eligible cache data
Confirmed cleanup removes eligible managed cache folders and verified temporary Git data. Canonical run history and results under .crewplane/, including lineage and bundles, remain available.