backup-manager

A guide for checking whether backups are healthy, complete, and restorable across repositories, NAS storage, Gitea, and archives. A backup is a copy of data kept so it can be recovered after loss or damage.

In plain words
What is it for?
Use it to verify Git repository integrity, compare source and backup file counts, check Gitea backup status, and test that stored archives or repositories can be restored.
Why use it?
It catches corrupted, incomplete, or outdated backups before they are needed in an emergency.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/firstp1ck/pi-coding-agent-forge/backup-manager
Any agent
npx skills add Firstp1ck/pi-coding-agent-forge --skill backup-manager
Clone the repo
git clone --depth 1 https://github.com/Firstp1ck/pi-coding-agent-forge

Made for: Claude Code, Codex.

Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,427 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
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 $0.00046 $0.01427
Opus 5 $0.00023 $0.00714
Sonnet 5 $0.00009 $0.00285
Haiku 4.5 $0.00005 $0.00143

Measured 3d ago against content hash ae14ab99217f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

backup-manager scanned grade C with 2 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 3d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$TEMP_DIR"

Makes network callslowCapability

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

curl -s "http://<gitea-host>:3000/api/v1/user/repos" \
pi-skill-backup-manager/skills/backup-manager/SKILL.md · 208 lines

How it starts

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

Backup Manager

Verify, test, and manage backups across the infrastructure.

Quick Start

Verify a Git Backup

# Clone to temp directory and check integrity
TEMP_DIR=$(mktemp -d)
git clone --bare <repo-url> "$TEMP_DIR/test-repo" 2>&1
cd "$TEMP_DIR/test-repo"
git fsck --full --no-dangling
echo "Exit code: $?"
rm -rf "$TEMP_DIR"

Check Gitea Backup Status

# List repos on Gitea
curl -s "http://<gitea-host>:3000/api/v1/user/repos" \
  -H "Authorization: token <token>" | jq '.[].name'

# Check last push time
curl -s "http://<gitea-host>:3000/api/v1/repos/<owner>/<repo>" \
  -H "Authorization: token <token>" | jq '.updated_at'

Backup Verification

Git Repository Integrity

# Full integrity check
git fsck --full --no-dangling

# Check for corruption
git fsck --strict

# Verify all objects are reachable
git rev-list --all --objects | wc -l

Expected: Exit code 0, no errors. Any "broken link", "missing", or "corrupt" messages indicate problems.

File Count Verification

# Compare file counts between source and backup
# Source
find /path/to/source -type f | wc -l

# Backup
find /path/to/backup -type f | wc -l

Backup Freshness

A backup is only useful if it's recent enough. Check age:

# Last commit date in a git backup
git log -1 --format="%ci"

# Age of newest file in a directory backup
find /path/to/backup -type f -printf '%T@\n' | sort -n | tail -1 | xargs -I{} date -d @{}

Freshness criteria:

  • < 24h: Fresh
  • 24h–72h: Acceptable (check if auto-backup is running)
  • 72h: Stale (investigate why backups stopped)


Restore Testing

Git Restore Test

Full restore test to verify disaster recovery:

# 1. Create isolated test directory
TEST_DIR=$(mktemp -d)
echo "Testing restore in: $TEST_DIR"

# 2. Clone from backup source
git clone <backup-repo-url> "$TEST_DIR/restored" 2>&1

# 3. Verify integrity
cd "$TEST_DIR/restored"
git fsck --full

# 4. Verify structure (check key files exist)
for f in AGENTS.md APPEND_SYSTEM.md MEMORY.md; do
  if [ -f "$f" ]; then
    echo "OK: $f exists"
  else
    echo "MISSING: $f"
  fi
done

# 5. Count files
echo "Total files: $(find . -type f | wc -l)"

# 6. Cleanup
rm -rf "$TEST_DIR"

Read the full file on GitHub · 208 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. 3d ago First seen · 208 lines · 46 tokens per session scan C ae14ab99217f

Subscribe to this mod's changes

backup-manager is a skill published in the GitHub repository Firstp1ck/pi-coding-agent-forge (74 stars, last pushed 3d ago), licensed MIT. It adds 46 tokens to every session and 1,427 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.