> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sense-lab.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Hand work off at your limit

> Two ways to keep going when your coding agent's plan or your machine is full: extra sessions on Sensei, and tasks handed to runs.

A coding agent stops at one of two limits. The plan runs out of allowance, or the machine cannot carry another agent. They need different answers.

| The limit you reached | Extra sessions on Sensei | Tasks handed to runs |
| - | - | - |
| Your plan's allowance | Helps. The session is paid from your Sensei credits. | Helps |
| Your machine | Does not help. The session still works on your machine. | Helps. Each task works on its own computer on Sensei's side. |

Sensei does not extend a Claude or ChatGPT plan. A session signed in with a plan does not pass through Sensei, so Sensei cannot see its limit or add to it.

## Open an extra session on Sensei

Keep your usual command as it is and add a second one that points at Sensei.

> [tab] Claude Code
>
> ```bash theme={null}
> alias sensei-code='ANTHROPIC_BASE_URL=https://models.sense-lab.ai \
>   ANTHROPIC_AUTH_TOKEN=amfs_... \
>   ANTHROPIC_MODEL=Sensei claude'
> ```
>
> `claude` uses your plan. `sensei-code` uses your Sensei credits.

> [tab] Codex
>
> ```bash theme={null}
> export SENSELAB_API_KEY=amfs_...
> codex --profile sensei
> ```
>
> The profile is set up once in `~/.codex/config.toml`. See [Connect your tool](https://docs.sense-lab.ai/sensei/connect-your-tool.md).

A new session starts without the conversation you had in the other one. Say the task again, or point the session at the file or the issue that describes it. It does start with the project's [Learnings](https://docs.sense-lab.ai/sensei/learnings.md).

## Hand a task to a run

A run takes a repository and a task, works in a sandbox, runs the repository's tests before and after the change and opens a pull request that says what the tests showed. Your machine does none of it.

### Set it up once

1. Connect the repository with a token that can push and open pull requests. See [Work on a repository](https://docs.sense-lab.ai/sensei/runs/repository-runs.md#connect-the-repository).
2. Add the runs server to your coding agent.

> [tab] Claude Code
>
> ```bash theme={null}
> claude mcp add --transport http sensei-runs https://runs.sense-lab.ai/mcp/ \
>   --header "Authorization: Bearer amfs_..."
> ```

> [tab] Codex
>
> ```bash theme={null}
> export SENSELAB_API_KEY=amfs_...
> codex mcp add sensei-runs --url https://runs.sense-lab.ai/mcp/ \
>   --bearer-token-env-var SENSELAB_API_KEY
> ```

> [tab] Cursor
>
> Add this to `~/.cursor/mcp.json`:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "sensei-runs": {
>       "url": "https://runs.sense-lab.ai/mcp/",
>       "headers": { "Authorization": "Bearer amfs_..." }
>     }
>   }
> }
> ```

The key in the header is the key your runs start with, so its [routing rule](https://docs.sense-lab.ai/sensei/runs/models.md) decides which model does them. Give the server a key whose rule sends runs where you want them.

### Hand off

Push the branch you are on, then ask in chat:

```
Hand this to Sensei: remove the unused feature flags in billing/. Start from my branch.
```

The agent calls `run_start` with the repository, the branch and the task. It answers with the run's address and goes back to what it was doing. Ask it for the result later, or open **Runs** on the dashboard.

> [!NOTE]
>
> A run starts from what is pushed. Work that is only in your working tree is not part of it.

### Tell your agent which tasks to hand off

Put this in `AGENTS.md` for Codex and Cursor, or in `CLAUDE.md` for Claude Code:

```markdown theme={null}
## Handing work to Sensei runs

When I ask you to hand a task to Sensei, start it with the `run_start` tool of
`sensei-runs`. Do not do the task yourself.

Hand off: chores, documentation, a failing build or CI check, a contained
refactor. The task must stand on its own and have tests that show it worked.

Keep here: work that needs my decisions as it goes, and work that depends on
changes that are not pushed.

For each task:
1. Push the branch first. A run starts from what is pushed.
2. Call `run_start` with `repo`, `ref` (the branch) and `task`. Write the task
   so it can be done without this conversation: the files, the behaviour
   wanted, and how to check it.
3. Give me the run's address and carry on. Do not wait for the run.
4. When I ask, read it with `run_status`. Show me the verdict, what the run
   was not sure about and the pull request as they are.

Several tasks on one repository go as one batch: call `batch_start` with
`repo`, `ref` and `tasks`, one entry for each change. Ask me for a spending
limit first. Sensei tests the changes together, and each pull request says how
it fits with the rest.

No more than 20 runs queued or running at once. A batch counts as one.
```

## What comes back

Each task comes back as a pull request with a verdict.

| Verdict | Meaning |
| - | - |
| Verified | The tests pass after the change |
| Failed | A test that passed before now fails, or a lint or format check from your CI does |
| Not verified | Nothing showed the change works: no change was made, the tests did not finish, or the same tests fail before and after |

The pull request is still yours to read and merge. See [Review a run](https://docs.sense-lab.ai/sensei/runs/review.md).

## What a run can and cannot do

| Limit | Detail |
| - | - |
| Services | A run starts the services the repository declares, up to 6, each with 1 CPU and 2 GB of memory. See [Services, settings and secrets](https://docs.sense-lab.ai/sensei/runs/services-and-settings.md). |
| Runs at once | 20 queued or running for an account, and 12 working at the same moment. The others wait their turn. |
| A single command | 10 minutes. A test suite that takes longer is cut off. |
| Tasks together | Each run works alone. Two runs that change the same lines give two pull requests that conflict. Started as one [batch](https://docs.sense-lab.ai/sensei/runs/batches.md), the changes are tested together and each pull request says what it collides with. |

## What it costs

| Way | Cost |
| - | - |
| An extra session on Sensei | Tokens at the rates on [Usage and cost](https://docs.sense-lab.ai/sensei/usage-and-cost.md#rates) |
| A run | The same token rates, $0.005 a minute for its computer and $0.0025 a minute for each service beside it. A run stops at its spend limit, \$5 unless you set another. |

See [Limits and cost](https://docs.sense-lab.ai/sensei/runs/limits.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.