# How to keep coding agents running when the window closes

Keeping agents running when the window closes means their work doesn't depend on the window you
watch it in. An agent run in a terminal stops when that terminal closes, unless you run it under a
tool such as tmux. Moontors, an agentic development environment (ADE), runs every session in a
background service instead, so closing the window doesn't stop the agents.

## Close the window

Start your sessions, then close the window. The sessions keep working in the background service,
on every system. Whether Moontors' notifications still arrive with the window closed depends on
your system; see [Notifications](/docs/sessions-and-board/#notifications).

Open Moontors again and every session is there, with everything it did while you were away.

## When the background service stops

The background service exits when no window is open, no session is running or waiting for you,
and no [terminal](/docs/terminal/) is running. The sessions themselves stay: the next prompt starts
the agent again in the same conversation.

## What still stops an agent

- Sleep: Moontors doesn't keep your computer awake. While it sleeps, the agents can't work, and
  a turn under way can fail when its connection drops. If agents should work while you're away,
  keep the computer awake with your system's own power settings.
- Restarting or logging out: the background service stops with your session on the computer.
  A turn that was running shows as **Stopped**, and the next prompt carries the conversation on.
- An update: **Restart to update** waits until running work ends, so it never cuts a turn
  off. Terminals still running end with the restart, and Moontors says how many before it
  restarts. See [Sessions and the board](/docs/sessions-and-board/).

## Know when to come back

Moontors sends a desktop notification when a session needs you, as [Notifications](/docs/sessions-and-board/#notifications) describes.
While a session waits, its agent waits too, so answer it to keep the work going.

Away from your computer, [the phone](/docs/phone/) shows the board and each session, and answers
what a session asks, on the same Wi-Fi as your computer or through your VPN.

## Questions

### Do the agents keep running when I quit Moontors?

Yes. A background service runs the sessions, so quitting the app or closing its window doesn't stop
them.

### Do they keep running while my computer sleeps?

No. Moontors doesn't keep your computer awake, so if agents should work while you're away, keep it
awake with your system's own power settings.

### Will I hear when a session needs me with the window closed?

On macOS, yes; on Windows and Linux, not until you open Moontors again, as
[Notifications](/docs/sessions-and-board/#notifications) says. The sessions keep working either way.

## Related

- [What is an agentic development environment (ADE)?](/docs/what-is-an-ade/)
- [The phone](/docs/phone/)
- [How to run several Claude Code sessions in parallel](/docs/how-to/run-claude-code-sessions-in-parallel/)
- [A Conductor alternative for Windows and Linux](/docs/compare/conductor/)
- [An Emdash alternative with Gemini CLI and a background service](/docs/compare/emdash/)