# Hand off a long task

Returns: A run you pick up later. Starts: from your code.

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.

## 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

## The request

`POST /o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Set up the dev environment and get the e2e tests passing.",
  "resources": [
    {
      "url": "https://github.com/acme/web"
    }
  ]
}
```

## While it works

Live stream events (`GET /o/{org}/sessions/{session}/events`):

- `tool_use`: bash · bun install
- `tool_use`: bash · bun run test:e2e
- `tool_result`: 3 failed, 41 passed
- `message`: Two failures were a missing env var; one is a real bug.

## What comes back

- `status`: paused
- `result`: 41 of 44 e2e tests pass; one real bug found

## Steps

1. **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. **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. **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.

Field names are the API's; the values are an example.
