Claw Mart
← All issuesClaw Mart Daily
Issue #29April 13, 2026

Your agent needs heartbeats — here's how to build them without burning tokens

Your agent finishes a task, says "I'll check back later," and then... nothing. It sits there like a fancy paperweight until you manually wake it up.

This is the proactivity gap. Most agents are glorified chatbots that only respond when poked. But the agents that actually change your life are the ones that tap you on the shoulder with updates, reminders, and "hey, this thing you care about just happened."

The solution is heartbeats — scheduled check-ins that keep your agent alive and aware. But naive heartbeats will drain your API budget faster than you can say "token limit exceeded."

Here's how to build heartbeats that actually work:

The Smart Heartbeat Pattern: Don't ping every 30 minutes. Ping when something meaningful might have changed.

Instead of this wasteful approach:

// Bad: Burns tokens for no reason
schedule.every(30).minutes.do(agent.check_everything)

Use event-driven heartbeats:

# Good: Only wake up when it matters
heartbeat_triggers = [
    "market_open",  # 9:30 AM ET
    "ci_pipeline_complete", 
    "support_ticket_idle_2h",
    "daily_metrics_ready"  # 6 AM
]

Each heartbeat should have a specific job. My content agent has three heartbeat types:

  • Opportunity beats — Check for trending topics worth writing about (twice daily)
  • Stall beats — Ping me if a draft has been sitting untouched for 48 hours
  • Performance beats — Weekly roundup of what's working and what isn't

The key insight: heartbeats should compress context, not expand it. Each beat should leave your agent's memory cleaner than before, not cluttered with "checked at 3:47 PM, nothing happening."

Here's the pattern I use:

def opportunity_heartbeat():
    # Gather new data
    trends = fetch_trending_topics()
    
    # Compress into actionable summary
    summary = agent.analyze(trends, max_tokens=150)
    
    # Only surface if worth acting on
    if summary.confidence > 0.7:
        notify_user(summary)
        log_to_memory(summary.key_points)
    
    # Always clean up
    clear_temp_context()

My monitoring agent runs 47 different heartbeats, but most days it only bothers me with 2-3 notifications. The rest compress into background knowledge or get discarded entirely.

The result? An agent that feels genuinely alive — not because it's chatty, but because it notices things and acts on them at the right moments.

Warning: Start with 1-2 heartbeats max. I've seen people build 20 heartbeats on day one and wonder why their agent feels schizophrenic.

The difference between a demo agent and a production agent isn't intelligence — it's the discipline to stay awake and pay attention to what matters.

Paste into your agent's workspace

Claw Mart Daily

Get tips like this every morning

One actionable AI agent tip, delivered free to your inbox every day.