# Reminders

> Send a prompt to a session at a set time, once or on a repeat, from the apps, the agent or an extension.

A reminder sends a prompt to a session at a set time. It can fire once ("check the deploy in 20 minutes") or on a repeat ("every weekday at 9:00, triage new issues"). When it fires, the prompt arrives in the session as a new message and starts a run. If the session is busy, the prompt waits behind the current run.

You set reminders in the desktop app, the web app and the terminal app. The agent can set them for its own session, and extensions can set their own. In the code they are called schedules.

## Turn them on

Reminders are off by default. Two settings control them:

| Setting | Key | Does |
| - | - | - |
| **Reminders** | `schedules` | Turns reminders on. While it is off, no reminder fires, and the apps hide the Reminders tab, the badge and the filter. |
| **Agent can set reminders** | `schedulesAgent` | Gives the agent the `schedule` tool. On by default, but it needs Reminders on. |

In the desktop and web apps, they are under Settings › General › Sessions. In the terminal app, they are under Settings › Sessions.

## Time words

You type when a reminder fires in plain words. The app reads them in your own time zone and sends the host an exact time.

| You type | Fires |
| - | - |
| `in 20s`, `in 20m`, `in 2h`, `in 1d` | Once, after that long. `sec`, `min`, `hour` and `day` work too. |
| `at 9:00`, `at 21:30`, `at 9` | Once, today at that time, or tomorrow when the time has passed |
| `tomorrow 9:00` | Once, tomorrow at that time |
| `every 30m`, `every 2h` | On a repeat, from now |
| `daily 9:00` | Every day at that time |
| `weekdays 9:00` | Monday to Friday at that time |
| `cron "0 9 * * 1-5"` | On a five-field cron expression, in your time zone |

A repeat is at least one minute apart.

## In the desktop and web apps

The **Reminders** tab in the side panel lists the reminders of the session on screen. Switch to **All** to see the reminders of every session. Each row shows the reminder's name, when it fires, its next time, and who set it: you, the agent or an extension.

- Add a reminder at the bottom of the tab: type when it fires and the message. The tab shows when it will send before you add it.
- Pause and resume a reminder, run it now, or delete it. Running it now does not move its next time.
- Open a reminder's history to see each time it fired and how that went: sent, queued behind a run, skipped or failed.
- A repeat that the agent set shows when it stops. Click its pin button to keep it for good.

While the session has reminders that will fire, the composer shows a badge with their count and the next time, for example `Next 09:00`. Click it to open the Reminders tab.

A session that a reminder started shows a clock mark in the sidebar. With Reminders on, the sidebar's filter menu has an **Origin** row: All, Scheduled or Not scheduled.

In the desktop app, the tab shows for the sessions on this computer. In the web app, it shows for the server's sessions.

## In the terminal app

| Command | Does |
| - | - |
| `/remind <when> <prompt>` | Sends the prompt to this session later. `/remind in 20m check the deploy` |
| `/schedule` | Lists the reminders of this session |
| `/schedule all` | Lists every reminder |
| `/schedule <when> <prompt>` | The same as `/remind` |
| `/schedule rm <id>` | Deletes a reminder |
| `/schedule pause <id>`, `/schedule resume <id>` | Pauses or resumes a reminder |
| `/schedule run <id>` | Runs a reminder now |
| `/schedule keep <id>` | Keeps a repeat that the agent set, so it does not stop after 7 days |

The lists show the start of each id. The start is enough to name a reminder, as long as no other id starts the same way.

The footer shows the next reminder of the session, for example `◷ reminder 09:00`. It is hidden while Reminders is off, and when the session has none.

## The agent's schedule tool

With both settings on, the agent has a `schedule` tool. It uses it to come back to something later: check the CI in 20 minutes, run a flaky check every hour, write a summary every morning. Ask it in plain words: "remind yourself to check the deploy in 20 minutes".

The tool has limits:

- The agent can only send prompts to its own session.
- It can have at most 10 active reminders per session.
- Its repeats are at least 5 minutes apart.
- Its repeats stop after 7 days, unless you keep them (the pin button in the tab, `/schedule keep <id>` in the terminal).
- Subagents cannot set reminders. They return what to schedule to their parent agent.

The agent can list the reminders of its session and cancel the ones it set.

## Missed reminders

A reminder fires only while a host runs (see [below](#where-they-run)). When the host was down at the time:

- A missed one-time reminder arrives late, once, when the host starts again. Its history marks it late.
- A missed repeat is skipped. It fires again at its next time.

If a reminder fires while an earlier fire of it still waits behind a run, the two join into one message.

## Where they run

The host that keeps a session keeps its reminders: the desktop app, the [daemon](https://zidane.si/docs/daemon.md) or a [server](https://zidane.si/docs/server.md). A reminder fires while that host runs. The daemon does not stop on idle while a reminder is pending, so it stays up to fire it. A server runs all the time, so its reminders fire with no window open.

## On the wire

| Method or field | Carries |
| - | - |
| `schedules.status` | `{ enabled, supported }`: whether Reminders is on and the host keeps reminders |
| `schedules.list`, `.create`, `.update`, `.delete`, `.runNow`, `.fires` | Read and change reminders. Each one rejects while Reminders is off. |
| `schedules:changed` | A signal: a reminder was added, changed, removed or fired |
| `SessionRow.scheduleId` | On a session that a reminder started: the reminder's id. The sidebar's clock mark and Origin filter read it. It is stored on the session as `metadata.scheduleId`. |

## Related

- [Extension schedules](https://zidane.si/docs/extensions-schedules.md): `ctx.schedules`, for reminders an extension sets
- [Session panels](https://zidane.si/docs/ui-session.md#reminders): the Reminders panel in your own app
- [Daemon](https://zidane.si/docs/daemon.md)
