# Crew background sessions: agents that outlive Edith

> Crew background sessions keep the agents engine running on its own, so coding agents survive Edith quitting, updating or crashing and start again at login.

- Canonical URL: https://getedith.pro/docs/agents/crew/background
- Updated: 2026-12-03

Every Crew agent runs inside the agents engine. With background sessions on, Edith hands each engine session to launchd, so the engine keeps running when Edith quits, updates or crashes. It also starts again when you log in.

## Turn background sessions on or off

Background sessions are on by default, so there is nothing to set up: start an agent with **New agent** and it keeps running after you quit Edith. Open the Crew page again later and your agents are still on the board.

To check them or turn them off, use the terminal:

```sh
ed crew background
ed crew background off
ed crew background on
```

`ed crew background` shows whether background sessions are on, and which sessions have a launchd job.

| Command                      | What it does                                                                                                                        |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `status`                     | Show whether background sessions are on and which sessions run under launchd                                                        |
| `on`                         | The next session Edith starts runs under launchd                                                                                    |
| `off`                        | Stop running new sessions in the background and remove the session jobs. Running sessions keep going until you stop them or log out |
| `start [--session <name>]`   | Hand one session to launchd now and wait for its server                                                                             |
| `restart [--session <name>]` | Restart a session so it runs the engine this copy of Edith ships                                                                    |
| `repair [--session <name>]`  | Fix a session whose login job is out of date, unloaded, disabled or stopped                                                         |

Without `--session`, these use the default session. See [`ed crew background`](https://getedith.pro/docs/agents/crew/cli/background) for the JSON output.

## How a session runs

Each session gets one LaunchAgent in `~/Library/LaunchAgents`. The job:

- runs `~/.edith/agents/bin/edith-agents server` on its own, separate from Edith
- starts again at login and after a crash, but stays stopped after `edith-agents server stop`
- exits at once when that session's engine is already running
- starts login shells for panes, so agents see your full environment
- shows under Edith in **System Settings > General > Login Items**

## What survives a restart

When the engine restarts, for example after a reboot, it reopens every workspace, tab and pane it had, in the same folders. It resumes the agents it knows a conversation id for, such as `claude --resume <id>` or `codex resume <id>`. Running processes themselves cannot survive a reboot.

For threads, **Continue threads after a restart** under **Thread engine** in **Agent launch settings** (**Filter** > **Edit launch settings** on the Crew page) resumes turns that were running when the engine stopped.

## Restart after an update

After you update Edith, a running session can keep the engine it started with. `edith-agents status` shows whether a restart is needed because the engine binary changed.

```sh
ed crew background restart
ed crew background repair
```

`restart` stops and starts the session's login job. Shells and agents in that session restart and resume where they can. `repair` reinstalls a job set up for another engine version, or restarts one that is stopped or runs an older engine, and leaves a healthy session alone.

## If macOS refuses the job

The usual cause is Edith being switched off in **System Settings > General > Login Items**. Turn Edith back on there. Until you do, `ed crew background` reports the error, and Edith falls back to starting the engine detached. That engine still keeps running after Edith quits, but it does not start again at login.

`start` leaves a session that is already running alone. Its JSON reports `managed: false` when that engine was started outside launchd, for example by `edith-agents server --detach`. To move it under launchd:

```sh
edith-agents --session work server stop
ed crew background start --session work
```

## Give agents environment variables

The engine reads `KEY=VALUE` lines from `service.env` in its home and gives them to every shell and agent it starts, also when it starts at login.

```sh
ed crew background env
ed crew background env set OPENAI_BASE_URL=https://proxy.example.test
ed crew background env set FOO=1 BAR="two words"
ed crew background env ls --values
ed crew background env unset OPENAI_BASE_URL
```

Values are taken literally. `PATH` and the engine's own variables are managed by the engine and ignored. A change reaches new shells and agents at once; ones already running keep the value they started with. `ls --values` prints the values too, which can hold keys and tokens. Add `--machine box` to change a machine's engine.

## On other machines

Machines have no launchd job. The engine starts detached the first time an agent starts there. On Linux, `edith-agents service install --linger` adds a systemd user unit that starts it at login. See [Remote machines](https://getedith.pro/docs/agents/crew/remote-machines).

## Exit codes

`ed crew background` exits 4 when Crew is not running, background sessions are off, the engine is missing, or macOS refused the job.

## Where to go next

- [The agents engine](https://getedith.pro/docs/agents/crew/engine)
- [Local environment](https://getedith.pro/docs/agents/crew/local-environment)
- [`ed crew background`](https://getedith.pro/docs/agents/crew/cli/background)

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
