From your codeNeeds a repository

Hand off a long task

A run you pick up later

Start a long run from your code, walk away, and pick it up where it left off with a follow-up or from the console.

View .md

Best for

  • Engineers who start long work and want it to keep going without them
  • Long tasks you do not want to babysit

Uses

  • An API key
  • A connected GitHub repository

From your code

POST /o/{org}/sessions
Request body
{
  "agent": "claude",
  "input": "Set up the dev environment and get the e2e tests passing.",
  "resources": [
    {
      "url": "https://github.com/acme/web"
    }
  ]
}
Nothing is sent: the button shows the 202 Accepted this request returns.
Fig. The request. Field names are the API's; the values are an example.

Watch it work, then read what comes back

GET /o/{org}/sessions/{session}/events
event: tool_usebash · bun install
event: tool_usebash · bun run test:e2e
event: tool_result3 failed, 41 passed
event: messageTwo failures were a missing env var; one is a real bug.
Fig. The live stream while it works. Event names are the stream's.
GET /o/{org}/sessions/{session}
status
paused
result
41 of 44 e2e tests pass; one real bug found
Fig. The session when it ends. Field names are the API's.

Steps

  1. 01

    Start it

    POST /o/{org}/sessions answers at once with the run's id. A run keeps its computer between turns, so you can write to it later.

  2. 02

    Walk away

    The run keeps going in the cloud. When the turn ends, the sandbox parks with its disk and memory and costs nothing while parked.

  3. 03

    Pick it back up

    GET /o/{org}/p/_/sessions/{id} reads where it got to, POST …/sessions/{id}/messages sends a follow-up and wakes it, and the console shows the same run.

In the API and the docs