{"data":{"slug":"discovered-5f5e54bb40ab45f5dff57bc815bfb3d4c23ede08bf3ccc33","title":"Launchd Agenda - Schedule Claude Code Sessions on macOS","summary":"Schedule a Claude Code session to run on this Mac at a set time using launchd, locally, with the user's skills, hooks, MCP servers, and files, through the `claude-agenda` command.","url":"https:\/\/skillshunter.net\/skills\/discovered-5f5e54bb40ab45f5dff57bc815bfb3d4c23ede08bf3ccc33","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-5f5e54bb40ab45f5dff57bc815bfb3d4c23ede08bf3ccc33","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-5f5e54bb40ab45f5dff57bc815bfb3d4c23ede08bf3ccc33.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-5f5e54bb40ab45f5dff57bc815bfb3d4c23ede08bf3ccc33\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Ensure `claude-agenda` is installed by running `.\/install.sh` from the plugin folder (`${CLAUDE_PLUGIN_ROOT}\/install.sh`) if the command is not found. The `--prompt` should end with \"When done, run `claude-close-self`\" to allow the session to close automatically after the final answer.","instructions":"---\nname: launchd-agenda\ndescription: Schedule a Claude Code session to run on this Mac at a set time with launchd, locally, with the user's skills, hooks, MCP servers and files, through the `claude-agenda` command. Use when the user says \"schedule this\", \"run \/some-skill every Monday at 9\", \"every night at 23:00 do X\", \"tomorrow at 8 run Y\", \"agenda\", \"agendar\", \"list the scheduled Claude jobs\", \"remove that schedule\", or asks for a local cron for Claude. Not for cloud routines, which run on a remote machine.\nversion: \"0.3.0\"\nmetadata:\n  author: Lucas Saldanha Werneck <lucas@2olhares.com>\n  tags: [macos, launchd, schedule, cron, tmux]\n---\n\n# launchd-agenda\n\n## Purpose\n\nSchedule a launchd job, through the `claude-agenda` command, that opens an interactive Claude Code session\n(in a detached tmux session) at the given times, with a prompt as the first message. macOS only.\nThe command keeps its name; the skill is called `launchd-agenda`.\n\n## Instructions\n\n1. Find the command (`command -v claude-agenda`); if it is missing, tell the user to run `.\/install.sh`.\n2. Read `~\/.config\/claude-agenda\/config.json` if it exists (label prefix, default folder, launcher).\n3. Build the `claude-agenda add NAME --prefix PREFIX --prompt \"TEXT\" --at HH:MM ...` call and run it with `--dry-run`.\n4. Show the schedule in one line; add `--load` when the user already asked for it, otherwise ask first.\n5. Confirm with `claude-agenda list` and `launchctl print gui\/$(id -u)\/<label>`.\n\n## Find the command\n\n1. `command -v claude-agenda` - use it if found (installed by `install.sh`, path stays stable).\n2. Otherwise tell the user to run `.\/install.sh` from the plugin folder\n   (`${CLAUDE_PLUGIN_ROOT}\/install.sh`). Do not write a plist that points into the plugin cache:\n   that path changes on every plugin update and the job would break.\n\n## Create a job\n\n```\nclaude-agenda add NAME --prefix PREFIX --prompt \"TEXT\" --at HH:MM \\\n  [--weekday mon --weekday fri] [--day 15] [--date YYYY-MM-DD] \\\n  [--dir \/path\/to\/project] [--remote-control] [--load] [--force]\n```\n\n- `NAME`: short job id (letters, digits, dashes). The launchd label is `<label-prefix><NAME>`.\n- `PREFIX`: short upper-case tag for the session title (`PREFIX DD-MM`). A previous session with the\n  same prefix is closed if idle, and the run is skipped if it is still working or waiting for a\n  permission or an answer.\n- `--prompt`: the first message, often a slash command (`\/weekly-report`). End it with\n  \"When done, run `claude-close-self`.\" so the session closes itself after the final answer.\n- `--dir`: the folder the session opens in (default: current folder).\n- `--date`: one-time job, the next such date within 12 months (launchd has no year; a YYYY for a later year is refused). `launchd-overdue` turns it off after the date.\n- `--remote-control`: start the session with Remote Control, to follow it from the app or phone.\n- `--force`: replace an existing job with the same NAME (without it, `add` refuses). Use it only\n  when the user wants that job changed.\n- No `--weekday`\/`--day`\/`--date` = every day.\n\nSteps:\n1. Run the command with `--dry-run` first and show the user the schedule in one line.\n2. If the user already asked for the schedule, run it again with `--load`. Otherwise ask first.\n3. Confirm with `claude-agenda list` and `launchctl print gui\/$(id -u)\/<label>` (look for `state`).\n\n## Other commands\n\n- `claude-agenda list` - jobs with this label prefix and their times.\n- `claude-agenda remove NAME` - unloads and deletes the job.\n- `claude-agenda run PREFIX \"PROMPT\" --dir DIR --dry-run` - shows what a run would do, opens nothing.\n- `launchd-overdue --dry-run` - lists one-time jobs whose date has passed.\n\n## Settings\n\nThe user's settings are in `~\/.config\/claude-agenda\/config.json` (label prefix, default folder, their\nown `launch_command`, the yearly-jobs file, ...) and `~\/.config\/claude-agenda\/close-self-allow` (extra\ntmux session names `claude-close-self` may close). Both are outside the plugin, so they survive updates.\nRead them before creating a job if they exist: the label prefix there is the one `add` uses, and with a\n`launch_command` the session is opened by the user's launcher, not by tmux directly. The README lists every\nkey. `claude-agenda PREFIX \"PROMPT\"` (no `run`) is accepted too, for jobs written by hand.\n\nLogs: `~\/Library\/Logs\/claude-agenda.log` (each run), `~\/Library\/Logs\/claude-agenda.out` (launchd output).\n\n## Examples\n\n- \"Every Monday at 9 run \/weekly-report in ~\/code\/my-app\":\n  `claude-agenda add weekly-report --prefix REPORT --at 09:00 --weekday mon --dir ~\/code\/my-app --prompt \"\/weekly-report. When done, run claude-close-self.\" --load`\n  (after a `--dry-run`); a session titled `REPORT DD-MM` opens every Monday at 09:00.\n- \"Tomorrow at 8 run Y\": a one-time job with `--date YYYY-MM-DD --at 08:00`; `launchd-overdue` turns it off after the date.\n- \"List the scheduled Claude jobs\": `claude-agenda list` prints each job with its times and prompt.\n- \"Remove that schedule\": `claude-agenda remove NAME` unloads and deletes the job.\n\n## Prerequisites\n\n- macOS (launchd), `python3` 3.8+, `tmux` and Claude Code (`claude`).\n- The `claude-agenda` command, installed by `install.sh` (not run from the plugin cache, whose path changes on every update).\n\n## Limitations\n\n- Scheduling is macOS only; on Linux nothing schedules the jobs.\n- launchd has no year: a `--date` job fires on the next such date within 12 months.\n- A run is skipped while the previous session with the same prefix is working or waiting for a permission or an answer.\n\n## Troubleshooting\n\n- A job did not run or failed: read `~\/Library\/Logs\/claude-agenda.log` (each run, with the reason for a skip) and `~\/Library\/Logs\/claude-agenda.out` (launchd output).\n- Check the job is loaded: `launchctl print gui\/$(id -u)\/<label>` (look for `state`).\n- `add` fails with \"already exists\": pass `--force` only when the user wants that job replaced.\n- Folders protected by macOS (Desktop, Documents, cloud drives) may need Full Disk Access for the `claude` binary, because launchd runs outside the terminal app.\n","use_cases":["Schedule a Claude Code session to run every Monday at 9 AM.","Run a specific slash command in Claude Code every night at 11 PM.","Create a one-time job to execute a task on a specific date.","List and manage scheduled Claude Code jobs using the `claude-agenda list` command."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/lucas-saldanha-werneck\/launchd-agenda\/blob\/fb7e50715936fd4ae0fdc11843dd7dda460296c1\/skills\/launchd-agenda\/SKILL.md","source_commit":"fb7e50715936fd4ae0fdc11843dd7dda460296c1","license":null,"version":null,"listing_approved_at":"2026-12-01","created_at":"2026-11-30T08:07:27.000000Z","updated_at":"2026-12-01T12:48:20.000000Z","seo_title":"Schedule Claude Code Sessions on macOS with launchd-agenda","seo_description":"Use launchd-agenda to schedule Claude Code sessions on macOS using launchd. Run tasks at specific times with the `claude-agenda` command.","seo_keywords":["launchd-agenda","schedule claude code","macos launchd","claude code cron","schedule code sessions","tmux claude","macos task scheduler"]}}