A recurring chore
An agent that should look after something regularly (CI on main, dependency updates, a nightly report) needs no cron daemon or loop of its own: it schedules a message to itself, and the platform delivers it on time, also when the agent’s session ended or the machine was suspended.
1. Write the chore as a message to a later you
The firing arrives without the context of today’s conversation. Say what to do, where, and when it is done, as you would to a colleague:
space-env schedule cron "*/30 * * * *" --context ci-watch --qos notify --text "Look at the latest CI pipeline on main. If it is red, find the failing job, fix it on a branch ci-fix-<date>, push and send parent a reply with the branch. If it is green, do nothing."--qos notify resumes the machine if it is suspended when the schedule fires; without it the message
waits until the machine runs. Times are UTC.
2. Tell the agent what the firings are
Put this in the agent’s instructions (its CLAUDE.md):
Messages from "schedule" with context ci-watch are your recurring CI check. When one
arrives, receive it with: space-env receive --context ci-watch --timeout 0
Do what it says, then go back to what you were doing.With --qos notify, a notice is typed into the agent’s session as soon as a firing
arrives (with the default QoS, after it waited a few seconds); the agent receives it when
it reaches a good point in what it is doing.
3. Check and stop
space-env schedule list
space-env schedule cancel 5f0c2a8e-3b1d-4c7a-9e2f-6a8b0c1d2e3flist shows when each schedule fires next and how often it has fired. A schedule goes
away with its machine.
Tips
- One schedule per chore, each with its own
--context, so the agent can tell them apart. - Keep the interval as long as the chore allows: each firing is a turn of the agent (and,
with
notify, a resume you pay for). - For a one-off reminder,
space-env schedule at +2h --text "…"instead.