Skip to the guide

Guide

Which Scheduler Should Run This?

  • automation
  • claude-code
  • codex

LaunchAgent, cron, Codex, and Claude can all run something at 10am every Monday. That is about where the similarity ends. Some execute a command on your Mac. Others give an AI a prompt and let it work out what to do.

Quick comparison · These tools solve different problems

LaunchAgent and cron run commands. Codex and Claude Scheduled Tasks run prompts. A Claude Code Routine handles repository automation in the cloud.

OptionRuns onComputer needed?Uses AI?Best fit
macOS LaunchAgentYour MacYesNoLocal scripts, services, backups, sync, maintenance
CronYour Mac or serverYesNoSimple legacy command schedules
Codex AutomationCodex, with local or connected contextUsually for local workYesReview, diagnosis, reports, and work that needs judgment
Claude Scheduled TaskClaude Cowork cloud, or locally when requiredOnly for local files or appsYesBriefings, research, summaries, connected tools
Claude Code RoutineAnthropic cloudNoYesRepository work triggered by time, API, or GitHub events

What each one is · What changes from one scheduler to another

LaunchAgent · Native macOS

Apple’s scheduler runs a command or keeps a service alive. It does exactly what the configuration says and does not consume AI usage.

  • Can use local files, scripts, and credentials
  • Keeps working when Codex and Claude are closed
  • User LaunchAgents need the Mac powered on and logged in

Cron · Unix legacy

Cron runs commands from a time expression. Its environment is sparse, and macOS gives LaunchAgent better system integration.

  • Useful for simple jobs that already run this way
  • Easy to forget because it has no friendly dashboard
  • LaunchAgent is the better default for new Mac jobs

Codex Automation · OpenAI agent

Codex returns on a schedule and reads the task context before it acts. It can use tools or skills, then gives you the result to review.

  • Good when each run may need a different decision
  • Can continue work in an existing conversation
  • Local automations work best while the machine and Codex are available

Claude Scheduled Task · Claude Cowork

Claude saves a prompt and runs it on your chosen schedule. Work that runs in the cloud can continue while your computer is off.

  • Good for research, reports, email, Slack, and connected tools
  • Each run becomes a reviewable Cowork session
  • Tasks that require local files or apps still need the computer

Claude Code Routine · Claude Code cloud

A Routine combines a prompt with its repositories, environment, and connectors. A schedule, API request, or GitHub event can start it. Anthropic runs the job in the cloud, so your laptop can be closed.

  • Best for repository automation and pull-request workflows
  • Starts from a cloud environment or fresh repository clone
  • Does not automatically have access to arbitrary files or secrets stored only on your Mac

Decision guide · Start with what the job needs

  • Is it one known local command? Use LaunchAgent. It can back up a database, sync Git, clean Docker, or update WordPress plugins.
  • Does the run need interpretation? Use Codex or Claude. Ask the agent to explain failures, summarize changes, rank risks, or prepare a weekly brief.
  • Must it run while your computer is off? Use a cloud task or Routine. Move the required files, repositories, connectors, and secrets into its managed environment.
  • Does it react to GitHub or an API? Use a Claude Code Routine or CI. LaunchAgent and cron are time-based local tools, not cloud event systems.
  • Is it a short-lived check inside an open Claude session? Use Claude Code’s local loop. It is temporary and session-scoped, not a permanent scheduler.

Recommended pattern · Let scripts execute and agents review

A script can do the repetitive part while an agent checks the result.

1. LaunchAgent does the work

Run the script on the always-on machine. Have it write a state file and logs, then add a lock so two copies cannot overlap.

2. An agent reviews the result

Have Codex or Claude read the logs, explain anything unusual, and write a short report. The agent does not need to run the original script.

Sources · Official references

Back to every guide