Claude scheduler
Schedule recurring Claude prompt tasks via the system scheduler (launchd on macOS; systemd --user or crontab on Linux). Invoke when the user asks for a recurring Claude task — triggers include "每天/每周/每小时", "定时", "schedule a claude task", "daily report", "weekly review", "run this prompt every N days", "后台跑 Claude". Claude creates, lists, and removes tasks autonomously through the `scheduler` CLI. Do not use for plain shell cron jobs — route those to cron/at directly.From its SKILL.md
npx -y skills add bob798/ai-skill-kit --skill claude-schedulerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.4 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
claude-scheduler
Claude runs this skill by calling the scheduler CLI via the Bash tool. You have been pre-authorized: creating a task activates it immediately; removing a task unregisters and deletes it without confirmation.
Locate the CLI relative to this skill file (it lives next to SKILL.md). Prefer invoking it by absolute path, e.g. /path/to/claude-scheduler/scheduler.
When to invoke
Invoke this skill when the user asks for something that should happen on a recurring schedule and needs Claude reasoning each time:
- "每天九点写日报"
- "每周五下午 5 点汇总 git 活动"
- "Every weekday morning, check my inbox and summarize"
- "Run this prompt daily at 08:00"
Do NOT invoke for:
- Plain shell commands on a schedule (use
cron/atdirectly). - One-off runs (just call
claude -pinline). - Windows targets (unsupported).
CLI cheatsheet
scheduler add <name> \
--schedule "<expr>" \ # REQUIRED
--prompt-file <path> \ # REQUIRED
[--output-file <path>] \
[--output-dir <path>] \
[--allowed-tools "<list>"] \
[--add-dirs "<comma,list>"] \
[--skip-if-exists true|false]
scheduler list [--json]
scheduler rm <name>
scheduler run <name> [YYYY-MM-DD]
scheduler status [<name>]
<expr> accepts three forms:
"daily HH:MM"→ fires every day at HH:MM"weekdays HH:MM"→ Monday–Friday at HH:MM"M H * * D"→ cron form;Dmust be*or1-5
Output paths support $DATE, $HOME, and ~.
Typical recipes
1. Daily report at 09:00, weekdays only
Step 1 — write the prompt to disk (e.g. ~/prompts/daily.md):
cat > ~/prompts/daily.md <<'PROMPT'
Read ~/lifelog/$(date +%Y-%m-%d).md and git activity in ~/workspace,
produce a concise daily report in Markdown.
PROMPT
Step 2 — register:
scheduler add daily-report \
--schedule "weekdays 09:00" \
--prompt-file ~/prompts/daily.md \
--output-dir ~/workspace/daily-reports \
--allowed-tools "Bash(git:*) Read Glob" \
--add-dirs "~/workspace,~/lifelog"
2. Weekly code review every Friday 17:00
scheduler add weekly-review \
--schedule "0 17 * * 5" \
--prompt-file ~/prompts/weekly-review.md \
--output-file ~/reports/weekly-$DATE.md \
--allowed-tools "Bash(git:*) Read Glob Grep"
3. Hourly inbox triage (cron form)
scheduler add inbox-triage \
--schedule "0 * * * *" \
--prompt-file ~/prompts/inbox.md
Wait — * in the day-of-week slot is supported; 0 * * * * runs every hour.
4. Inspect and remove
scheduler list --json
scheduler status daily-report
scheduler rm inbox-triage
Contract guarantees (runtime guardrails)
- Stderr from
claude -pis captured to a per-task log (~/Library/Logs/claude-scheduler-<name>.logon macOS,~/.local/state/claude-scheduler/<name>.logon Linux). - Output files are written atomically via
mktemp+mv; a failed run never pollutes the previous output. --skip-if-exists true(default) lets a task be re-triggered safely without overwriting an already-produced file.
Authorization model
You may create, modify, and remove tasks without asking. Mention the created task name and schedule in your reply so the user can correct you afterward. If the user asks "what did you schedule?", run scheduler list and show the output.
Backend selection
The CLI probes in order:
- macOS →
launchd(writes~/Library/LaunchAgents/com.claude.scheduler.<name>.plist) - Linux →
systemd --userif available (writes~/.config/systemd/user/claude-scheduler-<name>.{service,timer}) - Fallback →
crontab(adds a marker-commented line:# claude-scheduler:<name>)
You do not need to pick the backend explicitly — the CLI handles it.
Getting help
Every subcommand supports --help. Run scheduler --help for the top-level menu.
What ships with it: 13 files
54.1 KB alongside SKILL.md, 10 of them executable
lib/
- backends/cron.shruns3.6 KB
- backends/launchd.shruns4.5 KB
- backends/systemd.shruns4.3 KB
- common.shruns9.6 KB
- task.shruns3.3 KB
tasks/
- install.shruns2.6 KB
- README.md6.7 KB
- schedulerruns17.0 KB
- scheduler.shruns808 B
- status.shruns290 B
- uninstall.shruns350 B