Agent Self Scheduling logo

Agent Self Scheduling

Community
matyasstoch
agent-self-scheduling

How to make an AI coding agent run on a schedule, loop, or interval — cron jobs, heartbeats, self-starting/self-terminating loops, recurring autonomous checks. Use when the user asks to "run every N minutes/hours", "check something on a regular interval", "schedule a task", "run on a loop", "self-start", "heartbeat", "cron job for an agent", or wants an agent to fire periodically without manual launching. Covers two camps — one-shot agents you wrap in an external clock (Claude Code, Codex, Pi) vs agents with a built-in scheduler daemon (Hermes).

Overview

Publishermatyasstoch
Repositorydavid-skills
Skill nameagent-self-scheduling
Stars
61
Forks
11
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by matyasstoch on GitHub. Read the source before you install it.

Installation

Install the Agent Self Scheduling AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/matyasstoch/david-skills/tree/main/skills/autonomous-ai-agents/agent-self-scheduling
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/matyasstoch/david-skills.git /tmp/david-skills
mkdir -p .claude/skills
cp -r /tmp/david-skills/skills/autonomous-ai-agents/agent-self-scheduling .claude/skills/agent-self-scheduling
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Agent Self Scheduling in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Agent Self Scheduling on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Agent Self Scheduling is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Agent Self-Scheduling

Make an agent run periodically. First question: does the agent have a built-in scheduler, or do you own the clock?

Decision: pick the camp first

  • Need it NOW, agent has no scheduler, or sub-minute polling → Camp A (external clock).
  • Want managed recurring jobs, isolated sessions, chaining, loop safety → Camp B (Hermes built-in).

Universal floor: ALL cron is 1 minute (5-field expr, no seconds) — every camp. For sub-minute / sub-second you MUST use a dumb while ...; sleep N; done loop, a TS extension, or a webhook/event hook. Never put an LLM on a tight timer.


Camp A — One-shot agents, you own the clock

These run once and exit (amnesiac unless resumed). You schedule them externally.

One-shot invocations:

bash
claude -p "PROMPT" --output-format json --allowedTools "Read,Edit,Bash"  # Claude Code
codex exec --json "PROMPT"                                                # Codex
pi run "PROMPT"                                                           # Pi.dev (Mario Zechner; MIT; read/write/edit/bash + TS SDK)

Wrap in a clock — three options:

bash
# 1. cron (>= 1 min). Floor is 1 minute, 5 fields, NO seconds.
*/10 * * * * cd /path/to/project && pi run "check X and report" >> ~/agent.log 2>&1

# 2. systemd timer (Linux, survives reboot, better logging) — OnUnitActiveSec=10min

# 3. dumb loop (sub-minute, or when cron unavailable)
while true; do pi run "check X"; sleep 30; done

Camp A gotchas (all three break unattended runs if ignored):

  • Permissions block unattended runs. Pass --allowedTools (Claude) or a sandbox/auto-approve flag (Codex) or the run hangs on a prompt forever.
  • Use structured JSON output, not prose (--output-format json / --json) so the wrapper can parse the result deterministically.
  • Each run is amnesiac. No memory across runs unless you resume: codex exec resume --last. Otherwise persist state to a file the next run reads.

Pi specifics: Pi has NO built-in loop/scheduler/heartbeat by design — only the agent reasoning loop (not time-based). OpenClaw's runtime is built ON Pi but is a separate project. To schedule Pi: external cron/systemd, a while-sleep loop, or a TS extension for agent-side timers.

cmux (orchestration layer — NO scheduler)

cmux has NO scheduler/timer/watch/cron. It is visibility + orchestration only. Primitives: list-workspaces, read-screen (non-interruptive — safe to poll), send. An MCP wrapper cmux-agent-mcp exists.

Three ways to make cmux loop:

  • Orchestrator-driven — the orchestrator runs send → sleep → read-screen on its own clock.
  • Dumb wrapper — external while true; ...; sleep N; done.
  • Event-driven (preferred over polling) — use cmux notify + OSC 9/99/777 terminal hooks so work fires on a real signal instead of a timer. Cheaper and more responsive than read-screen polling.

