Heartbeat-gateway: Event-driven replacement for cron polling in OpenClaw

What heartbeat-gateway does
Heartbeat-gateway is an event-driven replacement for cron-based heartbeat polling in OpenClaw. Instead of polling every 30 minutes to check if anything changed, it receives webhooks from external tools and processes them immediately.
Key details from the source
The tool was built to address high API costs from OpenClaw's default heartbeat polling. At default settings, polling every 30 minutes costs approximately $86/month. The author notes that while OpenClaw has added lightContext and isolatedSession optimizations, these still involve polling rather than event-driven architecture.
Heartbeat-gateway works by:
- Receiving webhooks from GitHub, Linear, and PostHog
- Running a zero-cost pre-filter with repo/project/branch scoping and always-drop lists
- Classifying qualifying events against your
SOUL.mdwith a lightweight LLM call (~200 tokens) - Writing actionable items directly to
HEARTBEAT.mdfor your agent to read
Performance improvements:
- Cost reduction: ~$4.50/month vs ~$86/month
- Latency improvement: under 2 seconds vs up to 30 minutes
Technical specifications:
- Version: v0.1.1
- License: Apache-2.0
- Language: Python 3.11+
- Status: Live in production with 134 tests passing
Limitations and future plans
The tool is not a complete replacement for cron - temporal tasks like daily digests and scheduled synthesis still need cron. It specifically handles reactive events that tools can push via webhooks.
Current limitations include manual setup and rough onboarding. The author plans to build a "gateway doctor" config validator and easier deploy options if adoption grows.
Areas for feedback
The author is seeking feedback on:
- The
SOUL.mdclassifier interface - whether reading the first 500 characters makes sense or if a different context strategy would be better - Pre-filter scoping - whether repo/project/branch level control is sufficient or if event-type level control is needed
- Additional webhook sources - currently supports GitHub, Linear, PostHog; considering Slack, Sentry, Jira next
Architecture notes: The author is a PM, not a software engineer, and built this with Claude Code. The code is functional and tested but may have patterns that experienced Python developers could improve.
📖 Read the full source: r/openclaw
👀 See Also

PocketTeam: A Claude Code Pipeline with Hook-Based Safety and Learning Agents
PocketTeam is a Claude Code pipeline that implements 9 safety layers at the tool-call level to block dangerous operations like writes to .env or rm -rf commands. The system includes an Observer agent that analyzes completed tasks and writes structured learnings to improve future agent performance.
OpenClaw AI Agent with 6 Roles, Memory, and ADHD-Aware Design: Daily Ops Breakdown
A solo founder with ADHD built an open-source AI agent with 6 roles (action planner, debriefer, writer, legal, investigator, CRM) sharing memory, auto-generating follow-ups and drafts from transcripts.

quorum: AI Code Governance Tool Enforces Independent Model Review
quorum is a governance layer for AI-assisted development that enforces a consensus protocol requiring code to be independently reviewed by a different model before committing. It includes three structural gates that block progress: audit, retro, and quality gates.

Open-source memory system for LLM agents achieves high benchmark scores
A persistent memory system for Claude Code and OpenClaw provides LLM agents with context continuity across sessions, achieving 90.8% on LoCoMo and 89.1% on LongMemEval benchmarks. The adapter-based architecture works with any agent framework.