Scheduled Agent Jobs and Heartbeats
Run agents unattended: sort jobs into scheduled runs or silent heartbeats, then write launchd, cron, or systemd config that works.
Before & after
Same prompt, same agent — the only difference is the skill.
That's a good idea to automate agent work. You have a few options: You could set up a scheduled job to run the agent on a timer, maybe every morning or every week. Or you could set up monitoring that watches for specific events and only notifies you when something happens. The best approach depends on what reports you need and how often. Do you want daily summaries? Weekly reports? Are there specific alerts you need? I could help design a schedule, but I'd need to know more about what your agent does and when you need information.
AGENT AUTOMATION PLAN
CRON JOBS (always fire on schedule):
• Weekly YT Analytics Report
Frequency: Sunday 09:00 UTC
Output: CSV + Slack thread
Prompt: "Generate weekly subscriber, views, engagement, revenue snapshot"
Failure policy: Retry at 11:00 UTC, alert @drew if both fail
• Monday Planner Refresh
Frequency: Monday 06:30 UTC
Output: Agenda document + iMessage
Prompt: "Pull calendar, top 3 priorities, blocked time, meeting prep"
Quiet hours: None (critical morning planning)
HEARTBEAT JOBS (poll, alert only on match):
• VIP Inbox Monitor
Frequency: Every 15 minutes
Watch for: New emails from founder, tier-1 partners (10 contacts)
On match: Alert via Telegram @drew_alerts
Quiet hours: 22:00-07:00 UTC (except emergencies)
• Deal Slippage Detector
Frequency: Every 4 hours
Watch for: Opportunities with close_date < 7 days, no recent activity
On match: List slipping deals + suggested next action
Quiet hours: 19:00-09:00 UTC (business hours only)
CONFIGURATION:
{
"timezone": "America/Los_Angeles",
"notification_channel": "Telegram",
"failed_job_escalation": "email if 2 retries fail",
"quiet_hours_enforce": true,
"weekly_digest_send_time": "Saturday 19:00",
"min_heartbeat_frequency": "5m",
"max_context_tokens_per_run": 8000
}
STATUS:
✓ 2 cron jobs enabled
✓ 2 heartbeats polling
✓ Notifications routing to Telegram
✓ Last run: 2 hours ago (YT report completed 3m)About this skill
Make an agent run on its own without spamming you or silently dying. Each job becomes a scheduled run or a heartbeat that stays quiet unless something specific matches.
What it does
- Classifies each recurring job as always-fire or signal-only, with a testable match condition
- Picks the right scheduler for the host (launchd, systemd timer, cron, or hosted) and explains missed-run behavior
- Writes the headless agent command with absolute paths, pre-approved tools, and safe auth
- Adds locking, heartbeat dedupe, quiet hours, cheap pre-checks, failure escalation, and a dead-man check
What you get
A schedule plan table, ready-to-use config files, state and lock paths, a dead-man check, a test plan, and a labeled run-count and cost estimate.
Best for
Operators who have a working agent but still trigger it by hand, or whose scheduled agent never fires or alerts too often.
SKILL.md preview
---
name: agent-cron-and-heartbeat
description: Turn a manually triggered agent into one that runs on its own - sort each recurring job into an always-fire scheduled job or a silent heartbeat that only alerts on a match, then write the working config for cron, launchd, systemd timers, or a hosted scheduler, with headless `claude -p` invocation, locking, dedupe, quiet hours, and a dead-man check. Use when the user says "run this agent every morning", "schedule a weekly report", "ping me only if a VIP emails", "set up a cron job for Claude", "my cron job never runs", "my agent spams me", or casually "can this run by itself?"
---
# Scheduled Agent Jobs and Heartbeats
… (sign up to view the full skill)More ai & agents skills
View all AI & Agents skills →New Skill Scaffolder
Create a new Claude Code skill correctly: right mechanism, valid name and folder, a triggering description, and a smoke test.
Skill Library Lint and Overlap Report
Lint every skill in a repo at once: frontmatter, name-folder match, weak descriptions, overlapping triggers, broken refs, plus a CI script.
Self-Verifying Agent Loop: Plan, Check, Retry, Close
Turns a goal into a task plan with machine-run checks, executes with retry caps, escalates, and refuses to close until verified.
Skill Test Runner (Trigger and A/B)
Test a skill in fresh sessions: ready-to-run prompts, commands, and rubric for trigger recall, false triggers, and blind A/B.