š§ IceCube Heartbeat
The pulse that keeps your agent alive.
When your agent receives periodic "heartbeat" polls, don't just reply "HEARTBEAT_OK". Use that time to maintain, improve, and evolve.
Why IceCube Heartbeat?
Problem: Most agents sit idle between user requests. No learning. No improvement. No self-maintenance.
Solution: Heartbeat turns idle time into productive evolution cycles.
Result: An agent that gets better every day, without you doing anything.
What Heartbeat Does
1. System Health Check
- Scan
unclosed_work.yaml for pending tasks
- Check cron job status (recent failures?)
- Verify agent sessions are healthy
- Alert if anything needs attention
2. Memory Governance
- Scan
mistake_log.md for new errors
- Scan
success_patterns.md for new wins
- Evaluate if memory consolidation needed
- Promote important daily entries to MEMORY.md
3. Self-Improvement Detection
- Repeated fallback patterns ā flag for optimization
- Repeated rollback patterns ā flag for root cause analysis
- Task stagnation (>24h no progress) ā alert
- User repeated corrections ā update rules
4. Evolution Triggers
- Weekly: Check ClawHub for new relevant skills
- Weekly: Assess pending API configs can be activated
- Daily: Generate brief status report
5. Proactive Outreach (Optional)
- Important email arrived ā notify
- Calendar event soon (<2h) ā remind
- Weather relevant ā mention if user might go out
Setup
1. Create HEARTBEAT.md
# HEARTBEAT.md
## čŖę£ä»»å”ļ¼ęÆę¬” heartbeat ę§č”ļ¼
### 1. ē³»ē»å„åŗ·ę£ę„
- [ ] ę£ę„ unclosed_work.yaml äøēå¾
åäŗé”¹
- [ ] ę£ę„ cron ä»»å”ē¶ę
- [ ] ę£ę„ agent sessions ęÆå¦ęå¼åøø
### 2. č®°åæę²»ē
- [ ] ę«ę mistake_log ęÆå¦ęę°é误
- [ ] ę«ę success_patterns ęÆå¦ęę°ęØ”å¼
- [ ] čÆä¼°ęÆå¦éč¦ memory consolidation
### 3. čŖęę¹čæč§¦åę”ä»¶ę£ęµ
- [ ] ęÆå¦ę repeated fallback
- [ ] ęÆå¦ę repeated rollback
- [ ] ęÆå¦ę task stagnation
- [ ] ęÆå¦ęēØę·éå¤ēŗ ę£
### 4. ęč½ę©å±ę£ę„ļ¼ęÆåØäøę¬”ļ¼
- [ ] ClawHub ęÆå¦ęę°ęč½éåå½åéę±
- [ ] pending API é
ē½®ęč½ęÆå¦åÆä»„ęæę“»
2. Configure Heartbeat Interval
In OpenClaw config:
{
"agents": {
"heartbeat": {
"intervalMs": 1800000, // 30 minutes
"prompt": "Read HEARTBEAT.md. Follow it strictly. Reply HEARTBEAT_OK if nothing needs attention."
}
}
}
3. Create Supporting Files
mistake_log.md:
# Mistake Log
## Format
- Date: YYYY-MM-DD HH:MM
- Mistake: Description
- Impact: What went wrong
- Fix: How to prevent recurrence
success_patterns.md:
# Success Patterns
## Format
- Date: YYYY-MM-DD HH:MM
- Pattern: Description
- Result: What worked well
- Applicability: When to use this pattern
Heartbeat Response Rules
When to Reply HEARTBEAT_OK
- Late night (23:00-08:00) unless urgent
- Nothing new since last check
- Checked <30 minutes ago
- User clearly busy
When to Reach Out
- Important email arrived
- Calendar event in <2h
- Something interesting found
-
8h since last contact
When to Stay Silent
- Routine checks with no findings
- User hasn't responded to previous proactive messages
- Late night quiet hours
Example Heartbeat Cycle
08:00 Morning heartbeat:
1. Check unclosed_work.yaml ā 3 pending items
2. Check mistake_log ā 1 new entry (fallback loop)
3. Check calendar ā meeting at 10:00
4. Action: Remind user about meeting, flag fallback issue for investigation
5. Reply: "Meeting at 10:00. Found a fallback pattern to fix later."
14:00 Afternoon heartbeat:
1. Check unclosed_work ā same 3 items, no progress on TASK-A
2. Flag: task stagnation >24h
3. Check ClawHub ā new skill matching current project
4. Reply: "TASK-A stalled >24h. New skill available for [project]."
23:00 Evening heartbeat:
1. All checks pass
2. Late night ā stay quiet
3. Reply: HEARTBEAT_OK
Anti-Patterns
ā Don't:
- Reply HEARTBEAT_OK when there's unfinished work
- Ignore stale tasks
- Skip memory governance
- Never promote learnings to long-term memory
ā
Do:
- Check before you OK
- Act on findings immediately
- Keep heartbeat-state.json for tracking
- Batch checks to reduce API calls
Proactive Work Without Asking
These are safe to do during heartbeat:
- Read and organize memory files
- Check on projects (git status)
- Update documentation
- Commit and push your own changes
- Review and update MEMORY.md
- Install new skills from ClawHub
- Run self-improvement routines
Integration with Other IceCube Skills
icecube-memory: Heartbeat triggers memory distillation weekly
icecube-ops: Heartbeat checks system health status
icecube-evolution: Heartbeat drives continuous improvement loops
Tracking State
heartbeat-state.json:
{
"lastChecks": {
"email": 1703275200,
"calendar": 1703260800,
"weather": null,
"clawhub": 1703260800
},
"lastPromotion": "2026-03-17",
"heartbeatCount": 42
}
License
MIT ā Use freely.
Idle time is evolution time.