TutorialBeta· About 15 minutes
Schedule a nightly coding agent prompt with Crew
By the end of this tutorial, a coding agent will review your repository every night at 22:00 without you starting it, you will know how to fire the same prompt from a webhook, and you will have a two-step workflow that keeps its place across restarts. You need Crew running on a Mac in the Edith beta, and an agent CLI such as Claude Code or Codex. See Get Crew.
Know who runs the schedule
The agents engine owns schedules, not the Edith window. They keep firing after Edith quits, and with background sessions on, the engine starts again at login. Background sessions are on by default. Edith must be turned on in System Settings > General > Login Items.
To check them from a terminal, run ed crew background, and ed crew background on if they are off. See Background sessions.
Add the project and start a thread
Schedules run in a project, a folder the engine tracks.
- On the Crew page, switch to Threads.
- Press Add project in the Threads sidebar and choose the repository folder, such as
~/code/app. - Press New thread (⌘N), pick the agent, such as Claude Code, and send a first message, such as "Read the README and wait for instructions".
The automation you add next belongs to this thread and uses its agent and settings.
Create the nightly automation
- Open the thread and press ⌥⌘B to show its details panel.
- Under Automations, press + (New automation for this thread).
- Give it a name, such as
Nightly review. - In Prompt to send, write what the agent receives each time: "Review today's commits and list anything risky".
- Under When, choose Daily and set the time to 22:00. Weekdays skips weekends, Weekly runs on one day, Every repeats every few minutes and Once runs at one date and time.
- Under Thread, choose New thread each run so every night's review is its own thread. Same thread keeps adding to this one, and Same thread, fresh session uses this thread with a fresh agent session.
- Leave Enabled on and press Create automation.
A review only reads code. For a job that edits files overnight, start the thread in a new worktree, with Where the agent works (⌘⇧X) set to New worktree, so each run never touches the branch you have open.
From the terminal
The same schedule, created on the project:
ed crew projects add ~/code/app --provider claudeed crew schedules add "Nightly review" --prompt "Review today's commits and list anything risky" --at 22:00 --project ~/code/app--at is a local time of day. Add --weekdays 1,2,3,4,5 to skip weekends; days run from 0 (Sunday) to 6. Use exactly one trigger: --every, --at, --once or --webhook. --provider, --model, --effort, --permissions, --worktree <ref> and --thread-mode set how each run works. See ed crew schedules.
Test it now
Do not wait until 22:00 to find a typo in the prompt. In the automation's row under Automations, press Run now. It sends the prompt now without changing the next run. The row shows how the last run went, and the new thread appears in the Threads sidebar.
From the terminal
ed crew schedules lsed crew schedules run sch_01ed crew thread read th_01 --limit 400Change, pause or remove it
Each automation row has buttons for Pause (then Resume), Edit and Delete. Deleting stops the automation; threads it already ran keep their history.
From the terminal
ed crew schedules update sch_01 --at 23:30ed crew schedules disable sch_01ed crew schedules enable sch_01ed crew schedules rm sch_01update changes only what you pass, and a new trigger replaces the old one.
Trigger it from a webhook instead
A webhook schedule runs when its path is called, for example by your Git host when an issue opens. Webhook schedules are set up from a terminal:
ed crew schedules add Issues --prompt "Triage {{body.issue.title}}" --webhook --signature-header X-Hub-Signature-256 --signature-prefix sha256= --secret-file ~/.hook-secret --filter body.action=openeded crew schedules show sch_02The prompt can use {{body.<path>}} and {{headers.<name>}} from the delivery. show prints the webhook path. The path holds the hook's secret token, so give it only to the sender. --secret-file reads the signing secret from a file; never pass it on the command line.
Check what arrived, and replace the path if it leaked:
ed crew schedules deliveries sch_02ed crew schedules rotate sch_02Chain steps into a workflow
A schedule sends one prompt. For several steps in a row, write a workflow. The engine keeps each run across restarts, so a run that is waiting is still waiting after a reboot. Here is one, with your own folder in cwd:
{ "name": "nightly-fix", "description": "Fix flaky tests at night, then report", "triggers": [{ "type": "daily", "time_of_day": "02:00" }], "steps": [ { "type": "send", "name": "fix", "provider": "codex", "cwd": "/Users/me/code/app", "text": "Find and fix the flaky tests" }, { "type": "wait_turn", "name": "fixed", "thread": "{{steps.fix.thread_id}}" }, { "type": "send", "name": "report", "thread": "{{steps.fix.thread_id}}", "text": "Summarize what you changed and what still fails" } ]}A send step without a thread starts a new thread and reports its thread_id, which later steps use. The daily trigger starts a run at that time. every with every_ms, and webhook with a name, also work.
To add it:
- In the Threads sidebar, press the Workflows button.
- Press New workflow, replace the template with the JSON above, and press Save.
- To try one run by hand, select the workflow and press Run, or right-click it and choose Run…. In the sheet, press Run again.
The Workflows page lists each run with its steps and their state. Runs that wait for you are marked Needs you; open one to answer it. A run pauses when an agent step fails and retries on its own; open the run and press Resume to retry now, or Cancel run to stop it.
From the terminal
Save the JSON as nightly-fix.json, then register it, check the next start, and try one run:
ed crew workflows register nightly-fix.jsoned crew workflows hooks nightly-fixed crew workflows start nightly-fix --key test-1ed crew workflows lsed crew workflows show run_01Starting again with the same --key returns the same run instead of a second one. ed crew workflows resume run_01 retries a paused run now, and cancel stops it.