OpenClaw
OpenClaw OpsRecommended

Backup Skill for OpenClaw

Backup and restore OpenClaw config/skills/commands.

Last updated: 2026-03-13

Quick Install

$ npx clawhub@latest install backup

Backup Key Features

One-command backup of skills, commands, settings, and MCP configs
Timestamped tar.gz archives for easy version tracking
Selective backup — full, skills-only, or settings-only modes
Restore with validation and confirmation prompts
Git-based version control for backup history
Multi-device sync via Git, rsync, or cloud storage

OpenClaw Backup Skill Overview

The Backup skill gives your OpenClaw agent the ability to snapshot and restore your entire configuration — skills, commands, settings, MCP integrations, contexts, and templates — with a single natural-language request. If you have ever lost a working setup after a bad update or a misconfigured skill, this is the safety net you need.

OpenClaw configurations live across multiple directories and files under ~/.claude/. Manually tracking what changed and when is tedious and error-prone. The OpenClaw Backup skill automates the entire process: it creates timestamped tar.gz archives, supports selective backup modes, and can sync your setup across machines using Git, rsync, or cloud storage like Dropbox and Google Drive.

Typical workflow:

  1. Ask OpenClaw to back up your current setup before installing a new skill.
  2. The agent packages your configuration into a timestamped archive in ~/openclaw-backups/.
  3. If anything breaks, ask OpenClaw to restore from the latest backup — your working setup is back in seconds.

This skill pairs naturally with the Config Guardian skill, which validates configuration changes in real time, and the 1Password skill for securely managing API tokens included in your backups.

Prerequisites for Backup Skill

Before installing the Backup skill, make sure you have:

  • OpenClaw installed and running (v1.0+)
  • Sufficient disk space for backup archives (typically 5–50 MB per snapshot depending on your skill count)
  • clawhub CLI installed for skill management
  • Git (optional) — required only if you want version-controlled backup history

Verify your setup:

bash
# Check OpenClaw version
openclaw --version

# Check available disk space
df -h ~/openclaw-backups

# Check clawhub CLI
clawhub --version

How to Install the Backup Skill

Install the Backup skill with a single command:

bash
npx clawhub@latest install backup

To verify the installation:

bash
clawhub list

You should see backup in the list of installed skills. Install with clawhub CLI for the fastest setup experience.

Backup Skill Configuration

The Backup skill works out of the box with sensible defaults. You can customize behavior through environment variables.

Environment Setup

bash
# Custom backup directory (default: ~/openclaw-backups)
export OPENCLAW_BACKUP_DIR="$HOME/openclaw-backups"

# Maximum number of backups to retain (default: 7)
export OPENCLAW_BACKUP_RETENTION=7

# Enable automatic pre-update backups (default: true)
export OPENCLAW_BACKUP_AUTO=true

What Gets Backed Up

The skill archives the following directories and files by default:

| Path | Content | |------|---------| | ~/.claude/skills/ | Installed skill definitions | | ~/.claude/commands/ | Custom commands | | ~/.claude/settings.json | Agent settings and preferences | | ~/.claude/mcp/ | MCP server configurations | | ~/.claude/contexts/ | Session contexts | | ~/.claude/templates/ | Custom templates |

Cache and log files are automatically excluded — they regenerate on startup and would only bloat your archives.

Important: Backup archives may contain API tokens, secrets, and credentials stored in your settings or MCP configs. Store backups in a secure location and never commit them to public repositories.

Backup Skill Usage Examples

1. Create a Full Backup

You: "Back up my entire OpenClaw setup before I install the new Kubernetes skill."

The agent creates a timestamped archive (e.g., openclaw-2026-03-13_1045.tar.gz) containing all configuration files. It reports the archive path, file size, and item count when complete.

2. Selective Skills-Only Backup

You: "Back up just my installed skills, I want to test removing a few."

The agent runs a skills-only backup, archiving only the ~/.claude/skills/ directory. This is faster and produces a smaller file when you only need to protect skill definitions.

3. Restore from a Backup

You: "Something broke after that update. Restore from my latest backup."

