Dev.to
7/19/2026

Retiring a Claude Code Model Unattended with launchd: A Self-Destructing Job That Auto-Patches settings.json
Short summary
A developer shares a launchd-based script that automatically rewrites the model field in Claude Code's settings.json when a model reaches end-of-life, then self-unregisters. The script uses a date guard to prevent catch-up firing, jq for atomic JSON patching with validation, and osascript for desktop notifications. The pattern generalizes beyond model migration to any 'change a setting exactly once on a specific day' scenario.
- •launchd script auto-patches Claude Code settings.json on model EOL date
- •Date guard prevents premature catch-up firing; jq rewrite is atomic with backup and JSON validation
- •Job self-unregisters via launchctl unload after completion, leaving plist for potential re-registration
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