Camp B — Hermes (built-in scheduler daemon)

Hermes ships a gateway that ticks every 60s and runs due jobs in fresh, isolated sessions. No external cron needed.

State-check first — is the gateway running?

bash
hermes gateway install            # user-level
hermes gateway install --system   # survives reboot (boot-time)

Create jobs (CLI or /cron add in TUI):

bash
hermes cron create "every 1h" "summarize new emails and report" --skill himalaya
hermes cron create "0 9 * * *" "post daily standup"      # cron expr
hermes cron create "30m" "one-shot reminder in 30 min"   # one-shot delay

Schedule formats: one-shot delays (30m, 2h), recurring (every 30m, every 1d), cron (0 9 * * *), ISO timestamps.

Hermes-unique capabilities:

  • Zero-token / no-agent mode — run a script on schedule, deliver its stdout verbatim. No LLM cost. Use for watchdogs/heartbeats where the script produces the exact message.
  • Chaining — context_from injects an upstream job's last output into a downstream job; combine with a working dir to pipeline jobs.
  • Self-terminating loops — a recurring job can stop itself when a condition is met.
  • Fresh self-contained sessions — each run starts clean; the prompt must carry all needed context (no chat history).
  • Loop safety — cron-run sessions CANNOT create more cron jobs (prevents runaway recursion). Don't try to schedule from inside a scheduled job.
  • Persistent /goal loop — long-running autonomous loop with pause/resume, separate from cron.

Heartbeat pattern (proactive self-check)

A heartbeat = a fast recurring tick that gates slower per-task checks, so one loop handles many intervals at different cadences.

  • In Camp B: a recurring Hermes job (e.g. every 5m) whose prompt/script checks a task list and only acts on tasks whose own interval is due. Use no-agent mode + a script for zero token cost when nothing's due.
  • In Camp A: same idea via a while-sleep loop that reads a tasks file and per-task last_run timestamps.
  • Save tokens: define active-hours and skip ticks outside them; skip the tick entirely when there's nothing due (stay silent — don't emit empty noise).

Verify it actually fires (do this before reporting success)

  1. Camp A: check the log file grows after one interval, or run the wrapped command once by hand and confirm clean JSON exit (0).
  2. Camp B: hermes cron list shows the job; check next_run; trigger once with a run-now to confirm it executes and delivers.
  3. Confirm permissions/sandbox flags are present (Camp A) — the #1 silent failure is a hung permission prompt.
  4. For heartbeats, confirm a tick with nothing-due stays silent (no spam).

Pitfalls

  • Cron CANNOT do sub-minute. Don't promise every 30s via crontab — use a loop.
  • Camp A unattended hangs without explicit tool allowlists / sandbox.
  • Don't schedule a job from inside a scheduled Hermes job (loop safety blocks it).
  • Each scheduled run is a fresh/amnesiac session — pass all context in the prompt or persist to a file.

Frequently asked questions

What does the Agent Self Scheduling AI skill do?

How to make an AI coding agent run on a schedule, loop, or interval — cron jobs, heartbeats, self-starting/self-terminating loops, recurring autonomous checks. Use when the user asks to "run every N minutes/hours", "check something on a regular interval", "schedule a task", "run on a loop", "self-start", "heartbeat", "cron job for an agent", or wants an agent to fire periodically without manual launching. Covers two camps — one-shot agents you wrap in an external clock (Claude Code, Codex, Pi) vs agents with a built-in scheduler daemon (Hermes).

Why use Agent Self Scheduling on TypingMind?

Because you install it once and use it with any model. Agent Self Scheduling is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Agent Self Scheduling in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/matyasstoch/david-skills/tree/main/skills/autonomous-ai-agents/agent-self-scheduling. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Agent Self Scheduling?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Agent Self Scheduling?

As many as you like. As long as a model supports skills, you can use Agent Self Scheduling with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Agent Self Scheduling AI skill free?

It is published on GitHub by matyasstoch. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