Skip to main content

Scheduled Tasks

/schedule saves a prompt to run at a time you pick — once, or again and again. A small scheduler runs in the background on your machine, starts again when you log in, and launches each task when it is due — AdaL does not have to be open.

This is different from /cron: cron repeats a prompt inside the chat you are sitting in and stops when you quit. A scheduled task runs in its own session, whether or not you are there.

/schedule works in the terminal and in AdaL Desktop. It is not offered in the web chat, which cannot install a service on your machine.

Quick Start​

# Open the task manager — add, change, pause or remove a task
/schedule

# Daemon status, start, stop, uninstall
/schedule daemon

Commands​

There is no time grammar to type. /schedule opens the manager, and Add task asks you the questions instead.

CommandDescription
/scheduleOpen the task manager — list tasks, add one, open a task's details
/schedule daemonShow the scheduler's status and start, restart, stop, or uninstall it

Add task: the questions​

Add task asks one question at a time, in order, and checks each answer before moving on. Which timing questions you get depends on how often you said it should run. Every question offers choices plus Type it… for anything the choices do not cover.

QuestionChoices
How often should it run?Once, Every few minutes, Every few hours, Every day, Every weekday (Mon–Fri), Every week, Custom (RRULE)
When should it run? (Once only)In 10 minutes, In 1 hour, Tomorrow at 09:00, or type 2026-10-14 09:00, or 14:30 for the next 14:30
Every how many minutes / hours?5, 10, 15, 30 minutes · 1, 2, 4, 6, 12 hours, or type a number. Minutes count from when you save; hours run on the hour (:00).
Which day, at what time? (daily, weekday and weekly)A day of the week, then 09:00, 12:00, 18:00 or a time you type
Start or stop it on its own? (repeating only)No: start now and keep repeating, or set any of Start later…, Stop at a date and time…, Stop after a number of runs…, then Done. See Start, stop and run limits.
What should the agent do?The prompt. Many lines are fine: Shift+Enter or Alt+Enter adds a line, Enter saves.
Name this taskShown in the task list. Press Enter to keep the suggested name — the first line of your prompt, cut to 60 characters.

All times are your machine's local time. A one-shot time has to be in the future and no more than a year away, and a time that does not exist in your time zone — February 30, or an hour skipped by daylight saving — is refused rather than moved.

Custom repeat rules (RRULE)​

Custom (RRULE) takes an iCalendar (RFC 5545) RRULE line in local time, with no DTSTART. This is the format the Codex app stores, so a rule written there reads the same here. Use it for what the choices cannot say: several days a week, several times a day, or a day of the month.

FREQ=MINUTELY;INTERVAL=30 every 30 minutes
FREQ=HOURLY;INTERVAL=2;BYMINUTE=0 every 2 hours, on the hour
FREQ=DAILY;BYHOUR=9,17;BYMINUTE=0 every day at 09:00 and 17:00
FREQ=WEEKLY;BYDAY=MO,WE,FR;BYHOUR=9;BYMINUTE=0 Monday, Wednesday and Friday at 09:00
FREQ=MONTHLY;BYMONTHDAY=1,15;BYHOUR=9;BYMINUTE=0 the 1st and 15th at 09:00
  • The RRULE: prefix is optional, and case and spaces do not matter.
  • FREQ=DAILY, WEEKLY and MONTHLY need BYHOUR and BYMINUTE: without a DTSTART there is no other time of day to use.
  • INTERVAL above 1 is only for MINUTELY and HOURLY. Minute and hour intervals count from when you saved the rule.
  • COUNT, UNTIL, DTSTART, BYSETPOS, negative days and anything else are refused with a reason, so a rule never runs at times it did not say. For a start date, an end date or a number of runs, use the task's own start, end and run limit instead: the refusal for DTSTART, UNTIL and COUNT says which one.
  • The longest gap between runs is a year; the rule itself can be up to 500 characters.
  • A time that a day does not have (02:30 when the clocks spring forward, the 31st in April) is skipped that day; a time that happens twice runs once.

