Skip to main content
There is no scheduler to register with, no cron screen, and no “run every” field. When you ask for something on a timer, the agent writes a program that is the timer, and starts it on your machine.
That ask produced version 3 of the harness this documentation was written from — Add nightly briefing program — and a file on the machine the next morning:

What the agent builds

A loop that wakes often and asks a question about the calendar. The question is the whole design:
state["last"] is the last date it actually ran, written to a file on the machine. So the loop is not counting hours since it started — it is asking whether today’s has been done. Three consequences, and they are the difference between a job that runs once a day and a job that runs whenever the process happened to be restarted:
  • A machine that was off at 07:00 runs the briefing the moment it comes back.
  • A machine restarted three times before noon runs it once.
  • The loop’s own sleep interval does not have to be exact. The one above sleeps five minutes at a time.

What to say

The time, and which clock. The machine’s clock is UTC — date and date -u give the same answer on it — so “every morning at 7” becomes 07:00 UTC unless you say otherwise. If you are in Berlin and mean 7 your time, say so; the agent can do the arithmetic, but only if it knows there is arithmetic to do. Where the result should go. This is the part people leave out. “Write it to a file”, “mail it to me at …”, “put it in the notes” are all different programs. The example above writes a file, which is the cheapest option and the one you have to go and look at. Ask for mail if you want to be told. What it should read. A schedule is only as good as its input. “Read /home/daytona/expenses.csv” is a job; “summarise what happened” is not, unless the agent already knows where “what happened” lives. That it should survive a restart. Say “make restarting it harmless” and you get the state file above. Without it, a restarted loop can run the job twice in one day.

What “started” means, and how it ends

The agent starts the program the ordinary way, in its sandbox:
It then keeps running after that turn, after that chat, and into tomorrow. It stops when the machine stops — somebody presses Stop, or a free plan’s machine goes idle for 30 minutes — and it does not come back on its own when the machine does. That last sentence is worth taking literally. On the account above, the machine was stopped for a few hours and started again. Afterwards:
Files survive a stop; processes do not. Nothing restarts a program for you, so after a machine has been stopped, “start the nightly job again” is a sentence somebody has to say. It is one turn, and it is a reasonable thing to ask the agent to check at the top of a conversation.
On a paid plan the machine has no idle timeout — it runs until somebody stops it — so in practice this comes up after a deliberate stop or a restart rather than on its own. Plans has the per-plan detail.

Checking it

The state file says when it last ran. On the machine:
The log says what it did, one line per firing:
The output is the real check. A schedule that writes a file is checked by the file being there and being right. Ask the agent to read it back to you. Each firing is a run. When the loop hands work to an agent, that is a real run: it appears in your chat list with its whole conversation, and it is billed like any other. So a job that fires daily has a daily entry you can open and read — and a job that has quietly stopped has an obvious gap. Any of these is a sentence in the chat: “when did the briefing last run?” is answered by the agent reading its own state file.

Changing it and stopping it

A change to the program’s code needs the loop restarted to take effect — it is a running Python process, not a file the platform re-reads. The agent knows that; if you change something and nothing happens the next morning, “did you restart it?” is the question.

Have it reach you

The same shape, triggered by a message arriving instead of by the clock.

A nightly job, end to end

The whole conversation, from the ask to the first morning it fired.