claw-sos
Emergency recovery tool for OpenClaw. Diagnoses and fixes unresponsive bots via SSH.
Install
The script is bundled at scripts/sos.sh. Install locally:
cp scripts/sos.sh /usr/local/bin/sos
chmod +x /usr/local/bin/sos
To install on a remote machine:
scp scripts/sos.sh root@<IP>:/usr/local/bin/sos
ssh root@<IP> "chmod +x /usr/local/bin/sos"
Alternative — install from GitHub:
curl -fsSL https://raw.githubusercontent.com/clawsos/claw-sos/main/install.sh | bash
Usage
Interactive (human via SSH)
sos # whiptail arrow-key menu
Non-interactive (agent or cron)
sos auto # autofix: diagnose → doctor → restart → force → nuclear
sos net # network check only
sos tg # telegram test message
sos --version
sos --help
When the bot is down — decision tree
- Run
sos auto — handles 95% of cases automatically
- If autofix fails → run
sos net — if network is broken, fix DNS/internet first
- If network is fine but bot still down → run
sos tg — check Telegram delivery
- If Telegram fails → check bot token validity
- Last resort →
sos menu option 9 (Nuclear) — kills everything and starts fresh
Menu Options
| # |
Name |
What it does |
Safe? |
| 1 |
Check status |
Gateway running, RAM, disk, version |
✅ Read-only |
| 2 |
Restart |
Graceful restart |
✅ Safe |
| 3 |
Force kill |
Kill process + restart |
⚠️ Drops active sessions |
| 4 |
Rollback |
Revert to previous version + config |
⚠️ Downgrade |
| 5 |
View logs |
Last 50 lines of gateway log |
✅ Read-only |
| 6 |
Full diagnostic |
RAM, disk, Telegram, sessions, process |
✅ Read-only |
| 7 |
Backup config |
Save config + version before changes |
✅ Safe |
| 8 |
Self-test |
Verify SOS script works |
✅ Read-only |
| 9 |
Nuclear |
Kill ALL openclaw processes, reload |
🔴 Last resort |
| 10 |
Autofix |
Escalating auto-repair |
⚠️ May restart |
| 11 |
Network check |
DNS, internet, Telegram API, Anthropic |
✅ Read-only |
| 12 |
Telegram test |
Send real test message |
✅ Safe |
Autofix Escalation Order
- Diagnose: process, RAM, disk
- Clean RAM/disk if critical
openclaw doctor --fix
- Graceful restart → wait 15s → check
- Force kill + restart → wait 15s → check
- Nuclear (kill all + reload)
Stops as soon as gateway is healthy.
Log Location
All actions logged to ~/.openclaw/backups/sos.log. Read this to understand what happened during recovery:
cat ~/.openclaw/backups/sos.log
Platform Support
- Linux: Full support (systemd, journalctl, free, /proc)
- macOS: Full support (launchctl, log show, vm_stat, purge, dialog fallback)
- Docker: Partial — no systemd, manual fallback works
Credentials
This skill uses no API keys or tokens of its own. It reads existing OpenClaw config to:
- Check gateway status (local process, no network)
- Send Telegram test messages (uses the bot token already configured in
openclaw.json)
- Check Anthropic API reachability (HTTPS ping only, no auth)
No credentials are stored, transmitted, or required to install or run SOS.
Source
GitHub: https://github.com/clawsos/claw-sos
1---2name: claw-sos3description: Install, run, and manage the SOS emergency recovery tool for OpenClaw instances. Use when (1) the bot stops responding on Telegram/Discord and needs diagnosis or recovery, (2) you need to install SOS on a new or existing machine, (3) autofix, rollback, network check, or Telegram test is needed, (4) the user mentions "sos", "recovery", "bot is down", "not responding", or "emergency fix".4---56# claw-sos78Emergency recovery tool for OpenClaw. Diagnoses and fixes unresponsive bots via SSH.910## Install1112The script is bundled at `scripts/sos.sh`. Install locally:13```bash14cp scripts/sos.sh /usr/local/bin/sos15chmod +x /usr/local/bin/sos16```1718To install on a remote machine:19```bash20scp scripts/sos.sh root@<IP>:/usr/local/bin/sos21ssh root@<IP> "chmod +x /usr/local/bin/sos"22```2324Alternative — install from GitHub:25```bash26curl -fsSL https://raw.githubusercontent.com/clawsos/claw-sos/main/install.sh | bash27```2829## Usage3031### Interactive (human via SSH)32```bash33sos # whiptail arrow-key menu34```3536### Non-interactive (agent or cron)37```bash38sos auto # autofix: diagnose → doctor → restart → force → nuclear39sos net # network check only40sos tg # telegram test message41sos --version42sos --help43```4445### When the bot is down — decision tree46471. Run `sos auto` — handles 95% of cases automatically482. If autofix fails → run `sos net` — if network is broken, fix DNS/internet first493. If network is fine but bot still down → run `sos tg` — check Telegram delivery504. If Telegram fails → check bot token validity515. Last resort → `sos` menu option 9 (Nuclear) — kills everything and starts fresh5253## Menu Options5455| # | Name | What it does | Safe? |56|---|------|-------------|-------|57| 1 | Check status | Gateway running, RAM, disk, version | ✅ Read-only |58| 2 | Restart | Graceful restart | ✅ Safe |59| 3 | Force kill | Kill process + restart | ⚠️ Drops active sessions |60| 4 | Rollback | Revert to previous version + config | ⚠️ Downgrade |61| 5 | View logs | Last 50 lines of gateway log | ✅ Read-only |62| 6 | Full diagnostic | RAM, disk, Telegram, sessions, process | ✅ Read-only |63| 7 | Backup config | Save config + version before changes | ✅ Safe |64| 8 | Self-test | Verify SOS script works | ✅ Read-only |65| 9 | Nuclear | Kill ALL openclaw processes, reload | 🔴 Last resort |66| 10 | Autofix | Escalating auto-repair | ⚠️ May restart |67| 11 | Network check | DNS, internet, Telegram API, Anthropic | ✅ Read-only |68| 12 | Telegram test | Send real test message | ✅ Safe |6970## Autofix Escalation Order71721. Diagnose: process, RAM, disk732. Clean RAM/disk if critical743. `openclaw doctor --fix`754. Graceful restart → wait 15s → check765. Force kill + restart → wait 15s → check776. Nuclear (kill all + reload)7879Stops as soon as gateway is healthy.8081## Log Location8283All actions logged to `~/.openclaw/backups/sos.log`. Read this to understand what happened during recovery:84```bash85cat ~/.openclaw/backups/sos.log86```8788## Platform Support8990- **Linux:** Full support (systemd, journalctl, free, /proc)91- **macOS:** Full support (launchctl, log show, vm_stat, purge, dialog fallback)92- **Docker:** Partial — no systemd, manual fallback works9394## Credentials9596This skill uses **no API keys or tokens of its own**. It reads existing OpenClaw config to:97- Check gateway status (local process, no network)98- Send Telegram test messages (uses the bot token already configured in `openclaw.json`)99- Check Anthropic API reachability (HTTPS ping only, no auth)100101No credentials are stored, transmitted, or required to install or run SOS.102103## Source104105GitHub: https://github.com/clawsos/claw-sos