agent-self-scheduling
Schedule AI agent runs with cron, loops, or external clocks while avoiding unsafe tight autonomous timers.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 13
- Forks
- 3
01 前言 Front Matter
- name
- agent-self-scheduling
- risk
- critical
- tags
- [ "agents", "scheduling", "automation", "cron" ]
- tools
- [ "claude", "codex" ]
- author
- davidondrej
- source
- community
- license
- MIT
- category
- agent-orchestration
- date_added
- 2026-07-07
- description
- Schedule AI agent runs with cron, loops, or external clocks while avoiding unsafe tight autonomous timers.
- source_repo
- davidondrej/skills
- source_type
- community
- license_source
- https://github.com/davidondrej/skills/blob/main/LICENSE
02 资源文件 51
- 许可证LICENSE1.1 KB
- 参考文档references/advanced-exploits-2.md29.8 KB
- 参考文档references/advanced-exploits-3.md32.7 KB
- 参考文档references/advanced-exploits-4.md30.7 KB
- 参考文档references/advanced-exploits-5.md6.4 KB
- 参考文档references/advanced-exploits.md35.2 KB
- 参考文档references/advanced.md14.5 KB
- 参考文档references/basic-chain.md7.3 KB
- 参考文档references/bundled-runtime.md3.1 KB
- 参考文档references/core-preconditions.md2.8 KB
- 参考文档references/field-notes.md25.9 KB
- 参考文档references/format-string.md32.5 KB
- 参考文档references/game-pwn.md7.7 KB
- 参考文档references/heap-fsop.md15.1 KB
- 参考文档references/heap-techniques-2.md20.0 KB
- 参考文档references/heap-techniques.md32.1 KB
- 参考文档references/heap-version-evidence.md3.0 KB
- 参考文档references/kernel-bypass.md19.8 KB
- 参考文档references/kernel-techniques.md18.8 KB
- 参考文档references/kernel.md32.2 KB
- 参考文档references/libxml2-state-lifetime.md2.3 KB
- 参考文档references/mallocng-evidence.md2.2 KB
- 参考文档references/multi-stage-local.md4.9 KB
- 参考文档references/overflow-basics.md26.4 KB
- 参考文档references/relay-session-contracts.md5.9 KB
- 参考文档references/rop-advanced.md32.5 KB
- 参考文档references/rop-and-shellcode.md28.3 KB
- 参考文档references/sandbox-escape.md15.3 KB
- 参考文档references/seccomp-evidence.md2.0 KB
- 参考文档references/sqlite-extension.md2.3 KB
- 参考文档references/tools.md1.7 KB
- 参考文档references/windows-abi-rop.md1.8 KB
- 参考文档references/windows-heap.md2.0 KB
- 参考文档references/windows-mitigations.md3.1 KB
- 参考文档references/windows-pwn.md2.4 KB
- 脚本scripts/bundled_runtime.py12.6 KB
- 脚本scripts/fmtstr_payload_suite.py3.2 KB
- 脚本scripts/local_lab.py13.6 KB
- 脚本scripts/pe_triage.py9.3 KB
- 脚本scripts/pwn_triage.py7.2 KB
- 脚本scripts/relay_codec.py11.0 KB
- 脚本scripts/ret2libc_two_stage.py2.6 KB
- 脚本scripts/seccomp_bpf.py8.4 KB
- 脚本scripts/seccomp_orw_generator.py3.3 KB
- 脚本scripts/shellcraft_asm.py2.5 KB
- 脚本scripts/sqlite_api_map.py11.0 KB
- 脚本scripts/srop_execve.py2.8 KB
- 脚本scripts/stream_io.py10.4 KB
- 参考文档skill-materials.json73 B
- 参考文档SOURCE.md361 B
- 参考文档TRUST.auto.yaml2.1 KB
03 SKILL.md 正文
Agent Self-Scheduling
When to Use
- Use when the user asks for recurring, scheduled, heartbeat, or looped agent work.
- Use when you need to choose between cron, external schedulers, hooks, or built-in agent scheduling.
Scheduling requires a direct user request; a guide or task-list entry is not permission to create background work. Preserve timezone, cadence, notification preferences and stop conditions; update an existing matching job instead of duplicating it. External messages and posting require explicit authorization.
First inspect the actual host: prefer its supported scheduler/heartbeat when available (including Codex automations); otherwise use an explicitly authorized external clock. Host capabilities are not determined solely by the runtime name.
Traditional five-field cron has one-minute granularity; other schedulers differ. Prefer event-driven checks and an appropriate cadence. Avoid tight LLM timers and indefinite loops.
Camp A — one-shot agents, you own the clock
These run once and exit (amnesiac unless resumed). Schedule them externally.
claude -p "PROMPT" --output-format json --allowedTools "Read" # Claude Code
codex exec --json "PROMPT" # Codex
pi run "PROMPT" # Pi
Wrap in a clock:
# 1. cron (>= 1 min floor)
*/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 no cron available)
# If an external loop is required, bound its lifetime and implement a stop flag and overlap lock.
# Do not install an indefinite model-calling loop by default.
Gotchas (each breaks unattended runs if ignored):
- Permissions hang forever. Use the host's supported narrowly scoped permissions for the agreed task. Do not disable sandboxing or broadly auto-approve commands to avoid an unattended prompt; report unavailable required approval.
- Use JSON output (
--output-format json/--json) so the wrapper parses results deterministically. - Runs are amnesiac. Resume the exact recorded task/session ID or persist private scoped state.
--lastcan select an unrelated task and is unsuitable for an unattended multi-project schedule.
Pi has NO built-in scheduler/loop/heartbeat by design — external clock only (or a TS extension for agent-side timers).
cmux — orchestration only, NO scheduler
cmux has no timer/watch/cron. Three ways to loop it: orchestrator-driven (send → sleep → read-screen on your own clock), a dumb while-sleep wrapper, or — preferred — event-driven via cmux notify + OSC terminal hooks, which is cheaper and more responsive than polling. read-screen is non-interruptive, safe to poll.
For a monitor, stay quiet while state is unchanged unless the user requests periodic updates; notify on meaningful change, completion, failure or needed input. (Claude Code may prefill a predicted next user message after finishing — that's Claude, not the user.)
Camp B — Hermes built-in scheduler
Hermes' gateway ticks every 60s and runs due jobs in fresh isolated sessions. State-check first:
hermes gateway install # user-level ( --system to survive reboot)
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
Hermes-unique: zero-token mode (run a script, deliver stdout verbatim — use for watchdogs), chaining (context_from pipes one job's output into the next), self-terminating loops, and loop safety (scheduled sessions cannot create more cron jobs — don't schedule from inside a scheduled job). Each run is a fresh session: the prompt must carry all context.
Heartbeat pattern
One fast recurring tick gates many slower per-task checks: the tick reads a task list + per-task last_run timestamps and only acts on tasks that are due. In Hermes use a recurring job (zero-token mode when nothing's due); in Camp A use a while-sleep loop. Define active-hours, and stay silent when nothing is due — no empty noise.
Verify it fires (before reporting success)
- Camp A: log file grows after one interval, or run the wrapped command once by hand → clean JSON, exit 0.
- Camp B:
hermes cron listshows the job + sanenext_run; trigger a run-now to confirm delivery. - Confirm least-privilege permissions, overlap protection, bounded retries/timeouts, private logs and a working disable/remove path. An unavailable approval is a reported failure, not justification for a bypass.
- Heartbeats: confirm a nothing-due tick stays silent.
Limitations
- Adapted from
davidondrej/skills; verify local paths, tools, credentials, and agent features before acting. - For commands, remote access, scheduling, browser automation, or file-changing workflows, get explicit user approval and confirm the target environment first.
04 同仓库更多 Skills
scrapely-scrape
Collect web data with ready-made Scrape.ly scrapers: Google Maps places, Amazon products, LinkedIn jobs, reviews, social posts. Use when the user wants structured data from a site.
lumify-odds
Lumify's hosted sports MCP/REST API for sportsbook odds, line-movement history, public betting splits, and player props across MLB, NFL, NBA, NHL, soccer, tennis, NCAAF, NCAAB. Read-only market data.
sync-lipsync
Lip-sync an existing video of a real person to new audio or a typed script with sync. labs through its hosted MCP server, quoting the cost and waiting for approval first.
music-for-robots
Optional music-inspired creative exercise for multimodal agents. Ingests an unquantized acoustic MP3 composition by Michael Luchtan (Music For Robots) into a private temporary directory, analyzing microtiming and texture to inspire creative writing, brainstorming, or technical tasks.
imagera-media
Generate or edit images, video clips, voiceovers and music through the hosted Imagera MCP server, quoting the credit cost and getting approval before each paid call.
deja-history
Search this machine's past AI coding sessions across Claude Code, Codex, Cursor, Gemini CLI and thirty-nine other agents before editing, debugging, or denying something exists.