# Self Heal Openclaw

> Auto-recover OpenClaw when health goes offline, gateway token mismatch (1008) appears, Telegram stops replying, or browser/control-ui disconnects. Runs safe first-pass repair and optional deep cleanup.

- Skill: `majiayu000/self-heal-openclaw` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/self-heal-openclaw`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/self-heal-openclaw/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/self-heal-openclaw

---


# Self-Heal OpenClaw

Use this skill when OpenClaw is unstable, for example:
- `health offline` or `Gateway not reachable`
- `token_mismatch` / `1008 unauthorized`
- Telegram channel is connected but no replies are sent
- Browser/Copilot shows disconnected while gateway should be local

## Default action (safe repair)
Run:

```bash
bash scripts/self_heal_openclaw.sh --profile jarvis
```

This performs non-destructive recovery:
1. Does **not** touch token/config by default (stability-first mode)
2. Ensures LaunchAgent is installed
3. Restarts only if health fails twice in a row (with 30-minute cooldown)
4. Runs health and channel probe checks

If token mismatch is explicitly confirmed (`1008 unauthorized`), run:

```bash
bash scripts/self_heal_openclaw.sh --profile jarvis --sync-token
```

This additionally syncs:
- `gateway.remote.token` <- `gateway.auth.token`
- `$HOME/openclaw_pro/gateway.token`

## Deep cleanup (only when safe repair fails)
Run:

```bash
bash scripts/self_heal_openclaw.sh --profile jarvis --deep-clean
```

`--deep-clean` additionally removes stuck local session cache under:
- `~/.openclaw-jarvis/agents/main/sessions/*.jsonl`
- `~/.openclaw-jarvis/agents/main/sessions/sessions.json`

## After repair checklist
- Confirm `openclaw --profile jarvis health` is OK
- Confirm `openclaw --profile jarvis channels status --probe` is OK
- If web still fails, re-enter token in Control UI from `$HOME/openclaw_pro/gateway.token`