Every run of a repeating schedule continues the same chat, so a run sees what earlier runs did. When you add one, AdaL prints the adal -r <chat id> command that opens that conversation.

A repeating schedule has two more rules of its own:

  • If a run is still going when the next time comes round, that time is skipped — one chat cannot run twice at once.
  • After three failed runs in a row it pauses itself, and the task list says why. Resume it from the task's details.

A one-shot task cannot be paused; it either runs or you remove it.

Start, stop and run limits​

A repeating task can also wait to start, stop at a time, or stop after a number of runs. The scheduler enforces these itself, so they do not depend on the agent remembering to stop. Each one is optional.

SettingWhat it does
StartsNo run before this time. The first run is the rule's first time at or after it, and "every 30 minutes" counts from it: starting at 09:00, it runs 09:00, 09:30, …
EndsNo run after this time. A run exactly at the end time still happens.
Runs leftHow many more runs, counted from when you set it, then it stops. Missed and skipped runs count: a laptop asleep through two of five morning runs gets three real runs.

You can set an end time and a run limit together; whichever comes first stops the task. A task that stops this way is Done, like a one-shot that has run: it stays in the list with its history and its chat, its status is its last run's result, and Pause and Resume are not offered. On AdaL Desktop, hover the Done badge to see why it stopped. To run it again, set a later end time or more runs left.

  • Pausing does not move the end time. Resuming a task whose end time passed while it was paused leaves it Done.
  • A task paused before its start time still waits for the start when you resume it.
  • One-shot tasks do not take these settings, and a task that has them cannot be changed to run once until they are cleared. Change schedule to Once in the task manager clears them for you.
  • The start must be before the end, no more than a year away, and the end must be in the future. A rule with no time between the start and the end is refused when you save it.
  • Each run of a task with a run limit is told how many runs are left after it, and the last one is told it is the last.

The task manager​

