From agent
Manages persistent scheduled reminders (crons): list, create from natural language (English/Spanish), delete, pause/resume, reconcile, import from OpenClaw. Triggers on commands and phrases.
npx claudepluginhub crisandrews/clawcode --plugin agentThis skill uses the workspace's default tool permissions.
This workspace maintains a persistent cron registry at `memory/crons.json` — the source of truth for every scheduled task across sessions. The SessionStart hook reconciles it against the live harness; the PostToolUse hook captures ad-hoc `CronCreate`/`CronDelete` calls automatically.
Guides precise Cron scheduling in OpenClaw for reliable reminders, periodic maintenance like janitor jobs, and Heartbeat vs Cron decisions. Covers JSON payloads, cleanup, and timezone handling.
Schedules recurring and one-off tasks via local OS cron/Task Scheduler or remote Anthropic Cron APIs. Supports list/add/remove with quota-aware defaults.
Manages scheduled Claude Code tasks: add recurring/one-off skills/prompts/scripts, list/pause/resume/remove, view results/logs, test execution with safety controls and notifications. Cross-platform (macOS/Linux/Windows).
Share bugs, ideas, or general feedback.
This workspace maintains a persistent cron registry at memory/crons.json — the source of truth for every scheduled task across sessions. The SessionStart hook reconciles it against the live harness; the PostToolUse hook captures ad-hoc CronCreate/CronDelete calls automatically.
All writes to the registry go through one script: bash ${CLAUDE_PLUGIN_ROOT}/skills/crons/writeback.sh <subcommand>. Never edit memory/crons.json by hand.
CronCreate / CronList / CronDelete are deferred tools — call ToolSearch(query="select:CronList,CronCreate,CronDelete") once per session before invoking them. The parameter name is cron, not schedule. Always pass durable: true (forward-compat for when the upstream flag is fixed).
These rules are non-negotiable. Violating any of them silently breaks reminders for the user.
Never compute cron expressions yourself. LLMs miscompute timezones inconsistently (sometimes UTC, sometimes local — verified empirically). Claude Code's cron daemon uses the host's LOCAL time. The only correct way to produce a cron expression is to call bash $CLAUDE_PLUGIN_ROOT/bin/cron-from.sh .... The helper does deterministic epoch arithmetic and returns cron + human-readable confirmation in the host's TZ. (Enforced: a PreToolUse hook blocks CronCreate with exit 2 unless the cron expression matches a cron-from.sh output from the last 120s. If the mode you need isn't covered by relative/absolute/recurring, use cron-from.sh passthrough "<cron>" as an escape hatch.)
Never use ScheduleWakeup for user-facing commitments. ScheduleWakeup is intra-session only (dies on /exit). Any reminder, alert, or recurring task the user requests via chat MUST go through CronCreate(durable: true). The reconcile hook keeps it alive across restarts.
Never tell the user the reminder is "session-only", "may not arrive", or any equivalent degraded-persistence phrasing in any language. With this skill, every commitment is durable. If you genuinely cannot create the cron (e.g. helper failed), surface the error to the user — don't silently degrade to a verbal-only promise.
Never call writeback.sh upsert after a CronCreate for an ad-hoc reminder. The PostToolUse hook captures it automatically with source: ad-hoc. Manual upsert would duplicate. (Enforced: writeback.sh upsert refuses with exit 5 if an active entry with the same cron + prompt already exists under a different key. If you see that error, the hook already did its job — drop your manual upsert call.)
When the agent thinks "I know what time +2 minutes is, I'll just compute the cron myself" and skips the helper, this is the bug that ships:
Now (local): 15:21 (UTC-4, Santiago)
User asks: "recordame en 2 minutos"
Agent computes: 15:21 + 2 = 15:23 → grabs UTC hour by mistake
→ cron = "23 19 19 4 *" ← hour 19 (UTC), not 15 (local)
Daemon fires at: 19:23 LOCAL (cron uses local time of host)
= 7:23 PM = 4 hours late
The helper exists exactly to prevent this. There is no situation in which computing a cron expression in your head is acceptable — even for "obvious" cases like "in 2 minutes". Always run bash $CLAUDE_PLUGIN_ROOT/bin/cron-from.sh ... first.
Parse the user's phrasing and route to the right flow:
| Phrasing | Subcommand |
|---|---|
/agent:crons list, /agent:reminders, "list reminders", "show crons", "recordatorios", "mis crons", or no args (registry populated) | LIST |
/agent:crons add <cron> <prompt>, "add reminder", "agrega un recordatorio", plus all natural-language requests for a future-time commitment: "recordame en X", "me recuerdas en X", "hazme acordar X", "avísame a las X", "agendame X", "remind me in X", "remind me at X", "every Monday at X", "todos los lunes a X", "cada N minutos/horas", etc. | ADD |
| `/agent:crons delete <key | N>`, "delete reminder X", "borra el recordatorio X" |
/agent:crons pause <key>, "pausa reminder X" | PAUSE |
/agent:crons resume <key>, "reanuda X" | RESUME |
/agent:crons reconcile, "reconcile" | RECONCILE |
/agent:crons import, "importar crons", "traer crons", or no args (OpenClaw source present + registry empty) | IMPORT |
Call CronList. Output is plain text, one line per live job:
<8hex-id> — <cron-expr> (recurring|one-shot) [session-only|durable]: <prompt>
Empty state is the literal string No scheduled jobs..
Read the registry:
cat "$CLAUDE_PROJECT_DIR/memory/crons.json" | jq -c '.entries[]'
For each registry entry (skip tombstone != null unless the user asks for audit):
harnessTaskId appears in CronList.paused: true.tombstone != null (only show if user asked).Render a compact table. Example:
# STATUS KEY CRON PROMPT
1 ✅ heartbeat-default */30 * * * * Run /agent:heartbeat
2 ✅ dreaming-default 0 3 * * * Use the dream tool...
3 ⏸ harness-abc12345 0 9 * * * recordame estirarme
Re-read the ⛔ FORBIDDEN block above before every ADD. The "Common failure pattern" section is the exact bug you will ship if you skip it.
Before saying anything to the user, before calling any tool other than the helper, identify the natural-language time phrase in the user's message and run bash $CLAUDE_PLUGIN_ROOT/bin/cron-from.sh ... (Step 1+2). Only then proceed to CronCreate (Step 3) and the user reply (Step 4). Do not narrate "I will now run the helper" — just run it.
Map the user's phrasing to one of the helper's three modes:
| User says | Helper invocation |
|---|---|
| "recordame en 3 minutos X", "remind me in 5 min" | cron-from.sh relative 3 minutes |
| "en 2 horas", "in 1 hour" | cron-from.sh relative 2 hours |
| "en 3 días" | cron-from.sh relative 3 days |
| "a las 14:30", "at 2:30pm" | cron-from.sh absolute "14:30" (auto-rolls to tomorrow if past) |
| "mañana a las 9", "tomorrow at 09:00" | cron-from.sh absolute "09:00" tomorrow |
| "todos los días a las 8", "every day at 8am" | cron-from.sh recurring daily "08:00" |
| "todos los lunes a las 9", "every Monday at 9am" | cron-from.sh recurring weekly mon "09:00" |
| "cada 30 minutos", "every 30 minutes" | cron-from.sh recurring every 30 minutes |
| "cada 2 horas" | cron-from.sh recurring every 2 hours |
If the user's request is ambiguous (e.g. "recordame mañana" without a time, or "every week" without a day), use AskUserQuestion to pin it down before calling the helper:
question: "¿A qué hora?",
options: [ "09:00", "14:00", "18:00", "otra" ]
bash "$CLAUDE_PLUGIN_ROOT/bin/cron-from.sh" <args>
Example for "recordame en 3 minutos":
bash "$CLAUDE_PLUGIN_ROOT/bin/cron-from.sh" relative 3 minutes
Output (single-line JSON — parse with jq):
{"cron":"25 13 19 4 *","human_local":"13:25 (Sun 19 Apr)","iso_local":"2026-04-19T13:25:00-0400","epoch":1776619500,"recurring":false,"kind":"relative"}
Use .cron verbatim for CronCreate. Use .human_local for the user confirmation. If the helper exits non-zero, show its stderr to the user — do NOT fall back to self-computed crons.
ToolSearch(query="select:CronCreate") # once per session
CronCreate(
cron: "<output.cron>",
prompt: "<action to fire; see reminder prompt template below>",
durable: true,
recurring: <output.recurring as boolean>
)
The PostToolUse hook captures the new cron into memory/crons.json with source: ad-hoc and key harness-<task_id>. Do NOT call writeback.sh upsert afterward — the hook handles it.
When the cron fires, the agent is given the prompt text as a new turn. Write it so the agent knows exactly what to do. Keep the structural words (Reminder for, Reply via, Message style) in English so the firing agent parses reliably; write the user-facing message in the user's conversation language <lang>.
Reminder for <user>: <thing-to-remember>. Reply via the <channel> reply tool
to chat <chat-id>. Message style (<lang>): "<short-natural-message-in-user-lang>".
Example for an es user on WhatsApp:
Reminder for JC: buy vitamins. Reply via the WhatsApp reply tool to
chat 199999598137448@lid. Message style (es): "JC, acuérdate de comprar vitaminas 💊".
Reply in the user's conversation language (<lang>). Use human_local from the helper output for the time, never invent it. Examples (substitute <lang> accordingly):
Done. I'll remind you at <human_local> to <thing>.Listo. Te aviso a las <human_local> para <thing>.Pronto. Te aviso às <human_local> para <thing>.Never say "session-only", "may not arrive", "vive en esta sesión", "puede que no llegue", or any equivalent degraded-persistence wording in any language. The registry + reconcile guarantees the cron survives session restarts.
Resolve the user's target to a registry key. Accept either:
harness-abc12345)list outputRead registry to find the entry's harnessTaskId and display the cron + prompt.
Use AskUserQuestion to confirm:
question: "¿Borrar el recordatorio '<prompt>' (<cron>)?",
header: "Confirmación",
options:
- label: "Sí, borrar"
- label: "Cancelar"
If confirmed:
CronDelete(id=<harnessTaskId>). PostToolUse auto-tombstones on success.harnessTaskId (already dead / paused), manually tombstone it via:
bash "$CLAUDE_PLUGIN_ROOT/skills/crons/writeback.sh" tombstone --key <key>
Pause keeps the registry entry but removes the cron from the harness. Useful for "silence this reminder but don't lose it".
Touch the suppression marker so PostToolUse won't tombstone on the upcoming CronDelete:
touch "$CLAUDE_PROJECT_DIR/memory/.reconciling"
Read the entry's current harnessTaskId. If non-null, call CronDelete(id=<id>).
Mark paused in the registry:
bash "$CLAUDE_PLUGIN_ROOT/skills/crons/writeback.sh" pause --key <key>
Remove the marker:
rm -f "$CLAUDE_PROJECT_DIR/memory/.reconciling"
Confirm: ⏸ <key> pausado. Usa "/agent:crons resume <key>" para reactivar.
Touch the suppression marker:
touch "$CLAUDE_PROJECT_DIR/memory/.reconciling"
Read the entry's cron, prompt, recurring from the registry.
Call CronCreate(cron, prompt, durable=true, recurring). Capture the new 8hex task_id from the response.
Record the new link:
bash "$CLAUDE_PLUGIN_ROOT/skills/crons/writeback.sh" resume --key <key> --harness-task-id <new_task_id>
Remove the marker:
rm -f "$CLAUDE_PROJECT_DIR/memory/.reconciling"
Confirm: ▶️ <key> reactivado.
Run the same logic as SessionStart reconcile, on demand:
CronList.harnessTaskId is not in CronList output: CronCreate + writeback.sh set-alive.writeback.sh adopt-unknown to capture any live-but-unknown crons.Used when the user has an existing ~/.openclaw/cron/jobs.json from a previous OpenClaw agent and wants to port those reminders into this workspace.
Imports need custom registry keys (openclaw-<uuid>) and source: openclaw-import. Since PostToolUse would otherwise capture each CronCreate as source: ad-hoc with harness-<id> key, suppress it for the duration:
touch "$CLAUDE_PROJECT_DIR/memory/.reconciling"
Remove the marker at the end of the batch (or via trap on error).
cat ~/.openclaw/cron/jobs.json
The file shape is {"version": 1, "jobs": [...]}. Each job:
{
"id": "uuid",
"agentId": "main",
"name": "Job Name",
"enabled": true,
"schedule": { "kind": "cron", "expr": "0 14 * * 3,6", "tz": "America/Santiago" },
"payload": { "kind": "agentTurn", "message": "prompt here", "model": "opus" },
"delivery": { "mode": "announce", "channel": "whatsapp" }
}
Iterate data["jobs"], not data.
Use the active agent's ID (check IDENTITY.md or agent-config.json). If ambiguous, ask the user with AskUserQuestion.
HARD_RED='sessions_spawn|gateway config\.patch|http://192\.168\.|canvas\(|remindctl|wacli|openclaw gateway|HEARTBEAT_OK|NO_REPLY|peekaboo'
SOFT_YELLOW='sessions_send|message\(|~/\.openclaw/|\.openclaw/credentials'
| Tier | Criteria | Action |
|---|---|---|
| 🟢 GREEN | enabled: true, kind: cron, payload.kind: agentTurn, no HARD_RED match, delivery.channel plugin installed (if any) | Import as-is |
| 🟡 YELLOW | kind: at with future timestamp, kind: every (convertible), uninstalled channel, or SOFT_YELLOW match | Import with adapted prompt + fallback note |
| 🔴 RED | enabled: false, expired at, kind: systemEvent, or HARD_RED match | Skip. Record reason. |
Record the specific reason per item (which token matched which field).
AskUserQuestionquestion: "<agent> tiene <N> crons importables. ¿Qué hacés?",
header: "Importar crons",
options:
- label: "Importar todos (G+Y)"
- label: "Elegir uno por uno"
- label: "Listar con status primero"
- label: "Saltar"
| OpenClaw field | CronCreate parameter | Notes |
|---|---|---|
schedule.expr | cron (5-field) | Direct. Drop tz (Claude Code uses local time). |
schedule.kind: "at" | cron + recurring: false | Convert ISO timestamp to minute-precision cron for that date. |
schedule.kind: "every" | cron = */N * * * * | N = max(1, round(everyMs / 60000)) |
payload.message | prompt | Apply token adaptation (below). |
name | (not a parameter) | Include as a prefix comment inside the prompt for identification. |
delivery.channel: "whatsapp" | Appended to prompt | "Send the result via WhatsApp reply tool; fallback to memory file if plugin not loaded." |
Prepend: You are running as agent <Name>. Read SOUL.md, IDENTITY.md, USER.md for context.
Replace inside the message:
sessions_spawn(...) → Use the Agent tool (one-shot delegation)sessions_send(...) → Use the Agent toolmessage(...) → Use the messaging plugin's reply tool (or append to memory/$(date +%Y-%m-%d).md if no plugin is loaded)memory_search / memory_get (ClawCode exposes them).ToolSearch(query="select:CronCreate") # once per session
CronCreate(
cron: "<expr>",
prompt: "<adapted message>",
durable: true,
recurring: <true for cron/every, false for at>
)
# Capture the returned 8-hex task_id.
bash "$CLAUDE_PLUGIN_ROOT/skills/crons/writeback.sh" upsert \
--key "openclaw-<original-uuid>" \
--source openclaw-import \
--harness-task-id "<new task_id>" \
--cron "<expr>" \
--prompt "<adapted message>" \
--recurring <true|false>
The explicit --key openclaw-<uuid> + --source openclaw-import overrides what PostToolUse would have captured (which we're suppressing via .reconciling marker anyway).
Running upsert with --source openclaw-import also auto-marks migration.openclawAnsweredAt = "auto-imported" in the registry — prevents the SessionStart migration offer from re-appearing next session.
Crons imported (<G+Y>):
✅ Ideas Check-in (0 14 * * 3,6)
⚠️ meditation (0 2 * * *) — whatsapp channel → fallback to memory file
Skipped (<R>):
❌ eva-sync-systemEvent — kind:systemEvent has no Claude Code equivalent
❌ cc-task-monitor — references http://192.168.3.102:3123 (HARD_RED)
rm -f "$CLAUDE_PROJECT_DIR/memory/.reconciling"
If imports failed mid-batch, remove the marker anyway (don't leak it — posttool would skip captures for up to 10 minutes until the stale check kicks in).
memory/crons.json + reconcile. The old .crons-created marker is obsolete and cleaned up on first reconcile./agent:service install.AskUserQuestion (REPL-only, one question at a time).