Dev.to
7/18/2026

Auto-Migrating Claude Code with a Throwaway launchd Job — a Script That Deletes Itself When Its Work Is Done
Short summary
A detailed walkthrough of a self-deleting launchd job that automatically migrates Claude Code's default model from a deprecated model to Opus on a specific date. The script uses a date guard for idempotency, jq for atomic settings.json modification, osascript for notifications, and launchctl unload to deregister itself after completion. The pattern is reusable for any one-time scheduled macOS maintenance task.
- •Throwaway launchd job pattern: runs once, then deregisters itself
- •Script migrates Claude Code model setting from deprecated model to Opus
- •Includes date guards, atomic file writes, and macOS notifications
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



