AI Should Write the Job, launchd Should Run It

articleaiinfrastructuremacoslaunchdlocal-firstagent-loopsautomation

launchd-backed job directories map to joelclaw's local watchdog and content-sync patterns, and clarify when not to reach for Inngest or Restate

The linked wizardshit.ai markdown is currently missing, but the breadcrumb points at a very specific pattern already captured in Joel’s notes: James Long using macOS launchd as the boring-ass runtime for local AI jobs.

The clever bit is the handoff. Let the assistant create the job directory, write the run script, generate the LaunchAgent plist, and wire logs. Then stop being magical. Let launchd run the thing on a schedule, after reboot, with stdout, stderr, last exit code, and real system state.

That split is useful for joelclaw because not every local automation deserves Inngest, Restate, Redis, or a full agent loop. Some jobs should be files plus a supervisor. This rhymes with the existing joelclaw launchd gateway decision, content sync watcher, and the earlier discovery on declarative AI jobs via launchd.

The core lesson is small and sharp: use AI for authoring and repair, but use the operating system for execution. Otherwise you end up with a chat window pretending to be infrastructure, and that shit gets weird fast.

Key Ideas

  • AI is the authoring layer: it can create job folders, scripts, schedules, and plist files from natural language.
  • launchd is the execution layer: it already knows how to run jobs on login, interval, calendar schedule, file change, and reboot.
  • A job-as-directory convention keeps local automation inspectable: schedule, run, logs, and metadata live where agents and humans can both see them.
  • LaunchAgent logs beat vibes: stdout, stderr, exit codes, and generated plist labels make failures debuggable.
  • Bun and shell scripts are enough for many local jobs; pulling in Docker, Kubernetes, or Inngest should be a choice, not muscle memory.
  • WatchPaths is the underrated move: file changes can trigger local AI pipelines without a custom event bus.
  • The joelclaw takeaway is a routing rule: use launchd for simple Mac-local jobs, Inngest for durable event workflows, and Restate for resumable DAG-style workloads.