Agent skill

macOS Watchdog

by daymade in daymade/claude-code-skills

Designs and audits macOS launchd watchdogs. An agent skill from daymade/claude-code-skills.

MITAuto-check: notes

Install macOS Watchdog

skills CLI
$ npx skills add daymade/claude-code-skills --skill macos-watchdog -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install daymade/claude-code-skills macos-watchdog --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/daymade/claude-code-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/daymade-macos/macos-watchdog .claude/skills/macos-watchdog && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
macos-watchdog
GitHub stars
1.4k
Token cost
~2.8k tokens
SKILL.md length
1,502 words
Files
11 (incl. scripts, references, assets)
Skills in repo
103
Repo updated
First seen
Licence
MIT

At a glance

Designs and audits macOS launchd watchdogs. An agent skill from daymade/claude-code-skills.

  • Works in 4 steps: Premise-state self-check — it knows when… → Remediate first, page only on sustained… → Escalating auto-cooldown — an unfixable… → …
  • LaunchAgent/LaunchDaemon setup
  • SKILL.md covers Entry decision tree, The quiet-watchdog contract, Deploy (mechanics that bite) and Stop semantics (the deprecated…, plus 1 more section
  • Runs Shell scripts from its folder

What it does

macOS Watchdog is an agent skill from daymade/claude-code-skills. Designs and audits macOS launchd watchdogs. Use for LaunchAgent/LaunchDaemon setup, plist changes, scheduled self-healing, repeated notifications, apps reopening after quit, crash or repair loops hammering the Mac, or a watchdog alert shown as Script Editor. Covers stop/disable/restart, cooldown/backoff, notification throttling and alert decisions. 中文:launchd 守护进程、常驻任务、开机自启、后台监控、定时自愈、通知来源排查。

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 17 other files, including scripts, reference files and assets (for example `evals/evals.json`, `evals/iteration-1/eval-2-audit/fixture/broken-heal.sh` and `references/alert-discipline.md`).

It works with macOS. The repository describes itself as: Professional Claude Code skills marketplace featuring production-ready skills for enhanced development workflows. The licence is MIT.

When your agent uses it

  • LaunchAgent/LaunchDaemon setup
  • Scheduled self-healing
  • Repeated notifications
  • Apps reopening after quit

Example prompts

  • “Use the macos-watchdog skill to design and audits macOS launchd watchdogs. An agent skill from daymade/claude-code-skills”
  • “/macos-watchdog”

Requirements

  • A Bash shell

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Premise-state self-check — it knows when it has no job
  2. Remediate first, page only on sustained failure
  3. Escalating auto-cooldown — an unfixable environment means silence
  4. Never resurrect what the user explicitly quit

What it can do on your machine

Read from SKILL.md and the folder at commit 872127b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

macOS Watchdog loads about 2.8k tokens when it runs, and up to ~8.4k if it reads all its reference files. Until then it costs about 102 tokens; SKILL.md has 1,502 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~102
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~8.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteRuns commands with sudoSKILL.md:86
    bootout gui/$(id -u)/<label>` (daemon: `sudo launchctl bootout system/<label>`) |

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from daymade/claude-code-skills at commit 872127b, republished under its MIT licence (© daymade). 1,502 words, ~2,841 tokens.

Download SKILL.mdSave it as .claude/skills/macos-watchdog/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
macos-watchdog
description
Designs and audits macOS launchd watchdogs. Use for LaunchAgent/LaunchDaemon setup, plist changes, scheduled self-healing, repeated notifications, apps reopening after quit, crash or repair loops hammering the Mac, or a watchdog alert shown as Script Editor. Covers stop/disable/restart, cooldown/backoff, notification throttling and alert decisions. 中文:launchd 守护进程、常驻任务、开机自启、后台监控、定时自愈、通知来源排查。

macOS Watchdog

A watchdog is a launchd job that periodically detects a recurring problem and remediates it without a human. The craft is not "how to install a plist" — it is how to keep the watchdog from becoming a new disturbance: every watchdog on this machine was born from an incident, and the recurring failure mode afterward is the watchdog itself (false "all good" reports, notification floods, re-launching apps the user quit, fork-bomb replays).

The governing principle, learned the expensive way: a watchdog's lifecycle is bound to its premise state. When the condition it exists to fix cannot be fixed by it (broken WiFi, user quit the target app, prerequisite state gone), the watchdog must stand down by itself — not wait for a human to disable it.

Entry decision tree

The situation is…Go to
Installing a NEW watchdog from scratch§ Deploy, then § The quiet-watchdog contract
An existing watchdog misbehaves (spam, re-launches apps, hammers)§ The quiet-watchdog contract, diagnose which clause it violates
Stopping / disabling / restarting a job§ Stop semantics
plist key details (KeepAlive forms, domains, logging, resource limits)references/launchd-plist-reference.md
Cooldown/backoff/notification-throttle patterns + sanitized war storiesreferences/quiet-watchdog-patterns.md
SRE alert layering (page vs ticket, fatigue numbers)references/alert-discipline.md
A watchdog alert appears under Script Editor or its sender is unclearreferences/alert-discipline.md § Message content; inspect the delivered card

The quiet-watchdog contract

Before shipping or blessing any watchdog, every clause below must hold. Each clause exists because a real watchdog violated it.

1. Premise-state self-check — it knows when it has no job

The script's first act on every run: verify the state that justifies its existence still holds. If not, exit silently — no remediation, no notification, no side effects.

  • A proxy-repair watchdog checks the proxy app is running first; user quit it → skip the cycle.
  • A "did the config switch back" watcher checks the config state it watches; already switched → self-stop, not another round of misleading notifications. (Real case: a recovery watcher kept firing for 2h after its premise resolved, sending 3 spurious notices, because nothing told it to stop.)
2. Remediate first, page only on sustained failure

Detection stays honest on every cycle, but the disruptive action defers until the failure persists across N consecutive cycles (patient mode). Rationale: oscillating chains self-recover in minutes; a force-reconnect on a self-limiting blip is net-harmful. Measure your system's real self-recovery window before choosing N (one chain's 94-min observatory run showed ≤3 min self-recovery → N=2 cycles at 5-min interval).

When the trigger aggregates several independent sources into one verdict (not a single health check), the cross-source agreement fraction is a second, separate parameter from N — don't default to "all sources must agree." An all-or-nothing gate produces a false negative on exactly the correlated-but-partial incident the watchdog exists to catch, because real failures rarely take every source down at once (real case: a 9-source collection-health gate required 9/9 failing and missed a live incident sitting at 6/9; recalibrating against the actual incident data to a ≥60%-of-sources threshold caught it while three-fixture testing at 0%/11%/100% confirmed it still tolerated a single-source blip). Calibrate breadth (what fraction must agree) against real historical failure data the same way you calibrate depth (N) — a threshold picked from what "sounds strict enough" is a guess, not a calibration.

Escalation ladder (cheap → disruptive): refresh state → restart connection → remote repair. Each rung verifies before climbing.

3. Escalating auto-cooldown — an unfixable environment means silence

When the full repair ladder fails, the environment is unfixable by the watchdog (broken WiFi, captive portal, dead upstream). The naive behavior — re-run the entire ladder + notification every interval forever — is exactly "the watchdog keeps re-launching the app every 10 minutes."

ThrottleInterval does not fix this: it throttles process respawn, is a fixed delay with no backoff, and does nothing for a job that exits 0 after spamming. Cool-down must live in the application layer:

  • Record consecutive exhausted rounds in a state file.
  • After each exhausted round, stand down for an escalating tier (e.g. 30 min → 2 h → 6 h, last tier repeats).
  • One notification when entering cool-down; zero during it. On tier expiry, retry one round; any real heal clears the counter and the cool-down state.
  • A manual pause [duration] command with a TTL state file is the fallback — but the auto path must work with no human command at all. A disable mechanism that requires the user to remember a command is not a mechanism.

Reusable implementation: scripts/watchdog-cooldown.sh (source it; provides paused_any, record_exhausted, clear_exhausted, cmd_pause/cmd_resume).

4. Never resurrect what the user explicitly quit

On macOS, open <url-scheme> launches the app when it isn't running, and open without -g steals foreground. A watchdog whose remediation uses URL schemes (or open -a, or restarting a GUI app) will read to the user as "I quit it and it came back."

Gate every such action: check the target process is alive before invoking its scheme, and pass -g so a legitimate action never pops a window. If the user quit the app mid-remediation, abort the ladder — cleanup traps must honor the same gate, or the "ensure connected on exit" fallback becomes the resurrector.

Show full SKILL.md (664 more words)Show less

Deploy (mechanics that bite)

Before deploying or integrating an existing periodic observer, apply references/probe-cost.md. Require bounded observation work and a completed native launchd round; importing an existing script does not certify its cost or verdict.

  1. Location: user agent → ~/Library/LaunchAgents/ (GUI session context: can open apps, show notifications); system daemon → /Library/LaunchDaemons/ (root, no GUI access). Choose by whether the job needs the user's GUI session, not by habit.
  2. plist: start from assets/launchagent.template.plist (annotated: Label, ProgramArguments, StartInterval, StandardOutPath/StandardErrorPath, ThrottleInterval, Nice). Validate with plutil -lint. ProgramArguments element 0 = absolute path; never rely on PATH inheritance.
  3. Load/reload: launchctl bootstrap gui/$(id -u) <plist>; after editing a plist, bootout then bootstrap again — launchd's active state must match disk. Force one run with launchctl kickstart -k gui/$(id -u)/<label>.
  4. Logs: StandardOutPath/StandardErrorPath are non-negotiable (without them failures vanish), plus in-script log rotation (cap ~1 MB).
  5. Idempotency guard: re-running your deploy must not double-install. scripts/new-launchagent.sh <label> <script> <interval> is the idempotent wrapper (bootout-if-loaded → write plist → bootstrap → verify launchctl list).
  6. TCC / Full Disk Access: a LaunchAgent reading protected files needs a working grant for its effective permission subject. Use macos-permissions to inspect TCC attribution and verify a protected read from the actual job; the shell's interpreter path alone does not decide this.
  7. Batch throttling by default: any watchdog loop that spawns work (replays, fuzz, batch scans, parallel API calls) needs an explicit rate cap as a default parameter, not a later optimization. To the machine, an unthrottled loop and a runaway process are indistinguishable (real case: an unthrottled test replay forked 1,041 processes/sec for 7 minutes and pushed the die to 83 °C).
  8. Browser side-effect acceptance: a successful data fetch alone does not prove a browser-backed watchdog is ready. The deploying operator must declare a budget for task-owned spaces and pages, then independently inventory them across multiple rounds, including injected initialization and cleanup failures. Counts must stay within that lifecycle budget; protect user-owned and unknown-origin pages throughout. If the task requires no focus stealing, independently observe the foreground app and visible windows during those rounds; CDP success is not focus evidence. For ego lite lifecycle, locking, ownership conflicts and cleanup readback, load the named Skill ego-lite-use when installed. Otherwise use the owning browser tool's documented lifecycle while meeting the same budget and readback requirements. Missing resource observations, or missing focus observations when no focus stealing is required, leave acceptance incomplete.

Stop semantics (the deprecated trap)

IntentCommand
Stop now, allow re-bootstrap laterlaunchctl bootout gui/$(id -u)/<label> (daemon: sudo launchctl bootout system/<label>)
Stop now AND keep stopped across loginlaunchctl disable user/$(id -u)/<label> (reverse: enable)
Edit then reloadbootout → edit plist → bootstrap

Never launchctl unload: deprecated, and on Ventura+ the job re-loads via RunAtLoad when the plist stays in place — the "disabled" watchdog fires again (observed: an unloaded watcher re-firing 3 times in 2h). bootstrap/bootout are the modern pair.

Troubleshooting quick map

SymptomFirst check
"It re-launches the app I quit"URL-scheme/open calls missing the process-alive gate (clause 4)
"It spams the same repair every few minutes"No exhausted-round cool-down (clause 3); also check the ladder's failure path doesn't reset its dead-counter
"It reports healthy through a real outage"Health check certifies only the path it probes — one green probe ≠ all planes healthy (add the second plane's probe)
"bootout didn't stick / it came back"unload used instead of bootout, or RunAtLoad + plist still in place
Silent no-runsStandardErrorPath missing → failures invisible; then log show --predicate 'process == "launchd"' --last 15m
"log mtime is fresh" but the job is actually failingout.log all-green is not health — a failed pass may write nothing (set -e + prints-verified-only-on-success), so the last-success timestamp stays fresh forever. Judge the failure path (err.log / last-exit status), not success-side freshness (Pattern 7)
Works interactively, fails under launchdTCC/FDA on the wrong interpreter; PATH assumptions in ProgramArguments
Observation becomes slower as history growsAudit cold, warm and delta work using references/probe-cost.md; caching bytes does not bound parsing or queries

Details and the sanitized war stories behind each clause: references/quiet-watchdog-patterns.md.

© daymade, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 10 other files (scripts, references, assets) in daymade-macos/macos-watchdog of daymade/claude-code-skills.

  • SKILL.md
  • assets/launchagent.template.plist
  • evals/evals.json
  • evals/iteration-1/eval-2-audit/fixture/broken-heal.sh
  • evals/iteration-1/eval-2-audit/fixture/broken-watchdog.plist
  • references/alert-discipline.md
  • references/launchd-plist-reference.md
  • references/probe-cost.md
  • references/quiet-watchdog-patterns.md
  • scripts/new-launchagent.sh
  • scripts/watchdog-cooldown.sh

Open the folder on GitHubat commit 872127b

Compare with similar skills

macOS Watchdog next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

macOS Watchdog compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
macOS Watchdog this skilldaymade/claude-code-skills1.4k—~2.8kAutomated safety check: NotesMIT
Site ArchitectureAvdLee/RocketSimApp80411 repos~3.3kAutomated safety check: PassCustom licence
Engine Whats Newflutter/flutter179k—~978Automated safety check: PassBSD-3-Clause
macOS Spm App PackagingDimillian/Skills4k5 repos~1.2kAutomated safety check: PassMIT
Openclaw Live Updateropenclaw/openclaw392k—~3.7kAutomated safety check: PassMIT
Orca iOS Simulator Controlstablyai/orca88k1 repos~584Automated safety check: PassApache-2.0

Similar skills

  • Site Architecture

    AvdLee/RocketSimApp

    When the user wants to plan, map, or restructure their website's page hierarchy, navigation, URL structure, or internal linking.

    804 GitHub starsUsed in 11 repos~3.3k tokens
    Marketing & SEOAuto-check passed
  • Engine Whats New

    flutter/flutter

    Generates the "what's new" release summary and diff file for changes in the Flutter engine (//engine/src/flutter) between two releases (e.g., 3.47 vs 3.44).

    179k GitHub stars~978 tokensUpdated today
    MobileAuto-check passed
  • macOS Spm App Packaging

    Dimillian/Skills

    Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project.

    4k GitHub starsUsed in 5 repos~1.2k tokens
    MobileAuto-check passed
  • Openclaw Live Updater

    openclaw/openclaw

    Maintain the canonical live OpenClaw main checkout, macOS LaunchAgent-managed Gateway, local macOS app, exact-head main CI, and recurring full release validation.

    392k GitHub stars~3.7k tokensUpdated today
    DevOps & CloudAuto-check passed
  • iOS Simulator control from inside Orca, with the live device view in Orca's emulator pane. Use when driving a booted Apple Simulator on macOS: taps, gestures…

    88k GitHub starsUsed in 1 repo~584 tokens
    MobileAuto-check passed
  • A catalog of recurring bug shapes in the Mole Mac cleaner, used to review safety-sensitive diffs for deletion safety, unbounded commands, shell traps and weak tests.

    70k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed

More from daymade/claude-code-skills

All 103 skills in this repo
  • Video Comparer

    daymade/claude-code-skills

    This skill should be used when comparing two videos to analyze compression results or quality differences.

    1.4k GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check: notes
  • CLI Demo Generator

    daymade/claude-code-skills

    Generates professional animated CLI demos as GIFs using VHS terminal recordings.

    1.4k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Doc To Markdown

    daymade/claude-code-skills

    Converts DOCX/PDF/PPTX and saved HTML/HTM to high-quality Markdown with automatic post-processing.

    1.4k GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Interaction Design Board

    daymade/claude-code-skills

    Generates several distinct, clickable HTML interaction prototypes for one product surface into a Design Board and collects selection/remix feedback before implementation.

    1.4k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Auto Repo Setup

    daymade/claude-code-skills

    Diagnoses and repairs repository setup and guarded Git workflows for Claude Code or Codex — environment repair, startup sync, hook auditing, collaborator handoff.

    1.4k GitHub stars~2.8k tokensUpdated today
    Auto-check: notes
  • Bigdata Skill

    daymade/claude-code-skills

    Pulls Bigdata.com (RavenPack) financial and news data via the official bigdata-client SDK and /v1/ REST endpoints — structured financials, prices, analyst estimates, entity-sentiment series…

    1.4k GitHub stars~3.7k tokensUpdated today
    Auto-check passed

Works with

Questions about macOS Watchdog

What does macOS Watchdog do?

Designs and audits macOS launchd watchdogs. An agent skill from daymade/claude-code-skills. macOS Watchdog is an agent skill from daymade/claude-code-skills. Designs and audits macOS launchd watchdogs.

When should I use macOS Watchdog?

macOS Watchdog fits situations like: launchAgent/LaunchDaemon setup; scheduled self-healing; repeated notifications; apps reopening after quit.

How do I install macOS Watchdog in Claude Code?

Run `npx skills add daymade/claude-code-skills --skill macos-watchdog -a claude-code`. Or copy the skill folder (daymade-macos/macos-watchdog in daymade/claude-code-skills) into .claude/skills/macos-watchdog in your project. Claude Code loads it when a task matches its description.

How do I install macOS Watchdog in Codex?

Run `npx skills add daymade/claude-code-skills --skill macos-watchdog -a codex`. Or copy the skill folder (daymade-macos/macos-watchdog in daymade/claude-code-skills) into .agents/skills/macos-watchdog in your project. Codex loads it when a task matches its description.

Can I use macOS Watchdog in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add daymade/claude-code-skills --skill macos-watchdog -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/macos-watchdog, .gemini/skills/macos-watchdog, .github/skills/macos-watchdog and .opencode/skills/macos-watchdog in your project.

What does macOS Watchdog need to run?

Going by SKILL.md and its folder, macOS Watchdog needs a shell for the scripts in its folder. Our summary lists: A Bash shell.

Does macOS Watchdog access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is macOS Watchdog safe to install?

Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does macOS Watchdog use?

macOS Watchdog is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does macOS Watchdog use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.6k tokens, read only when the agent opens those files.

What are the alternatives to macOS Watchdog?

Skills that share tags, products or a category with macOS Watchdog: Site Architecture (AvdLee/RocketSimApp, 804 stars), Engine Whats New (flutter/flutter, 179k stars), macOS Spm App Packaging (Dimillian/Skills, 4k stars) and Openclaw Live Updater (openclaw/openclaw, 392k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains macOS Watchdog?

daymade (a GitHub user) maintains it in daymade/claude-code-skills, which has 1,447 GitHub stars. The repository holds 103 skills in this directory. The repository was last updated on October 9, 2026.

Source: daymade/claude-code-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.