Claude Code hook
Claude Heartbeat
Keep Claude Code alive and autonomous without -p. Heartbeat hook + inbox/outbox pattern.
Install
git clone https://github.com/Siigari/claude-heartbeat.gitFrom the README
claude-heartbeat Stateless autonomous agent for Claude Code — no -p, no SDK credits. The heartbeat hook turns an interactive Claude Code session into a stateless task processor. Each message from the inbox gets its own fresh session, just like -p — but using your regular subscription. Why Anthropic is separating -p and SDK usage into a dedicated credit bucket. If you've been using claude -p for automation, your costs just went up. The heartbeat hook gives you -p behavior in interactive mode, which uses your regular subscription — not SDK credits. How it works 1. The supervisor launches Claude Code in interactive mode 2. After each response, the stop hook fires 3. The hook reads the next line from io/inbox.jsonl 4. If a message exists, it's injected — one message per session 5. The agent processes it, writes a response to io/outbox.jsonl 6. The hook signals the supervisor to kill and restart with fresh context 7. Next message gets a clean session — true stateless operation One message = one session = fresh context every time. When the inbox is empty, the hook polls internally and blocks with minimal idle ticks (~20 tokens each) to keep the session alive until work arrives. Setup 1. Clone 2. Start That's it. The hook is already configured in .claude/settings.json. The supervisor launches Claude, and the heartbeat hook handles the rest. Options: 3. Send messages From another terminal: Messages are processed one at a time. If 5 messages pile up, each gets its own fresh session. 4. (Optional) Start the relay 5. (Optional) Inject events What you get - No SDK credits — interactive mode uses your subscription - Stateless — each message gets fresh context, like -p - Autonomous — watches inbox, processes messages, writes responses - Cheap idle — minimal…
How hooks work
- Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
- They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
- A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Details
- Repository
- Siigari/claude-heartbeat
- Type
- Hooks
- Language
- JavaScript
- License
- MIT
- Last updated
- 14 May 2026
FAQ
What is Claude Heartbeat?
Keep Claude Code alive and autonomous without -p. Heartbeat hook + inbox/outbox pattern. It is a hook for Claude Code, from Siigari/claude-heartbeat on GitHub.
How do I install Claude Heartbeat?
Clone Siigari/claude-heartbeat from GitHub and follow the setup steps in its README.
Is Claude Heartbeat popular?
Siigari/claude-heartbeat has 184 GitHub stars and 28 forks. It was last updated on 14 May 2026.
More hooks
Pitchcraft
201moshuying/pitchcraft
汇报.skill · pitchcraft — Structured persuasion for tech leads, PMs, and founders: kickoff, status, wrap-up, pitch, and solution selling on one 5-part framework (Hook→Context→Proposal→Evidence→Ask), with AI material intake and a pre-submit checklist. Works with Claude Code, Cursor, Codex, and more.
Claude Hooks Manager
74webdevtodayjason/claude-hooks
CLI for listing, adding and managing hooks in Claude Code settings.
Rulebricks Guardrails
79rulebricks/claude-code-guardrails
Real-time guardrails for Claude Code tool calls backed by Rulebricks rule tables.
PRD Driven Context Engineering
181mattgierhart/PRD-driven-context-engineering
PRD-Led Context Engineering — Memory as Infrastructure. An ontology layer for product teams building products that solve real problems — with AI agents that remember. Gated PRD, typed IDs, markdown knowledge graph, Claude Code skills & hooks.
Claude Code Blueprint
119Aedelon/claude-code-blueprint
Production-grade Claude Code configuration: skills, agents, hooks, rules, and permissions working as a system.
Next16 Claude Starter
145textura-agency/next16-claude-starter
AI-first Next.js 16 starter for animation-heavy sites, wired with an Obsidian vault & Claude Code hooks
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.