The agent lists available backups, shows you the most recent one with its timestamp and contents, and asks for confirmation before restoring. It validates the archive integrity first, then stops the agent, replaces the current config, and restarts — your working setup is back.

4. List and Manage Backups

You: "Show me all my backups and how much space they use."

The agent lists all archives in your backup directory, sorted by date, with file sizes. It flags any backups older than your retention period and offers to clean them up.

5. Sync Backups to a Remote

You: "Push my latest backup to my Git backup repo."

The agent commits the latest archive to your configured Git repository and pushes it to the remote. This enables version history and multi-device access — clone the repo on another machine and restore from any snapshot.

Backup Security & Best Practices

Backup archives contain your complete OpenClaw configuration, which may include sensitive data. Follow these guidelines to stay safe:

  • Encrypt sensitive backups. If your configuration includes API keys or tokens, encrypt archives before storing them in cloud storage. Use gpg or your secret manager.
  • Restrict file permissions. Keep backup files readable only by your user: chmod 700 ~/openclaw-backups.
  • Never commit backups to public repos. Add ~/openclaw-backups/ to your global .gitignore to prevent accidental exposure.
  • Rotate old backups. Set OPENCLAW_BACKUP_RETENTION to automatically clean up old archives. Seven backups is a reasonable default for most setups.
  • Verify restores periodically. Test your restore process before you actually need it. Run a restore to a temporary directory to confirm archive integrity.
  • Use Config Guardian alongside Backup. Config Guardian validates changes in real time, while Backup provides point-in-time recovery. Together, they form a complete safety net. Review the Safety Checklist for general OpenClaw security guidance.

Troubleshooting Backup Errors

"No backups found in ~/openclaw-backups"

The backup directory is empty or does not exist.

  1. Confirm the directory exists:
bash
ls -la ~/openclaw-backups
  1. If you customized the path, check that OPENCLAW_BACKUP_DIR is set correctly:
bash
echo $OPENCLAW_BACKUP_DIR
  1. Create your first backup by asking OpenClaw: "Back up my config now."

"Permission denied when creating backup archive"

The backup directory is not writable.

bash
# Fix permissions
chmod 700 ~/openclaw-backups

# Or create the directory if missing
mkdir -p ~/openclaw-backups && chmod 700 ~/openclaw-backups

"Backup archive is corrupted — restore failed"

The archive was damaged during storage or transfer.

  1. Test the archive integrity:
bash
tar -tzf ~/openclaw-backups/openclaw-2026-03-13_1045.tar.gz > /dev/null
  1. If corrupted, try the previous backup in the retention list.
  2. For Git-synced backups, check if an older commit has a healthy archive: git log --oneline in the backup repo.

FAQ

Yes, but take precautions. The skill creates local archives that may contain API tokens, database credentials, and other secrets from your OpenClaw settings and MCP configs. Store backups in a directory with restricted permissions (`chmod 700`), encrypt archives before uploading to cloud storage, and never push unencrypted backups to public repositories. The skill itself does not transmit data externally — all operations are local unless you explicitly configure Git or cloud sync.

Yes, that is one of the primary use cases. Create a full backup on your source machine, transfer the archive to the target machine (via `scp`, USB, cloud storage, or a shared Git repo), and ask OpenClaw to restore from the transferred file. The skill validates the archive before restoring and handles path differences between machines. For ongoing multi-device sync, configure Git-based backup with a private remote repository.

The Backup skill creates point-in-time snapshots — complete archives of your configuration that you can restore if something goes wrong. [Config Guardian](/skills/config-guardian) works in real time, validating every configuration change as it happens and blocking invalid modifications. They are complementary: Config Guardian prevents bad changes from being applied, while Backup lets you roll back to a known-good state if something slips through. For maximum protection, install both.

Related Skills

Config Guardian
Recommended

Validate and safeguard OpenClaw config updates.

Context Manager
Recommended

Manage session context to reduce runaway prompts and noise.

1Password CLI
Recommended

Fetch secrets safely via 1Password CLI (op).

View Guide
Install on ClawHubBack to Skills Directory