Smarter cron jobs: giving your scheduled OpenClaw agents memory
OpenClaw cron jobs are useful. Set up a schedule, your agent wakes up, does a thing, goes back to sleep. Simple.
But hereâs the problem: every time that cron agent wakes up, it has zero context. It doesnât know what it did last time. It doesnât know what changed. It doesnât know that the last three runs failed because of the same API issue and it should probably stop retrying.
Cron agents without memory repeat themselves. They check things they already checked. They send duplicate notifications. They re-discover the same information and react to it like itâs new. Iâve seen agents send the same âhey, you have an unread emailâ notification four times in one day because each run had no idea the previous runs existed.
MemoClaw fixes this by giving your cron agents persistent memory across runs. Hereâs how to set it up.
The setup
You need the MemoClaw skill installed on your OpenClaw agent:
clawhub install anajuliabit/memoclaw
Now your cron agent has access to store and recall tools. The wallet configured in OpenClaw handles auth automatically.
Pattern 1: Remember what you already processed
Say you have a cron agent that checks GitHub issues every hour. Without memory, it processes the same issues repeatedly. With MemoClaw:
# In your cron agent's instructions:
1. Recall memories tagged "processed-issues" from the last run
2. Fetch open issues from the repo
3. Compare: only process issues NOT in your recalled memories
4. For each new issue processed, store a memory:
- Content: "Processed issue #42: fix login bug - assigned to team"
- Tags: ["processed-issues", "github"]
- Importance: 0.3
The agent stores a memory for each processed item. Next run, it recalls those memories and skips already-handled items. No external database needed, no file juggling.
Using the CLI directly:
memoclaw store \
--text "Processed issue #42: fix login bug. Assigned to backend team on 2026-03-09" \
--tags processed-issues,github \
--importance 0.3
And the recall at the start of each run:
memoclaw recall "recently processed github issues" --tags processed-issues --limit 20
Pattern 2: Track trends across runs
This one is more interesting. Instead of just remembering individual items, your agent can spot patterns over time.
Example: a cron agent that monitors your serverâs health metrics every 30 minutes.
# Agent instructions:
1. Check current CPU, memory, disk usage
2. Recall recent health memories (last 24h worth)
3. If current metrics are significantly worse than recent history:
- Store a memory with high importance (0.8+)
- Alert the user
4. Otherwise, store a low-importance memory (0.2) as a data point
5. If you've alerted about the same issue 3+ times, note that in the alert
After a few days, your agent has a history of metrics stored as memories. It can tell you âdisk usage has been climbing steadily for the past weekâ because it can recall and compare previous readings. Without memory, each run is an isolated snapshot.
Pattern 3: Avoid duplicate notifications
The most common cron pain point. Your agent checks something, finds an issue, notifies you. Next run, same issue still exists, agent notifies you again.
The fix:
# Before sending any notification:
1. Recall memories tagged "notifications" matching the current alert
2. If a matching notification was sent in the last 4 hours, skip it
3. If sending: store a memory with the notification details
- Tags: ["notifications", "alert-type"]
- Importance: 0.5
# Check if we already notified about this
memoclaw recall "server disk space warning sent" --tags notifications --limit 5
# If no recent match, notify and record it
memoclaw store \
--text "Sent disk space warning to user. /dev/sda1 at 92%. 2026-03-09 14:30 UTC" \
--tags notifications,disk-warning \
--importance 0.5
Now your agent knows what it already told you. No more notification spam.
Pattern 4: Learn from failures
Cron agents fail. APIs go down, rate limits hit, network blips happen. Without memory, each failure is a surprise. With memory, your agent can adapt.
# On failure:
1. Store a memory describing the failure
- Tags: ["errors", "service-name"]
- Importance: 0.7
# On each run start:
1. Recall recent errors for services you're about to call
2. If a service has failed 3+ times recently:
- Skip it or use a longer backoff
- Notify the user once (using the duplicate notification pattern above)
Your agent develops something close to intuition about whatâs working and what isnât. It wonât keep hammering a dead API endpoint for 12 hours.
Using namespaces to keep cron memories separate
If you have multiple cron jobs running under the same wallet, their memories will mix together unless you use namespaces:
# Health monitor cron uses its own namespace
memoclaw store --text "CPU at 45%" --namespace health-monitor --tags metrics
# GitHub checker uses a different one
memoclaw store --text "Processed issue #42" --namespace github-checker --tags processed
Each namespace is isolated. The health monitor never sees GitHub memories, and vice versa.
In your cron agentâs instructions, just specify: âUse the namespace âyour-cron-nameâ for all MemoClaw operations.â
Cost for cron agents
Cron agents are usually light on memory operations. A typical setup:
- 1-3 recalls per run (checking what happened before): $0.005-0.015
- 1-5 stores per run (recording what happened): $0.005-0.025
- Running every 30 minutes: 48 runs/day
Worst case: 48 x $0.04 = $1.92/day. Realistically more like 48 x $0.015 = $0.72/day.
Thatâs pocket change compared to what you save by not re-processing items, not sending duplicate notifications, and not burning context window tokens on workaround files.
Putting it together
Hereâs a complete example for a cron agent that monitors a GitHub repo:
You are a GitHub monitor agent. You run every hour via cron.
NAMESPACE: github-monitor
ON EACH RUN:
1. Recall memories tagged "last-run" (limit 1) to get your last run timestamp
2. Fetch issues updated since that timestamp using gh CLI
3. For each new/updated issue:
a. Recall memories tagged "issue-{number}" to check if you've seen this state before
b. If new state: process it, store a memory with tag "issue-{number}"
c. If same state: skip
4. Store a "last-run" memory with the current timestamp (importance 0.1)
5. If you found anything worth reporting, notify the user via Discord
USE MEMOCLAW FOR ALL MEMORY OPERATIONS.
Do not write to local files.
The agent gets smarter with every run. It knows its history, avoids duplicate work, and only bothers you when something actually changed.
Cron agents without memory are just alarm clocks. Cron agents with memory are assistants that pay attention.