workspace-backup

workspace-backup is a skill for Claude Code from xg-gh-25/SwarmAI. It costs 30 tokens per session (741 once invoked), scanned D, original, MIT.

A backup and restore tool for a SwarmAI workspace, including its memory, knowledge, projects, settings, and conversations. It stores backups in a private GitHub repository, a hosted code repository.

In plain words
What is it for?
Use it to check backup status, run an immediate backup, configure backups, or restore workspace data.
Why use it?
It protects workspace data from loss and helps restore the same setup on a new machine.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Use it to check backup status, run an immediate backup, configure backups, or restore workspace data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xg-gh-25/swarmai/s_workspace-backup
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add xg-gh-25/SwarmAI --skill s_workspace-backup
Clone the repo
git clone --depth 1 https://github.com/xg-gh-25/SwarmAI

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for workspace-backup

README.md
[![agentmods](https://agentmods.dev/badge/skills/xg-gh-25/swarmai/s_workspace-backup/github.svg)](https://agentmods.dev/skills/xg-gh-25/swarmai/s_workspace-backup)
Your own site
<a href="https://agentmods.dev/skills/xg-gh-25/swarmai/s_workspace-backup"><img src="https://agentmods.dev/badge/skills/xg-gh-25/swarmai/s_workspace-backup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for workspace-backup

Your own site · 80×15
<a href="https://agentmods.dev/skills/xg-gh-25/swarmai/s_workspace-backup"><img src="https://agentmods.dev/badge/skills/xg-gh-25/swarmai/s_workspace-backup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 741 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.00741
Opus 5 $0.00015 $0.00370
Sonnet 5 $0.00006 $0.00148
Haiku 4.5 $0.00003 $0.00074

Measured 8d ago against content hash 68fbb9d7ecc3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade D, and why

workspace-backup scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- **Linux/Hive**: `~/.swarm-ai/.backup-token` (chmod 600)

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -s "http://localhost:$(cat ~/.swarm-ai/backend.json | python3 -c 'import sys,json;print(json.load(sys.stdin)["port"])')/api/system/backup/status" | python3 -m json.tool

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s "http://localhost:$(cat ~/.swarm-ai/backend.json | python3 -c 'import sys,json;print(json.load(sys.stdin)["port"])')/api/system/backup/status" | python3 -m json.tool
backend/skills/s_workspace-backup/SKILL.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Workspace Backup & Restore

Manage workspace backups to a private GitHub repository. Your memory, knowledge, projects, config, and conversation history are backed up daily and can be restored on a new machine.

TRIGGER: "backup workspace", "backup now", "restore workspace", "backup status", "configure backup", "when was last backup", "备份", "恢复workspace". DO NOT USE: for git operations on the swarmai codebase (use workspace-git), for file search (use workspace-finder), or for project CRUD (use ddd-manager).

Commands

Check Status

curl -s "http://localhost:$(cat ~/.swarm-ai/backend.json | python3 -c 'import sys,json;print(json.load(sys.stdin)["port"])')/api/system/backup/status" | python3 -m json.tool

Shows: last_backup timestamp, repo_url, schedule, enabled.

Run Backup Now

curl -s -X POST "http://localhost:$(cat ~/.swarm-ai/backend.json | python3 -c 'import sys,json;print(json.load(sys.stdin)["port"])')/api/system/backup" | python3 -m json.tool

Exports DB tables, copies config, commits and pushes to GitHub.

Configure Backup

curl -s -X PUT "http://localhost:$(cat ~/.swarm-ai/backend.json | python3 -c 'import sys,json;print(json.load(sys.stdin)["port"])')/api/system/backup/config" \
  -H "Content-Type: application/json" \
  -d '{"repo_url": "https://github.com/USER/REPO.git", "token": "ghp_..."}' | python3 -m json.tool

Alternative: Direct Python

When the API isn't available (e.g., daemon not running), use Python directly:

import asyncio
from core.backup_manager import BackupManager

# Backup
result = asyncio.run(BackupManager().backup())
print(result)

# Status
print(BackupManager().get_status())

# Restore (on a fresh machine)
async def restore():
    mgr = BackupManager()
    async for event in mgr.restore(repo_url="https://github.com/USER/REPO.git"):
        print(event)
asyncio.run(restore())

What Gets Backed Up

Layer Content Size
L1 (git) .context/, Knowledge/, Projects/, config ~240MB
L2 (DB dump) messages, sessions, todos, token_usage, etc. ~8MB gz
L3 (skip) embeddings, FTS, knowledge_chunks Rebuilt on restore

Read the full file on GitHub · 81 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 81 lines · 30 tokens per session scan D 68fbb9d7ecc3

Subscribe to this mod's changes

workspace-backup is a skill published in the GitHub repository xg-gh-25/SwarmAI (44 stars, last pushed 4d ago), licensed MIT. It adds 30 tokens to every session and 741 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it D with 3 findings (asks for root, downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.