Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Workspace lifecycle

A workspace lives in the cloud. Machines attach to it to run commands, terminals and services on a copy of its working tree, and detach again without closing it. This page covers creating a workspace, attaching machines, services, and archiving.
How a project prepares its machines depends on whether it has moved to the Environment model:
Selecting a project or workspace does not run setup. A new workspace waits for its first message.

Create a workspace

Workspace creation, ordinary Git source resolution, archive, and restore run in the cloud without an attached machine. A new workspace uses its saved phase, including after its runtime reopens. Phase changes and approved plans update that saved phase, subject to the phase rule.
Sources can name the project base branch, an imported branch or commit, another workspace's committed HEAD, a tag, or a pull-request head. Missing public branch, tag and pull-request refs are fetched from the canonical HTTPS origin into the project's Artifacts repository before the workspace forks it. Existing refs are reused without fetching the origin again. Annotated tags are resolved to their commits. This fetch sends no account credentials to the origin and does not follow redirects: use the final repository-root URL. Ref advertisements are limited to 64 KiB, Git packs to 40 MiB, and each fetch to 15 seconds. Git protocol v2 discovery uses ls-refs with the requested full ref as its prefix to avoid unrelated refs; v0-only origins must fit their full advertisement within the same limit. Missing or unadvertised refs fail explicitly rather than falling back to the base branch. For a private origin, the import runs through a machine that holds the project's base workspace, so one must be online.
Public-source imports negotiate from up to 32 commits already held in the project's default-branch history, rather than downloading that history again. The same negotiation uses the destination's previous commit when copying into a workspace fork. The 40 MiB transfer limit is unchanged: the origin sends the missing reachable objects, with no shallow-history truncation or thin-pack dependency. If the origin shares none of the offered commits, it sends the full graph within the same limit.
In a project with several repositories, choose which ones the workspace checks out. See Multi-repository projects.
Changing a project's base branch, under Project settings › Repositories with your passkey, switches its base workspace to that branch as well as its saved branch and source commit. If the branch is absent from the cloud repository, the same bounded public-origin import resolves and caches it first. Other workspaces keep their branches. If the change fails partway, the failure is reported; repeating the same change finishes it.

Machines and the Environment panel

The workspace header's Environment chip opens Inspector › Environment. It has these sections:
SectionShows
OverviewThe workspace's setup at a glance, and About this setup.
MachinesEach attached machine, with Attach machine. Each machine's menu has Open terminal, Run checks and Detach.
SetupFor the chosen machine: its setup results, each step's Logs, and Run setup again.
ValuesThe secrets and values the workspace uses, by name only, with links to where they are set.
Cleared shellsOpen cleared shells, with Drop, and Open a cleared shell.
Asked of youValues the project asks you for, with Open My secrets.
It also holds the workspace's Browser access and Signed callers approvals.
You attach a machine with Attach machine. An agent attaches one itself when it first needs it, on machines whose Agents may attach switch is on (the default) under Settings › Machines. A personal machine joins only workspaces its owner holds. GitSpace doesn't place a project's work on a machine where one of its machine profiles is declined or not yet approved, and prefers machines that are ready for more of them.

Sync

Each attached machine holds a copy of the workspace's cloud working tree. Changes flow both ways:
  • A machine's changes are a diff against the state it last synced from. The cloud merges them three ways, so a machine can't delete a file the cloud added after that point.
  • Changes to the same file on both sides are a sync conflict. Sync conflicts lists them: choose Keep cloud or Keep machine. The other version is backed up first.
  • Sync now syncs at once; Show unsent changes lists what the machine hasn't sent yet.
  • A failed sync retries after 5 seconds, then less often, up to every 5 minutes. The agent is told about conflicts.
Nothing is lost without a backup: discarding a machine's unsent changes, or resolving a conflict, first saves the version you didn't keep. Agents use their sync tool to check status, sync, diff, discard, restore a backup, or resolve a conflict.

Terminals and commands

