Automate dev workflows with Claude Code scheduled tasks
Set up a Claude Code scheduled task, formerly a routine, that checks your repo each night in the cloud and posts a Slack summary, in about 25 minutes.

What you need
Scheduled tasks are a research preview. On Team and Enterprise plans, an Owner can turn them off for everyone.
Step 1: Open a new scheduled task
2 minA scheduled task runs in Anthropic's cloud, so it keeps working while your laptop is closed.
- Go to claude.ai/code/routines and sign in.
- Click New task. Some accounts still show New routine, which opens a full-page form with the same fields.
- If a menu offers Create with Claude and Set up manually, pick Set up manually.
You should see the New scheduled task dialog, with a name, a prompt box and a Trigger row.
In a terminal,
/schedulesets up the same kind of task by chat. Both save to the same account.Step 2: Write a self-contained prompt
5 minNo one is there to answer questions during a run, so the prompt must say what to do and what done looks like.
- Give the task a clear name, such as Nightly repo check.
- Paste the prompt below into the prompt box and fill in the brackets.
- Pick a model in the prompt box's model selector.
Your promptEach run, in this repository: 1. Read the commits merged to the default branch in the last 24 hours. 2. Run [TEST COMMAND] and note any failures. 3. Check whether the docs in [DOCS FOLDER] still match the code those commits changed. 4. If any docs are out of date, fix them on a new branch and open a draft pull request. 5. Post a short summary to the #[CHANNEL] Slack channel: what changed, the test results, and a link to any pull request. If nothing was merged, post "No changes today" and stop.
You should see your task name and prompt in the dialog, with a model picked.
Not sure how much detail to give?
Write it for a new teammate with no context. Name the folders, the commands and what a good result looks like.
Step 3: Add a schedule
2 minThe trigger decides when the task runs, and you can add more later.
- In the Trigger row, pick a schedule, such as daily.
- Enter the time in your local time zone. Pick a few minutes past the hour, such as 9:07, because runs set on the hour can start late.
You should see a daily schedule in the Trigger row.
The presets don't have the timing you want?
Create the task first, then edit it and pick Custom to enter a cron expression. Write cron hours in UTC. Runs can't be more often than once an hour.
Step 4: Pick the repository and environment
3 minEach run clones a fresh copy, so Claude always starts from the latest code.
- Expand Advanced settings. On the General tab, pick your repository under Repository.
- Under Cloud environment, keep Default unless the task needs a site outside its allowlist.
- If the task calls an API that needs a key, store the key as a network secret in the environment, never in the prompt.
You should see your repository listed, with Default as the cloud environment.
A run fails with a
403andhost_not_allowed?The site isn't on the Default allowlist. Edit the environment, set Network access to Custom, and add the domain under Allowed domains.
Claude pushes its work to branches that start with
claude/. Use GitHub branch protection to guard your main branch.Step 5: Choose connectors and create
2 minEvery connector you leave in can be used during a run, including to write.
- Switch to the Connectors tab of Advanced settings.
- Keep the ones the task needs, such as Slack, and remove the rest.
- Click Create.
You should see the task's detail page, with its schedule and an empty History list.
A server you added in the CLI isn't in the list?
Servers added with
claude mcp addlive on your computer, not your Claude account. Add it at claude.ai/customize/connectors instead.Step 6: Run it once and refine
10 minA test run now shows the gaps in your prompt before the schedule takes over.
- On the detail page, click Run now.
- When it ends, click the run under History to open it as a full session.
- To tighten the prompt, open the menu next to the task's name, select Edit, then click Save changes.
You should see a finished run with its full transcript, any changes, and your Slack post.
The run says it succeeded but did nothing useful?
Succeeded only means the session ended cleanly. Open the transcript to find blocked requests or missing tools, then fix the prompt or the connectors.
You get
A Claude Code task that checks your repository every night in the cloud and reports to Slack, with no laptop left open
Try next
Did this guide work for you?
Thanks. It helps us fix the steps.