Type /schedule to open it.

  • Add task walks through the questions above and saves the task when the last one is answered.
  • Each row shows the task's id, its name, its status and when it runs. A repeating row shows its rule and its next run, any start, end or runs left (Ends Oct 31 18:00 · 3 runs left), and its last run's result beside its own status — pending · last failed is the line that needs a look.
  • Selecting a task shows its full prompt, folder, scheduled and finished times, exit code, what the agent reported, any error, and the adal -r command for its chat. From there you can View output (the end of the last run's answer, then any errors it printed), Change schedule, Edit prompt, Rename, Pause schedule or Resume schedule for a repeating one, or Remove task, which asks for confirmation first.

Change schedule, Edit prompt and Rename keep the task's id, its chat and its run history — only the part you changed is replaced. Change schedule asks the same questions as Add task, so a one-shot can become a repeating task and back. For a repeating task that includes Start or stop it on its own?, which shows the start, end and runs left it has now: change one, leave a value empty to remove it, or choose Done to keep them. Changing a task to Once removes them.

Removing a task that is running stops the run and deletes its history. The chat it was continuing is kept.

A task's status is one of:

StatusMeaning
pendingWaiting for its next time
runningRunning now
pausedRepeating, but not running until you resume it — you paused it, or three runs failed in a row
succeededThe run finished and the agent reported the task done
incompleteThe run finished, but the agent reported it could not do the task. The list shows its reason under the task.
unreportedThe run finished, but the agent did not say whether it did the task. Check its output.
failedThe run itself did not work: it could not start, its folder was gone, it crashed, or it was stopped. The list shows why.
missedIts time passed while the computer was off or asleep, so it did not run
skippedIt could not start: the previous run of the same schedule was still going

failed is only about the run. When the agent decides a task cannot be done ("there is no missing.log to summarize"), the task is incomplete, not failed. Neither missed nor skipped counts towards the three failures that pause a schedule: nothing ran.

A run starts on time even when its chat is open somewhere else, in a terminal or in Desktop: it continues the chat, and the window you have it open in shows the run's turn as it is written. If you send a message in that chat while a run is going, the chat continues with you and the run stops. It is recorded as failed, with:

[AdaL] This reply was cancelled.

That stop does not count towards the three failures that pause a schedule: the task did not fail, you took over its chat.

Ask the agent instead​

The agent can manage the same tasks, so you can say what you want in plain language rather than opening the manager:

Every weekday at 9, summarize the PRs merged since the last run
Pause the task that checks the build, and show me what its last run said
Order lunch every weekday at noon, starting tomorrow, for the next two weeks

It has two tools for this:

ToolWhat it doesApproval
schedule_viewList every task, or show one: its rule, whole prompt, folder, chat, start, end, runs left, runs and last resultNone — it only reads
schedule_updatecreate, update (name, prompt, rrule or run_at, start, end, max_runs), pause, resume, deleteAsks first, like bash. Full access mode does not ask.

The approval prompt shows the task's whole prompt, because creating a task means unattended Full access runs later.

schedule_update takes the same RRULE described above for a repeating task, and a local date and time (2026-10-15T09:00) for a one-shot. For a repeating task, start and end are local dates and times too, and max_runs is how many more runs; none removes any of them. It reaches the same scheduler as /schedule, so a task the agent creates shows up in the manager and the other way round. The two tools form the Schedule tool group, and they are offered only in the CLI and Desktop — a cloud workspace or an SDK server has no scheduler to talk to.

The agent tests a repeating task first​

When you ask for a repeating task, the agent first runs it once, about 30 seconds from now, and waits for that run to finish. It then checks what the run did: its output, the files it wrote, and each outside effect (a message, an order) where it happened, exactly once. If something is wrong, it fixes the prompt and tests again. Then it switches the same task to its repeat rule, with any start, end or run limit you asked for, so the task keeps its id, chat and run history, and tells you what it checked and when the next run is. A run limit set then counts from then, so the test run does not use one.

  • The test is a real run. If the task posts, sends, buys or deletes anything, the agent tells you what the test will do and waits for your yes, or offers a dry run that only says what it would have done.
  • If switching would start another run later today (a daily task at 12:00, switched at 11:30), the agent says so first.
  • To skip the test, say so: "every weekday at 9, no test run".

How a task runs​

Each task runs as its own headless AdaL session. The scheduler writes your prompt to a private file and runs:

adal --prompt-file <that file> --yolo --output text

The prompt never goes on the command line, so its length is not limited by your OS, and other users cannot see it in ps.

The file holds your prompt with one short note added at the end, asking the agent to finish its answer with one of two lines:

TASK RESULT: COMPLETED
TASK RESULT: NOT COMPLETED: <one-sentence reason>

The scheduler reads the last line of the answer to set the status. Because the note is part of the prompt, you see it when you continue the chat later.

The note asks for one extra line at the end of the answer, so a prompt that demands an exact reply ("answer with only a JSON object") gets that line added after it. Have such tasks write their result to a file instead of the reply. If the agent follows your prompt and leaves the line out, the task shows unreported.

Each task has its own folder, ~/.adal/scheduler/tasks/<task id>/, readable only by you. Your prompt is in prompt-task.txt, exactly as you added it. Every run then gets a numbered folder of its own, runs/000001/, runs/000002/, and so on:

FileContents
run.jsonThat run's record: when it was due, its status, exit code, what the agent reported
prompt-full.txtWhat the run was given: your prompt plus the note above
stdout.logThe agent's final answer
stderr.logAny errors the run printed (empty when it ran cleanly)

Run folders stay for as long as the task exists; they are never trimmed. Removing the task deletes the whole folder.

Three things follow from that:

  • No approval prompts. --yolo means the run can edit files and execute commands without asking. Only schedule prompts you would approve unattended.
  • It runs in the folder where you added it. That folder's AGENTS.md and .env apply, exactly as if you had run adal -q there.
  • It is a real chat you can continue. The task's details show an adal -r <session-id> command that reopens the conversation the run had. A one-shot task starts a new chat; every run of a repeating schedule continues the same one. A task's chat is marked so you can tell it apart from one you started: /resume draws it with a clock (◷) instead of ●/○, and the Desktop sidebar puts a clock icon after its title. The mark stays after you resume the chat by hand, and after the task is deleted.

Limits the scheduler enforces:

  • Three tasks run at once; the rest wait for a free slot.
  • A run still going after 6 hours is stopped and marked failed.
  • A prompt can be up to 256 KiB.
  • A task whose time passed by more than a minute while the machine was off or asleep is marked missed instead of running late with stale instructions.

The scheduler itself​

The first /schedule add registers the scheduler with your operating system, so it starts at login and starts again if it exits:

PlatformWhere it is registered
macOSlaunchd user agent ai.sylph.adal.scheduler
Linuxsystemd --user unit adal-scheduler.service
WindowsTask Scheduler task AdaL Scheduler (runs without a console window)

If the service manager cannot be used, the scheduler still starts as a plain background process — it then runs until you log out, and /schedule add says so.

/schedule daemon shows whether the scheduler is running, whether it starts at login, how many tasks are pending and running, and where its files are. Its actions are Start, Restart, Stop, Uninstall, and Refresh. Uninstall asks for confirmation, stops the scheduler, and removes it from login — your saved tasks are kept.

On AdaL Desktop​

Desktop carries its own copy of the scheduler, so you do not have to install the CLI or put it on your PATH. Type /schedule in the chat box, or pick Schedule in the sidebar, to open the Schedule page: every task on this computer as a list or a week calendar, a task's details, pause, resume and remove, Open chat for the task's chat, and the scheduler actions Start and Restart. To add or change a task, ask AdaL in a chat.

Each Desktop version carries the scheduler it was built with. Start and Restart switch scheduling to the copy inside the Desktop app you pressed them in. Opening a different Desktop version does not switch it by itself.

Folder access​

A run opens the folder its task was added in. If the operating system still wants permission for that folder, nobody is at the computer to answer when the task is due, and the run fails. So AdaL asks earlier: at CLI startup, when Desktop launches, after /schedule add, and after Start or Restart.

The scheduler makes the check itself, because it is the program the operating system grants access to — a check made by your terminal or by AdaL.app says nothing about the scheduler. It opens every pending task's folder:

PlatformWhat happens
macOSThe "would like to access" prompt appears for Desktop, Documents, Downloads, iCloud, and external or network volumes. Answer it now and the run works later.
WindowsNo prompt. The check creates and deletes one small file, which is what Controlled folder access refuses.
LinuxNo prompt. The check reads the folder and asks the kernel for read, write and search access, so a permissions or SELinux/AppArmor problem shows up now.

You see nothing when there is nothing to check or every folder is fine. When a folder is refused you get one line naming it and what to change — on macOS, System Settings → Privacy & Security → Files and Folders (Full Disk Access if the scheduler is not listed); on Windows, Controlled folder access or the folder's Security tab; on Linux, the folder's owner and permissions. A folder that can be read but not written is reported on its own, because tasks that only read files still work.

Files​

Everything lives in one folder, ~/.adal/scheduler/:

FileContents
schedules.jsonYour tasks: name, prompt start, time or repeat rule, start, end and run limit, folder, chat, state, last run
schedules.json.v3Your tasks as they were before the scheduler moved them to version 4, kept in case you need them
daemon.logWhat the scheduler did — starts, task launches, errors
tasks/<id>/One task's prompt, and one folder per run with its answer and errors (see above)

Deleting that folder is a full reset.

schedules.json is version 4, written since tasks got start times, end times and run limits. A version 3 file (from when tasks got names and RRULE rules) is converted the first time the updated scheduler reads it: every task is kept as it was, and the old file is kept next to it as schedules.json.v3. Nothing is shown for this.

An AdaL build from before version 4 does not read a version 4 file: it stops with "Unsupported schedules format" and runs no tasks until it is updated. If you go back to such a build, update it again, or put schedules.json.v3 back as schedules.json (tasks changed since then are lost).

A version 1 or 2 file from an earlier build is not converted: the first scheduler that reads it deletes it and the task folders it lists, starts an empty list, and prints one line saying so. So tasks saved before names and RRULE rules have to be added again.