whatisgithub

What is claude-heartbeat?

siigari/claude-heartbeat — explained in plain English

Analysis updated 2026-05-18

161JavaScriptAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A tool that turns an interactive Claude Code session into an automated task queue processor using a subscription instead of billed API credits.

Mindmap

mindmap
  root((claude-heartbeat))
    What it does
      Automates Claude Code
      Subscription Based
      No API Credits
    Mechanism
      Stop Hook
      Inbox Outbox Files
      Fresh Session Restart
    Reliability
      Supervisor Process
      Crash Recovery
      Heartbeat Ticks
    Integrations
      Cron Scheduler
      Webhooks
      Discord Relay

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Automate a queue of Claude Code tasks read from a simple inbox text file, without API credits.

USE CASE 2

Feed tasks into Claude Code from a cron scheduler, webhook, or Discord bot relay.

USE CASE 3

Keep a Claude Code session alive with low token usage using heartbeat ticks while idle.

USE CASE 4

Run multiple parallel Claude Code agents by setting up separate working directories.

What is it built with?

JavaScriptNode.js

How does it compare?

siigari/claude-heartbeatimtonyjaa/ggemu-fishing-joymo-tunn/openguider
Stars161175144
LanguageJavaScriptJavaScriptJavaScript
Setup difficultymoderatemoderateeasy
Complexity3/54/52/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires an active Claude Code subscription and configuring the stop hook plus inbox/outbox files.

So what is it?

claude-heartbeat is a small JavaScript tool that turns an interactive Claude Code session into an automated task processor, without needing to use Claude's command-line -p flag or the API SDK, which require separate billing credits. Instead, it works through the regular Claude Code subscription. The way it works is through a "stop hook", a script that runs automatically after each Claude response. This hook checks a file called the inbox (a simple text file where you write tasks line by line). When a new task is found, it injects that task into the Claude session, which processes it and writes its response to an outbox file. The session is then restarted fresh so the next task starts with clean context, with no leftover conversation history from previous tasks. A supervisor process sits above everything, watching for crashes or stuck sessions and restarting them automatically. While the inbox is empty, the system sends minimal "heartbeat" ticks to keep the session alive with very low token usage. The inbox and outbox files use plain text or simple JSON format, making it easy to feed tasks from a cron scheduler, an HTTP webhook, or a chat relay (a Discord bot relay is included as an optional example). Running multiple parallel agents is possible by setting up multiple working directories, each with their own supervisor and inbox. The project is aimed at developers who want to automate Claude Code tasks cheaply using an existing subscription rather than paying per-call API credits.

Copy-paste prompts

Prompt 1
Help me set up claude-heartbeat's stop hook so it processes tasks from an inbox file automatically.
Prompt 2
Explain how the supervisor process detects and restarts a crashed or stuck Claude session.
Prompt 3
Show me how to wire a Discord bot relay to write tasks into claude-heartbeat's inbox file.
Prompt 4
How do I run multiple parallel Claude Code agents using separate inbox and outbox directories?
Prompt 5
Explain why claude-heartbeat restarts the session fresh after each task instead of keeping history.

Frequently asked questions

What is claude-heartbeat?

A tool that turns an interactive Claude Code session into an automated task queue processor using a subscription instead of billed API credits.

What language is claude-heartbeat written in?

Mainly JavaScript. The stack also includes JavaScript, Node.js.

How hard is claude-heartbeat to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is claude-heartbeat for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.