macos-watchdog
An agent skill by daymade, from daymade/claude-code-skills. Tags: automation, devops, macos, monitoring, workflow.
What it does
Design, deploy, and discipline macOS launchd watchdogs — LaunchAgents/LaunchDaemons that detect a recurring problem and auto-remediate it. Use whenever creating or editing a persistent background monitor / daemon / agent on macOS, writing a launchd plist, scheduling a self-healing script, or when a watchdog has become a disturbance itself: re-launching apps the user quit, firing repeated notifications, re-running its full repair ladder every few minutes on an unfixable network, or hammering the system (crash loops, fork storms, runaway restarts). Also use for stop/disable semantics (bootout vs bootstrap vs disable vs unload), adding cooldown / backoff / notification throttling to a self-healer, binding a monitor's lifecycle to its premise state, or auditing existing LaunchAgents. 中文触发:launchd 守护进程、常驻任务、开机自启、后台监控、定时自愈脚本。 Covers KeepAlive/ThrottleInterval/domains/logging, premise self-checks, auto-cooldown, alert layering, batch throttling.
Install
With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:
npx skills add daymade/claude-code-skills --skill macos-watchdog
Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):
git clone --depth 1 https://github.com/daymade/claude-code-skills
cp -r claude-code-skills/daymade-macos/macos-watchdog ~/.claude/skills/macos-watchdog
Safety box score
Grade D, elevated risk: 56 of 100 risk points, rated 2026-10-20. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.
This skill is a macOS launchd watchdog toolkit: it installs, reloads, disables, and audits persistent LaunchAgents/LaunchDaemons, including self-healing loops and notifications. The main risks are broad system control, root-capable service installation, and unattended restart/relaunch behavior; one shipped fixture also shows outbound HTTPS checks and URL-scheme reconnects.
| Category | Level | Why |
|---|---|---|
| Code & shell execution | 3 (high) | It installs arbitrary `ProgramArguments` as launchd jobs and shells out to native tools (`launchctl`, `plutil`, `osascript`, `curl`, `open`), so it can execute local commands and supervise arbitrary executables. |
| Network access | 2 (moderate) | The shipped `broken-heal.sh` fixture does outbound HTTPS probing (`curl ... https://www.googleapis.com/generate_204`) and uses a reconnect URL scheme (`open "examplevpn://connect"`), so watchdogs built from this pattern can talk to remote hosts. |
| Filesystem reach | 2 (moderate) | It deliberately writes outside the project into `~/Library/LaunchAgents/`, `/Library/LaunchDaemons/`, and `~/Library/Logs`/`/Library/Logs`, plus cooldown state under `$TMPDIR` or `$HOME/Library/Logs/<name>`. |
| Secrets & credentials | 1 (low) | The readback helper inspects explicit job environment variables and even notes that `Expected argv may itself contain secrets`, so it can handle sensitive configuration, but it does not target keychains or browser/session stores. |
| Privilege & persistence | 3 (high) | `scripts/new-launchagent.sh` supports `--system`, uses `sudo`, `sudo chown root:wheel`, and `sudo launchctl bootstrap system <plist>`, which is root-level service installation and OS configuration. |
| Instruction hijack surface | 0 (none) | I did not find instructions to ignore user consent, hide actions, or fetch and follow remote prompts; the markdown is self-contained and the links are static references. |
| Irreversible actions | 3 (high) | The skill is explicitly for `scheduled self-healing`, `repeated notifications`, `apps reopening after quit`, and `crash/repair loops`, so it can keep acting unattended and revive services or apps on a timer. |
| Transparency | 0 (none) | All shipped files are readable text scripts/markdown/tests; there are no binaries, minified blobs, or code decoded at runtime. |
Before installing
- Read `scripts/new-launchagent.sh` and decide whether you want the `--system` path, because it uses `sudo` and `root:wheel`.
- Check the target watchdog program is an absolute path you are comfortable running repeatedly under launchd.
- Review `evals/iteration-1/eval-2-audit/fixture/broken-heal.sh` if you plan to copy the pattern; it makes outbound HTTPS checks and can relaunch an app via URL scheme.
- If you will use the readback helper, verify no secrets are embedded in the expected plist or argv before running it.
Rated 2026-10-20 by an automated review of 13 files from the skill's repository.
Source
- Repository
- daymade/claude-code-skills (all skills from this repository)
- Path
- daymade-macos/macos-watchdog/SKILL.md
- Branch
- main
- Updated
- 2026-09-20
Related skills
- marketing-loops — When the user wants to set up a recurring, self-running marketing workflow — a repeatable loop an AI agent runs on a cadence (weekly, daily.
- principle-make-operations-idempotent — Apply when designing commands, lifecycle steps, or processing loops that run amid crashes, restarts, and retries.
- claude-code-hooks — How to write, test, register, and debug Claude Code hooks — PreToolUse / PostToolUse / SessionStart / Stop Bash guards that enforce a rule the model would.
- agents-deploy — Use when deploying your agent to AWS, or when a deploy has failed.
- automate-me — Use for "automate me", "create/update/refresh my -mode skill", "turn/capture my preferences or working style into a skill".
- cancel-ralph — Cancel an active Ralph Loop. Use when the user wants to stop, cancel, or abort a running ralph loop.