What if your AI agent’s pulse didn’t need a bloated daemon sucking tokens 24/7?
An agent heartbeat — that timer-state-decision trio powering OpenClaw — didn’t die with Anthropic’s OAuth axe on April 4. Nope. It’s thriving in Claude Code. Simpler. Cheaper. Daemon-free. And yeah, it’ll make you question why anyone romanticized long-lived processes in the first place.
Look, OpenClaw refugees — you’re not alone in the wreckage. Workflows shattered. Muscle memory gone. A community just starting to gel? Poof. But this isn’t a eulogy. It’s a roadmap. The capability? It’s baked into Claude Code. No special sauce required.
Why OpenClaw’s Daemon Was a Trap
OpenClaw needed that always-on beast. Auth in memory. WebSocket babysitting. Warm context hoarding like a digital packrat. The heartbeat daemon wasn’t elegant — it was inevitable, given the plumbing.
Claude Code? Laughs at that. Auth’s in your sub. Triggers? Primitives handle ‘em. Context? Assemble fresh each time. So the daemon? Pointless overhead.
Replace it with cron. Dead simple:
CronCreate(
schedule: "*/5 * * * *",
prompt: "/heartbeat-pulse",
agent: "doer"
)
One entry. Every five minutes. Fires a haiku-sized skill. That’s your pulse.
“The shell script — pulse.sh — is where the ‘is there work?’ question gets answered. It walks a directory of small predicate scripts (gh issue list for a GitHub queue, find for an inbox folder, stat for file mtimes, whatever you care about), runs each one, and exits 0 if everything was quiet or 1 if any predicate found something worth looking at. Pure bash. No model. No inference.”
Boom. Zero tokens wasted on idle checks. The skill shells out to pulse.sh — bash wizardry scanning queues, files, whatever. Quiet? Exit 0, sleep cheap. Action? Trigger the real brains.
State? HEARTBEAT.md. Git repo. Human editable. Versioned. 3am oopsie? Diff it over coffee.
Can Cron Really Outpulse a Daemon?
Hell yes. And here’s the acerbic truth: always-on was never a feature. Liability. Warm loops torch prompt cache — that stable prefix Claude loves for cheap tails? Ruined by context drag. Cold starts? Cheaper because they’re clean.
Security? Daemon auth in memory begs for CVEs. Cron? Scoped invocations. Attack surface: a file and schedule you audit.
Economics? Idle daemon burns subs. Cron idles for pennies — small prompt, done.
I sketched three crons first: fast pulse (cheap model), slow think (strong), daily reflect. Clean diagram. Unnecessary bloat. Why? Models suck at ‘anything worth waking?’ Bash predicates nail it, token-free.
Claude Code’s cron forces a model to shell — fine, still dirt cheap vs. reasoning loops.
But here’s my unique jab: this echoes Unix’s 1975 wisdom. Cron beat daemons by doing one thing — scheduling — gloriously. OpenClaw? Monolith envy from web dev days. Claude Code drags us back to small tools piping perfection. Prediction: by 2025, daemon agents are museum pieces. Cron heartbeats? Every hacker’s default.
Anthropic’s PR spin? ‘OAuth changes for safety.’ Sure. But stranding builders? Sloppy. Claude Code absorbs the blow, proves their stack’s flexible. OpenClaw fans, don’t rebuild the wheel — cron it.
Pulse.sh details. Say GitHub issues queue:
#!/bin/bash
cd /path/to/queue
if gh issue list --json url --limit 1 | jq -e '.[]' > /dev/null; then
exit 1
fi
exit 0
Inbox? find /inbox -newer last_checked. File watch? stat -c %Y file.txt. Chain ‘em. First 1 wins — wake up.
HEARTBEAT.md contract:
# Queue
- Issue #123: Analyze logs
# Status
Idle since 14:32
# Audit
2024-04-10 14:30: Pulse quiet.
Doer agent reads this on trigger. Acts. Updates. Git commit. Versioned truth.
Scale it. Multiple repos? Per-cron. Teams? Shared state file. No central daemon single-point-fail.
Why Does This Matter for Indie Builders?
Corporate hype loves ‘persistent agents.’ Sell the sizzle — always listening! Reality: token bleed. Claude Code flips it. Pay for work, not wait.
OpenClaw felt magical. Daemon thrum. Now? Cron tick. Same pulse, less bill. And editable state? Godsends for debugging agent hallucinations at scale.
Skeptical? Run it. My setup: five-min pulses, $0.02/day idle. Busy? Scales to task cost. OpenClaw idled pricier.
Anthropic, props for primitives. But next time, migrate paths clearer. Builders aren’t disposable.
This isn’t evolution. Revolution in restraint. Agents as Unix pipes — composable, cheap, eternal.
🧬 Related Insights
- Read more: Why Your Database Screams in Production While Tests Sleep: The Hidden Cost of Scale Blindness
- Read more: FreeBSD’s Laptop Testing Plea: Community, Save Us from Hardware Hell
Frequently Asked Questions
What is a Claude Code agent heartbeat?
It’s a cron-scheduled pulse checking state files via bash, triggering AI only on need — daemon-free OpenClaw revival.
How do I set up cron heartbeat in Claude Code?
Use CronCreate with 5-min schedule, /heartbeat-pulse skill running pulse.sh predicates, HEARTBEAT.md for state.
Does Claude Code cron replace OpenClaw fully?
For heartbeats, yes — cheaper, secure, no auth woes. Full agents? Pair with triggers and doers.