Terminals open on a machine you choose, from its menu in Machines, in that machine's copy of the workspace. With no machine attached, the panel offers to attach one. Agent commands run on an attached machine; a command whose machine disconnects keeps running there, and its result is returned when the machine reconnects.
Commands, services and terminals take their PATH additions and plain environment variables from the project's Environment Command environment, or, for projects without a revision, from the repository's .gitspace/bundle.json terminal section.
Stopping a command requests native cancellation and observes its completion. Losing a connection does not prove that a command stopped: a disconnected machine may still be running it.

Services

Declare long-running services in .gitspace/services.json, with a name, command, arguments, working directory, environment, and named ports. GitSpace assigns stable ports and runs them through the machine supervisor. Inspector › Services starts and stops them and opens each service and its logs. Each http port gets a workspace URL that only approved browsers and signed callers reach.
For processes of their own, agents use the proc tool. See Agent workflow.

Release, archive and delete

Release machine caches, in a workspace's sidebar menu, asks each attached machine to detach. It keeps the cloud workspace and its conversations; attach a machine again whenever you need one. Detach in Machines releases one machine.
Archive stops the workspace's agents and asks its machines to detach. Each machine that held its checkout removes it once everything in it has synced: its HEAD, branch, staged and working files match what the cloud last received, it has no stash, and every other local branch is part of HEAD or pushed to its remote branch. A checkout with unsent work stays on the machine. Restore reactivates an archived workspace in the cloud without an online machine; it is checked out again on the next machine that needs it. Archiving a workspace in a stack reorganizes the stack.
Delete always works, whatever state the workspace is in, including a creation that never finished.
Releasing, archiving and deleting never destroy cloud resources a workspace created.
Pi conversation state lives in the cloud, not in the checkout. A fresh copy on a machine recreates local state. Do not rely on files left behind on a previous machine, even when you return to it.
StateWhat a fresh machine copy has
Git commits and branch; staged and unstaged tracked changesSynced from the cloud working tree
Non-ignored untracked filesSynced from the cloud working tree
Pi agent conversationKept in cloud runtime storage
Drive files (drive://)Kept separately from the code repository, in encrypted storage
Environment revisions, approvals, values, run records and logsKept in the cloud, outside the checkout
Ignored .env, node_modules, caches, build outputNot synced; recreate them on the machine
Machine packages and arbitrary home-directory filesNot workspace state; prepare them again where needed
Remote resourcesRemain until someone destroys them
A machine copy is not a disk backup. If you keep a database only in an ignored local file, releasing the machine can lose it. Use durable remote storage or an explicit export that sync captures. Never export secrets into tracked or non-ignored files.
After an unexpected interruption, an interrupted cloud command may have taken effect without reporting success. Inspect the provider before repeating it. Cloud conversation recovery does not restart an unresolved shell command or script.

Legacy: the repository lifecycle

This section applies to projects that haven't saved an Environment revision yet, and to workspaces that still hold cloud resources a cloud/provision script recorded. Once a project saves its first revision, only its machine profiles' checks and setup run; see What changes with the first revision.
A legacy project describes its setup in the repository: .gitspace/bundle.json and ordered scripts under .gitspace/lifecycle/<phase>/. See the lifecycle reference for the file formats.
When a machine attaches, it runs the approved machine/prepare, checks and workspace/materialize scripts in that order, each step within 30 minutes. A step whose content isn't approved shows Needs approval and waits. A failed step is recorded; it never blocks the workspace. cloud/provision and cloud/destroy run only when someone asks.

Configure a repository

  1. Open the workspace and ask: Use the workspace-lifecycle skill to inspect this repository and propose its lifecycle configuration. Do not edit or execute yet. With no setup scripts yet, Configure with agent in Inspector › Environment sends that request.
  2. Review the proposal. It should name the files to change, required tools, profiles, secret names, existing resource IDs, costs, and any cloud effects.
  3. Approve the repository edits. The agent can now write the agreed configuration and check its syntax. This does not authorize installs, repository checks, provisioning, or teardown.
  4. Review the final diff and the Environment panel. Choose the Runtime profile and provide non-secret values. Put credentials in the project's secrets, not the repository or lifecycle bindings.
  5. Approve the exact check and script content: Review & approve shows a script's content, then Approve for the project or Only this workspace. Approving needs Approve environment requests in your project role. When an agent's run needs approval, an approval card in its chat shows the script and its changes since the last approved version.
  6. Inspect the recorded run and its logs. If it fails, repair the failing step. Do not assume failure means no resource was created.
The skill ships through the existing Skills system and defaults to project and workspace agents. Account skill settings can disable it or change its assignment.
Content approval allows repository code to run as the machine user, using that user's home configuration and available credentials. GitSpace keeps the user's tool search path and prepends its managed tools directory. This is not a sandbox: secret grants control injected secrets, not every credential on the machine. Review helper scripts and package install hooks as well as lifecycle entry scripts. Neither content hashes nor log redaction protect against all behavior of code you authorize.

Split work by what survives

PhasePut this work hereDo not put this work here
cloud/provisionCreate or adopt resources owned by the durable workspaceDependency installation in the current checkout
machine/preparePrepare tools needed on this machineWorkspace-specific generated files
workspace/materializeInstall checkout dependencies and rebuild local configurationCreating a second cloud stack on each arrival
workspace/dematerializeFlush local state and release local leases before leavingDeleting remote databases, buckets, or deployments
cloud/destroyDelete recorded workspace-owned resources when the person retires them, in Environment or by asking the workspace's agentCleanup on selection, close, or move
Lifecycle scripts should finish, not leave unmanaged background processes; declare long-running work as services. GitSpace does not run workspace/dematerialize yet, so a machine keeps an archived workspace's checkout that declares it.
A successful cloud provision belongs to the workspace, not a checkout. Moving or editing a script does not provision it again. A direct workspace/materialize request runs local reconstruction only; it never creates or adopts cloud resources first. If a materialization script requires recorded ownership bindings, establish them through approved cloud/provision or adoption before materializing. Do not copy another workspace's bindings to make setup pass.
To retire a workspace's recorded cloud resources, choose Retire… in the Environment panel and confirm Retire resources. If the original machine is gone, attach another machine first. A failed destruction keeps the recorded bindings for recovery.

Interactive scripts

Prefer setup that runs unattended. A script that needs a person, for example to sign in to a provider, declares # gitspace: interactive in its leading comment header and shows an Interactive badge. Runs without a terminal skip it. Run in terminal runs the approved phase in a protected terminal; the panel shows Running in terminal with Open terminal and Cancel. Agents can't run scripts interactively. See the interactive script reference.
Input echo is disabled, and raw terminal input and output stay out of persistent logs and replay. Approved scripts may write credentials into protected, ignored local files. Those files are not synced: expect to authenticate again on another machine or after a session expires. Inference-provider login uses the cloud credential vault instead.
On a project that has moved to Environment, an approved script that declares prompts asks for codes, passwords and sign-in links through GitSpace's secure-input page instead.

Recover a failed setup

Open Inspector › Environment and read the step's result and Logs. The log opens one script's output at a time; scroll down to load more, or Copy script log to copy all of it. A later script failure does not change an earlier script's successful result.
For local failures, fix the configuration, review changed content, approve it, and run the step again. For cloud failures, first inspect the bindings and provider state. Scripts should record each resource ID as soon as the provider returns it, including when a later step fails. A failed provision rerun does not erase the previous successful provision.

Migrate old hooks

Old pre, setup, select, and remove hooks are not aliases for lifecycle phases and do not run. Ask the skill to inventory each command and propose a split:
  • Move cloud creation out of setup into cloud/provision.
  • Move machine tools into machine/prepare.
  • Move checkout-local work from pre, setup, or select into ordered workspace/materialize scripts.
  • Move only local flush or lease-release work into workspace/dematerialize.
  • Move remote deletion from remove into cloud/destroy. Never map it to dematerialization: that would delete resources on every move.

Move to Environment

Open Project settings › Environment. GitSpace proposes a revision from the repository's AGENTS.md, CLAUDE.md and .gitspace/ files: Instructions, browser origins, the terminal section and service routes. It lists checks, setup scripts, values and secret names as suggestions. Add machine profiles for the checks and setup, give the project's secrets their rules, and ask agents to submit approved scripts for anything that needs a secret. Approving the proposal, or saving any revision, moves the project. See Import from the repository.