Every 30 minutes, OpenClaw displays the following message in a dialog box:

Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.
When reading HEARTBEAT.md, use workspace file /home/node/.openclaw/workspace/HEARTBEAT.md (exact case). Do not read docs/heartbeat.md.

And what is often even more frustrating is the accompanying message:

API rate limit reached. Please try again later.

This has abruptly halted our progress in further exploration. Why is this happening, and how can we resolve it?

In fact, this issue stems from OpenClaw’s “Heartbeat” mechanism, which consumes a significant number of tokens. According to the latest code analysis reports and user feedback, each Heartbeat cycle loads the entire session context, workspace files, and system prompts; a single request can potentially consume as many as 120,000 tokens.

So, why does OpenClaw trigger the Heartbeat so frequently? And why does it result in such massive token consumption? The reality is that the Heartbeat is not a lightweight “health check” signal, but rather a complete Agent iteration. Each time it is triggered, it executes a series of operations, such as:

  1. Loading the entire workspace directory and bootstrap files (e.g., AGENTS.md, HEARTBEAT.md).
  2. Constructing the complete session context (including conversation history and system prompts).
  3. Invoking the large language model (LLM) to process the data.

As the session progresses, the volume of information requiring processing grows exponentially—and this is the source of the immense overhead. To disable the Heartbeat mechanism, please refer to the following points:

1. Temporarily disable via a CLI command.

This command immediately suspends all heartbeats; however, it is suitable only for temporary debugging purposes, as the heartbeats will automatically resume upon restarting the Gateway.


openclaw system heartbeat disable

2. Modify the `openclaw.json` or `config.yaml` configuration by setting `heartbeat.every` to “0m”—meaning heartbeat checks will no longer be performed.


{
  "agents": {
    "defaults": {
      "heartbeat": {
        "every": "0m"   // Setting to 0 minutes disables the feature.
      }
    }
  }
}

3. Optimized Alternative (If Heartbeat Must Be Retained)

(1) Lower the frequency.


"heartbeat": {
  "every": "4h",           // Switch to once every 4 hours, reducing consumption by 87.5%.
  "lightContext": true,    // Load only HEARTBEAT.md; do not load the full context.
  "isolatedSession": true  // Each session is independent and does not carry over historical data.
}

(2) Restrict Activity Periods


"heartbeat": {
  "every": "30m",
  "activeHours": {
    "start": "09:00",
    "end": "22:00",        // Runs only during business hours.
    "timezone": "Asia/Shanghai"
  }
}

(3) Use inexpensive models.


"heartbeat": {
  "model": "openai/gpt-4o-mini",  // Using a Lightweight Model to Process Heartbeats
  "lightContext": true
}

With reserves in hand, there is no need to panic; feed gradually, for the journey of shrimp farming is a long one. For a more detailed explanation, please refer to the official documentation.