How-to

How to Schedule Claude Code Jobs

A practical guide to setting up scheduled Claude Code runs on macOS — overnight, on a cron, or goal-based using OpenHelm.

O
OpenHelm Team· Engineering
··7 min read
How to Schedule Claude Code Jobs

There's a category of development work that never quite makes it onto the daily task list. Not because it's unimportant — quite the opposite — but because it needs a block of uninterrupted time that never materialises during working hours. Dependency upgrades. Security audits. Test coverage gaps. Documentation backlogs.

These tasks aren't hard. They just need time. And the right answer isn't to find that time yourself — it's to schedule Claude Code to handle them while you're away from your desk.

What Claude Code Scheduling Actually Means

Claude Code is Anthropic's agentic coding system. Give it a goal, and it reads your codebase, runs commands, interprets output, and iterates until the task is done or it gets stuck. It's meaningfully different from a script: it can handle errors it didn't anticipate, try alternative approaches, and produce working output on tasks where the exact steps weren't known in advance.

Scheduling Claude Code means deciding when that work happens and configuring a system to trigger it reliably. The challenge is that Claude Code's native tools — the built-in /loop command, shell scripts, macOS cron — all have real gaps when you're not around to supervise.

Option 1: The /loop Command

Claude Code ships with a /loop command that repeats a prompt on a fixed interval. While your terminal is open:

/loop 15m Review new test failures and suggest fixes

This works for interactive, exploratory sessions where you're watching the output. It's not scheduling — it requires a live terminal, dies when you close your laptop, produces no structured log, and has no self-correction on failure. Useful for quick experiments; not useful for overnight automation.

Option 2: Cron + Shell Script

The unix-native approach: write a wrapper that calls claude -p "your goal" and schedule it with crontab -e:

# Run at 2am daily
0 2 * * * claude -p "Upgrade all npm packages with minor/patch updates, run the test suite, and open a PR if tests pass" --project /Users/you/myproject >> ~/claude-logs/nightly.log 2>&1

This is workable for simple cases. The gaps that matter in practice:

No silence detection. Claude Code can hang waiting for interactive input — a confirmation prompt, a slow network call, a build that stalls. Your cron script keeps running indefinitely, accruing time and token cost, until you manually check the process table.

No structured history. Logs are flat files. Answering "did Tuesday's job succeed?" means grepping through log output.

No failure context loop. If the job fails, the next run starts from scratch with no knowledge of what went wrong previously.

macOS permission friction. Full Disk Access is required for cron to reach your development directories on modern macOS, and even then it can be silently blocked in certain configurations.

For a single, simple overnight job on a project you check daily, cron works. Across multiple projects with reliability requirements, the gaps accumulate quickly.

Option 3: OpenHelm

OpenHelm is a macOS desktop app built specifically to schedule and manage Claude Code jobs. It sits in your menu bar and fires jobs according to a schedule you define — no terminal required, no cron entries to manage.

What it adds over raw cron:

Silence detection. OpenHelm monitors Claude Code's output stream. If nothing is produced for 10 minutes, the run is flagged and stopped — catching the most common and most expensive headless failure mode before it runs all night.

Pre-flight checks. Before each run, OpenHelm verifies the project directory exists, the Claude Code binary is accessible, and the job is still valid. If a check fails, the run is marked immediately rather than launching Claude Code into a broken environment.

Structured logging. Every run produces a timestamped log with full output and a clear status — succeeded, failed, or permanent_failure. Checking last night's run is one click.

Self-correction loop. When a run fails, OpenHelm can automatically queue a corrective retry, passing the failure output as context for Claude Code's next attempt. The second pass often succeeds because it's working with information about what went wrong.

Priority queue. Manual "Run now" triggers jump the queue over scheduled jobs. Three priority tiers — manual, scheduled, corrective — ensure the right work happens first.

Setting Up a Scheduled Job in OpenHelm

  1. Install OpenHelm from openhelm.ai. It runs as a macOS desktop app in the menu bar.
  1. Create a new Job. Write the prompt as a goal: describe the outcome you want, with acceptance criteria built in.
Example: Upgrade all npm packages with minor or patch updates. Run the full test suite.
If tests pass, open a PR with a summary of what changed. If tests fail, document
which packages introduced failures and stop.
  1. Set the project directory — the local folder where Claude Code will run.
  1. Choose a schedule type:
TypeWhen to use
CalendarDaily or weekly at a specific time
CronComplex recurring schedules
IntervalN minutes/hours after last completion
OnceOne-off run at a specific datetime
ManualOnly trigger by hand
  1. Enable the job. OpenHelm tracks the schedule immediately and fires the job when the next trigger time arrives.

Which Schedule Type to Use

For most overnight development work, the Calendar type (daily at 2:00am) is the right choice. It's human-readable, predictable, and doesn't pile up if a run takes longer than expected.

Use Interval scheduling when the job's next run should depend on when the previous one finished — not on the clock. This is important for jobs with variable duration: a Claude Code session that takes 3 hours shouldn't trigger a second run an hour after it started.

Cron expressions are available for anything more complex.

Keeping Your Mac Awake

OpenHelm runs on your machine — if your Mac sleeps, scheduled jobs don't fire. For reliable overnight automation:

  • Mac mini or Mac Studio (always-on hardware) are ideal
  • On a MacBook: System Settings → Battery → Options → "Prevent automatic sleeping on power adapter when the display is off"
  • The caffeinate command can keep your machine awake for a specific window

This is a deliberate tradeoff: local execution means your code, credentials, and filesystem never leave your machine. No cloud scheduler touches your projects.

The Practical Shift

The developers who get the most from claude code scheduling describe a consistent change in how they plan their days. Instead of asking "when do I have time to do X?", they ask "what do I want done by tomorrow morning?"

That reframe — from finding time to delegating to a schedule — is where the real productivity gain lives. Schedule the work. Read the results over coffee.

More from the blog