gitclaw for Openclaw

An automated backup tool that mirrors your OpenClaw workspace to a GitHub repository using a cron-driven sync script.

marian2js
v1.0.0
Feb 1, 2026
6
4.7k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install gitclaw

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install gitclaw using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is gitclaw?

gitclaw is a specialized automation tool designed to ensure the persistence and versioning of your AI agent's workspace. By leveraging Git and the GitHub CLI, it creates a bridge between your local environment and a remote repository, providing a reliable safety net for your agent's soul, configurations, and memory.

This skill is a core part of the Openclaw Skills ecosystem, focusing on developer peace of mind through seamless data redundancy. It operates quietly in the background, ensuring that every modification to your agent's environment is captured and pushed to GitHub without requiring manual intervention or complex configuration from the user.

gitclaw Use Cases

  • Backing up the OpenClaw workspace to a remote repository automatically.
  • Synchronizing local agent changes to GitHub for multi-device access.
  • Setting up periodic, scheduled commits to maintain a history of agent development.
  • Implementing a fail-safe disaster recovery plan for AI agent metadata and workspace files.

How gitclaw Works

  1. Validates and installs necessary system dependencies including Git, Cron, and the GitHub CLI (gh).
  2. Authenticates the user via the official GitHub device login flow to ensure secure access without manual token handling.
  3. Initializes a local Git repository within the designated OpenClaw workspace directory.
  4. Creates a new GitHub repository or connects to an existing one based on user-provided visibility settings.
  5. Deploys a deterministic shell script that manages the staging, committing, and pushing of changes.
  6. Configures a Crontab entry to execute the backup script at a regular interval (defaulting to every 60 minutes).

gitclaw Setup

To get started with this among other Openclaw Skills, ensure you have your GitHub account ready and follow these steps:

  1. Trigger the skill by asking your agent to "back up my workspace to GitHub" or "sync my files."
  2. Provide the target repository name and choose between public or private visibility.
  3. When prompted, visit https://github.com/login/device and enter the code displayed in your terminal to authorize the GitHub CLI.
  4. The agent will handle the rest, including installing Git and Cron if they are missing.
# The skill automates the configuration of the backup script located at:
~/.openclaw/gitclaw/auto_backup.sh

# You can manually trigger a backup at any time by running:
sh ~/.openclaw/gitclaw/auto_backup.sh

gitclaw Data Schema & Taxonomy

The skill organizes its automation and logging data within a dedicated directory structure to ensure transparency and reliability:

Component Path Description
Workspace ~/.openclaw/workspace The primary directory containing SOUL.md, AGENTS.md, and other workspace files.
Backup Script ~/.openclaw/gitclaw/auto_backup.sh The core bash script responsible for the Git push lifecycle.
Log File ~/.openclaw/gitclaw/backup.log Records the timestamp and status of every backup attempt.
Lock Directory ~/.openclaw/gitclaw/lock Prevents race conditions by ensuring only one backup process runs at a time.

gitclaw Advanced Features

  • Deterministic Backup Logic: The sync script automatically detects if changes exist and exits quietly if the workspace is already up to date to save resources.
  • Concurrency Protection: Uses a file-system-based locking mechanism to prevent overlapping cron jobs from conflicting during push operations.
  • Idempotent Cron Management: The setup process checks for existing crontab entries to avoid creating duplicate schedules.
  • GitHub CLI Integration: Leverages the official gh tool for secure, browser-based authentication, which is a best practice within the Openclaw Skills framework.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*