DEV Community

er li
er li

Posted on

My ClawdBot Dies Every Time I Close My Laptop. Here's How I Fixed It.

Local AI sounds great until your laptop sleeps.

I've been running ClawdBot for a few weeks now — just rebranded to MoltBot, but same tool. If you haven't heard of it: ClawdBot is a locally-running AI assistant that lets you control your computer through WhatsApp, Telegram, or Discord. Handles emails, manages files, automates browser tasks. The first few days felt like magic.

Then I closed my laptop.

Opened it back up. ClawdBot was gone. No error. No notification. Just silence.

This happened every single time. Reboot? ClawdBot gone. Close terminal by accident? Gone. Driving me crazy.

The Problem with ClawdBot's Local Architecture

ClawdBot runs as a terminal process. Great for transparency — you see exactly what it's doing. But the ClawdBot process dies when:

  • Your laptop sleeps
  • You close the terminal
  • System reboots
  • Anything crashes

For demos, fine. For an "always-on" ClawdBot assistant? Dealbreaker.

Found this post on r/AgentsOfAI that nailed it:

"As long as your laptop is on, the terminal is open, and nothing crashes, everything works fine. The moment your system sleeps, reboots, or you close a session by mistake, the assistant is gone."

Yep. Classic ClawdBot problem.

The Fix: Three Options for ClawdBot

After trial and error, three solutions that actually keep ClawdBot running.

Option 1: macOS LaunchAgent for ClawdBot (My Pick)

For Mac users, cleanest solution. LaunchAgent starts ClawdBot on login and restarts on crash.

Crucial Step: First, find where npx is installed on your Mac. Open terminal and run:

which npx
Enter fullscreen mode Exit fullscreen mode

Example output: /opt/homebrew/bin/npx (Apple Silicon) or /usr/local/bin/npx (Intel).

Create ~/Library/LaunchAgents/com.clawdbot.plist (replace the <string> path below with YOUR npx path):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.clawdbot</string>
    <key>ProgramArguments</key>
    <array>
        <!-- REPLACE THIS WITH YOUR NPX PATH 👇 -->
        <string>/opt/homebrew/bin/npx</string>
        <string>clawdbot</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    <key>StandardOutPath</key>
    <string>/tmp/clawdbot.log</string>
    <key>StandardErrorPath</key>
    <string>/tmp/clawdbot.error.log</string>
</dict>
</plist>
Enter fullscreen mode Exit fullscreen mode

Load it:

launchctl load ~/Library/LaunchAgents/com.clawdbot.plist
Enter fullscreen mode Exit fullscreen mode

Done. ClawdBot starts on boot, restarts on crash.

Option 2: Docker Container for ClawdBot

Windows/Linux or want isolation? Docker keeps ClawdBot running.

Dockerfile:

FROM node:20-slim
RUN npm install -g clawdbot
CMD ["clawdbot"]
Enter fullscreen mode Exit fullscreen mode

Run ClawdBot with restart policy:

docker build -t clawdbot .
docker run -d --restart unless-stopped --name clawdbot clawdbot
Enter fullscreen mode Exit fullscreen mode

--restart unless-stopped is the key. ClawdBot crashes? Auto-restart. Reboot? Comes back.

Option 3: Free VPS for ClawdBot (True Always-On)

For 24/7 ClawdBot, move it off your laptop.

AWS Free Tier: 750 hours/month EC2 for first year. One ClawdBot instance running 24/7 = free.

Quick ClawdBot setup:

  1. Launch t2.micro (Ubuntu)
  2. SSH in, install Node.js
  3. Run ClawdBot with PM2:
npm install -g pm2 clawdbot
pm2 start clawdbot
pm2 save
pm2 startup
Enter fullscreen mode Exit fullscreen mode

PM2 handles ClawdBot restarts and boot persistence. Laptop can sleep.

What I Use for ClawdBot

Option 1, LaunchAgent.

Why? My ClawdBot reads emails and manages local files. Don't want that on a remote server — privacy matters. That's the whole point of ClawdBot running locally.

If you mostly do browser automation or don't care about local file access, VPS ClawdBot is better. True always-on, no laptop dependency.

ClawdBot Resources

The community at molt-bot.net has a detailed ClawdBot/MoltBot walkthrough with screenshots. Same guides work for both — MoltBot is just the new name.


Bottom line: ClawdBot (now MoltBot) can run 24/7. Just need proper process management. Five minutes of setup, never restart your ClawdBot again.

What's your ClawdBot setup? Found other solutions?


Full disclosure: This article was created with the help of AI.

Top comments (0)