The Idea: An Agent That Never Sleeps
Imagine an assistant that works while you sleep. One that checks your emails at 3 AM, prepares a summary for when you wake up, monitors your servers, and alerts you only when it’s important.
That’s exactly what OpenClaw enables once properly configured. Your agent isn’t a tool you open and close—it’s a continuous process running on your server, connected to your communication channels, ready to act.
In this article, we’ll explore the mechanisms that make this possible: the heartbeat, cron jobs, persistent memory, and skills.
Heartbeat: The Pulse of Your Agent
What Is the Heartbeat?
The heartbeat is a periodic polling mechanism. Every 30 minutes by default, OpenClaw wakes up your agent and asks: "Is there anything that needs your attention?"
The agent then reads its HEARTBEAT.md file (if it exists) and performs the requested checks. If everything is fine, it responds with HEARTBEAT_OK and goes back to sleep. Otherwise, it sends you a message.
It’s simple, effective, and token-efficient.
Configuring the Heartbeat
In your ~/.openclaw/openclaw.json file:
{
agents: {
defaults: {
heartbeat: {
every: "30m", // Interval (default: 30m)
target: "last", // Where to send alerts ("last" = last used channel)
activeHours: {
start: "08:00",
end: "22:00",
timezone: "Europe/Paris"
}
}
}
}
}
💡 activeHours prevents waking you up at night. Heartbeats are ignored outside this window.
HEARTBEAT.md: Your Checklist
Create a HEARTBEAT.md file in your agent’s workspace (~/.openclaw/workspace/) :
# Heartbeat Checklist
- Check urgent emails
- If a calendar event is approaching (< 2h), notify me
- Check Git status of active projects
- If inactive for 8h+, perform a light check-in
The agent reads this file at each heartbeat and follows the instructions. Keep it short—every word consumes tokens with each cycle.
⚠️ Never include secrets (API keys, tokens) in HEARTBEAT.md. It’s part of the prompt.
The HEARTBEAT_OK Contract
- If nothing requires attention → the agent responds with
HEARTBEAT_OK(the message is not delivered) - If something is urgent → the agent sends a real message to your channel
HEARTBEAT_OKmessages with fewer than 300 additional characters are automatically discarded
This is what prevents the system from spamming you.
Cron Jobs: Scheduled Tasks
The heartbeat is perfect for light, batched monitoring. But for tasks that need to run at a specific time, use the built-in cron jobs.
How It Works
Cron jobs are managed by the Gateway. They persist in ~/.openclaw/cron/jobs.json and survive restarts.
Two execution modes:
- Main session (systemEvent): injects an event into the main session, processed at the next heartbeat
- Isolated (agentTurn): launches a dedicated cron:<jobId> session, independent of the main history
Practical Examples
One-time reminder in 20 minutes:
openclaw cron add \
--name "Meeting reminder" \
--at "20m" \
--session main \
--system-event "Reminder: the meeting starts in 10 minutes." \
--wake now \
--delete-after-run
Daily report at 7 AM:
openclaw cron add \
--name "Morning brief" \
--cron "0 7 * * *" \
--tz "Europe/Paris" \
--session isolated \
--message "Generate the morning brief: weather, calendar, important emails, news." \
--announce \
--channel telegram \
--to "YOUR_CHAT_ID"
Weekly review every Monday at 9 AM with a powerful model:
openclaw cron add \
--name "Weekly review" \
--cron "0 9 * * 1" \
--tz "Europe/Paris" \
--session isolated \
--message "In-depth analysis: weekly summary, project metrics, improvement suggestions." \
--model opus \
--thinking high \
--announce \
--channel telegram \
--to "YOUR_CHAT_ID"
Daily backup:
openclaw cron add \
--name "Workspace backup" \
--cron "0 3 * * *" \
--tz "Europe/Paris" \
--session isolated \
--message "Perform a backup: git add -A && git commit -m 'auto backup' && git push. Confirm the result." \
--announce
Managing Cron Jobs
# List all jobs
openclaw cron list
# View execution history
openclaw cron runs --id <job-id> --limit 10
# Manually run a job
openclaw cron run <job-id>
# Edit an existing job
openclaw cron edit <job-id> --message "New prompt"
# Delete a job
openclaw cron remove <job-id>
systemEvent vs. agentTurn: When to Use Which?
| systemEvent (main) | agentTurn (isolated) | |
|---|---|---|
| Session | Main (shared) | Dedicated (cron:<jobId>) |
| Context | Access to full history | Starts from scratch |
| Model | Same as the main session | Can be different |
| Usage | Reminders, nudges, follow-ups | Reports, analyses, heavy tasks |
💡 Simple rule: If the task needs context → main session. If it’s standalone → isolated.
Telegram Management: Control from Your Phone
Telegram is the most natural interface for interacting with your agent daily. You talk to it like a human, and it acts.
Sending Tasks
Simply send a message to your Telegram bot:
- "Summarize my unread emails"
- "Check the status of my servers"
- "Create a reminder for tomorrow at 2 PM: call the dentist"
- "Monitor the latest AI news"
The agent understands natural language and uses its tools to complete the task.
Receiving Alerts
Configure the heartbeat and cron jobs to deliver alerts via Telegram:
{
agents: {
defaults: {
heartbeat: {
target: "telegram",
to: "YOUR_CHAT_ID"
}
}
}
}
You’ll receive alerts directly in your Telegram conversation, like a normal message.
Useful Commands
OpenClaw supports slash commands in Telegram:
/new— New session (context reset)/status— Agent status/model sonnet— Change model on the fly/reasoning on— Enable visible reasoning mode
Reactions and Interactions
Your agent can react with emojis on Telegram to acknowledge receipt without cluttering the conversation. It’s a light signal that says, "I’ve seen it, noted."
Memory and Continuity
Your agent wakes up without memory in each new session. Memory files provide its continuity.
Daily Notes: memory/YYYY-MM-DD.md
Each day, the agent can create a file in ~/.openclaw/workspace/memory/:
memory/
├── 2026-02-06.md
├── 2026-02-07.md
└── 2026-02-08.md
These files contain the day’s raw events: decisions made, tasks completed, problems encountered.
Long-Term Memory: MEMORY.md
MEMORY.md is the agent’s curated memory. Think of it as the difference between a diary (daily notes) and life lessons drawn from it.
The agent can (and should) periodically review its daily notes and update MEMORY.md with important information:
- User preferences
- Lessons learned
- Important context for future tasks
- Decisions made and their justification
How the Agent Learns from Mistakes
The learning cycle works like this:
- The agent makes a mistake (wrong command, incorrect information)
- You correct it
- It logs the correction in
memory/YYYY-MM-DD.md - During the next heartbeat, it integrates the lesson into
MEMORY.md - In subsequent sessions, it reads
MEMORY.mdand avoids repeating the same mistake
It’s a simple but effective system. The more you interact with your agent, the more relevant it becomes.
💡 Tip: Explicitly ask your agent to "remember" something important. It will write it in its memory files.
Skills: Extending Capabilities
Skills are modules that add capabilities to your agent. Each skill contains a SKILL.md file that tells the agent how to use a tool.
Installing a Skill
# List available skills
openclaw skills list
# Install from ClawhHub
openclaw skills install weather
openclaw skills install github
openclaw skills install google-trends
Examples of Useful Skills
- weather: Real-time weather (useful for morning heartbeats)
- github: Repository, issue, and PR management
- google-trends: Monitoring search trends
- web_search: Advanced web search
- browser: Browser control for scraping
Creating Your Own Skill
A skill is simply a folder with a SKILL.md:
~/.openclaw/workspace/skills/my-skill/
├── SKILL.md
└── (optional scripts)
Example of a minimal SKILL.md:
---
name: my-monitoring
description: "Checks the status of my servers"
tools: [exec]
---
# My Monitoring
## Usage
When asked to check the servers, execute:
- `curl -s https://api.myserver.com/health` for status
- `curl -s https://api.myserver.com/metrics` for metrics
Respond with a clear summary: ✅ if everything is fine, ❌ with details if there’s a problem.
The agent automatically discovers skills in the workspace and uses them when relevant.
Practical Use Cases
🗓️ Personal Assistant
- Morning: automatic brief (weather, calendar, important emails)
- Day: meeting reminders, task tracking
- Evening: daily summary, planning for tomorrow
- Continuous: answering questions via Telegram
Sample configuration:
# Morning brief
openclaw cron add --name "Morning brief" --cron "0 7 * * *" --tz "Europe/Paris" \
--session isolated --message "Complete morning brief" --announce --channel telegram
# Heartbeat for continuous monitoring
# (configured in openclaw.json with activeHours)
✍️ Content Creator
- Brainstorming: "Suggest 10 video ideas about AI"
- Writing: "Write a 5-minute script about autonomous agents"
- Research: automatic trend monitoring
- Planning: automated editorial calendar
💻 Developer
- Git: automatic commits, PR reviews
- CI/CD: pipeline monitoring, failure alerts
- Server: health checks, logs, metrics
- Documentation: automatic README updates
Example developer heartbeat:
# Heartbeat Checklist
- `git status --short` on active projects — commit if necessary
- Check CI pipelines — alert if failure
- Disk space and RAM — alert if > 80%
📊 Entrepreneur
- Competitive intelligence: monitoring competitors and market
- Emails: sorting and summarizing important emails
- Reports: automatic weekly report generation
- Social media: monitoring mentions and trends
Limitations: What OpenClaw Doesn’t Do (Yet)
Let’s be honest about current limitations:
- No real-time vision: the agent doesn’t "see" your screen continuously (except via nodes and browser control)
- No voice: no native voice interface (though TTS is available via skills)
- Token costs: each heartbeat and cron job consumes API tokens. A 30-minute heartbeat with an expensive model can get costly
- Hallucinations: like any LLM, the agent can make mistakes. Verify critical actions
- Latency: complex tasks take time (30s to a few minutes)
- No multi-user support