cos: Skill for Claude Code

.claude/skills/backup-recovery/SKILL.md

backup-recovery is a skill for Claude Code from philipyaz/cos. It costs 134 tokens per session (4,996 once invoked), scanned A, original, MIT.

A backup and recovery runbook for live application data, including board, guard, configuration, and vault files. It creates encrypted daily snapshots in a private GitHub repository and keeps the recovery key in the macOS Keychain.

In plain words
What is it for?
Setting up backups on a new machine, taking verified backups before risky changes, and restoring encrypted off-site snapshots.
Why use it?
It protects against data loss when local backups are deleted, damaged, or unavailable.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is philipyaz/cos's own configuration. It tells Claude Code how to work on cos itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cos configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node backup/backup.mjs # archive → encrypt → commit → push.

Reuse

Borrowing it

Nothing to install: this file belongs to philipyaz/cos. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/philipyaz/cos/main/.claude/skills/backup-recovery/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/philipyaz/cos

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 backup-recovery

README.md
[![agentmods](https://agentmods.dev/badge/skills/philipyaz/cos/backup-recovery/github.svg)](https://agentmods.dev/skills/philipyaz/cos/backup-recovery)
Your own site
<a href="https://agentmods.dev/skills/philipyaz/cos/backup-recovery"><img src="https://agentmods.dev/badge/skills/philipyaz/cos/backup-recovery/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 backup-recovery

Your own site · 80×15
<a href="https://agentmods.dev/skills/philipyaz/cos/backup-recovery"><img src="https://agentmods.dev/badge/skills/philipyaz/cos/backup-recovery.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 134 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,996 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00134 $0.04996
Opus 5 $0.00067 $0.02498
Sonnet 5 $0.00027 $0.00999
Haiku 4.5 $0.00013 $0.00500

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

Security

Grade A, and why

backup-recovery scanned grade A with 0 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 10d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/backup-recovery/SKILL.md · 332 lines

How it starts

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

Backup & Recovery

The board (board/data/), guard (guard/data/), config (config/), and vault (vault/<VAULT_NAME> — the active vault from config/cos.env) are real, live data. The local rolling snapshots in board/data/backups/ are crash-safety only — count-pruned, same-disk, deletable. This skill operates the durable layer: daily AES-256-GCM-encrypted snapshots in a private GitHub repo (backup/), where git history is immutable, off-site, and versioned.

Implementation lives in backup/ (see backup/README.md). This skill is the operator runbook. Golden rule: never run a bulk or destructive operation on live data without a fresh, VERIFIED backup first (Backup now below). The data-loss incident that motivated this skill happened because live data was edited and the only backups were local + count-pruned.


0. Concepts (read once)

  • Recovery key — one high-entropy passphrase; the ONLY way to decrypt. Stored in the macOS login Keychain (security item cos-backup-key) AND an offline copy in your password manager. Never in any repo, never logged. Lose it → backups are unrecoverable.
  • Backup repo — a PRIVATE GitHub repo (local clone at $BACKUP_REPO). Holds snapshots/cos-backup-<ts>.enc + per-device manifests manifests/<deviceId>.json (one per producing machine — the deviceId is COS_DEVICE_ID from config/cos.env, else a sanitized hostname; a legacy single MANIFEST.json from before the split is still READ, never written). Private and encrypted = a repo leak exposes nothing. Its location is config-driven: config/cos.env BACKUP_REPO (the loader exports it as $BACKUP_REPO), defaulting to ~/.cos-backups when unset. This config value is the EXPECTED repo; backup.mjs refuses to run against any other effective path (see §6 Relocating + the fail-closed guard). Multiple machines may produce into ONE archive: each run converges with the remote first (fetch + rebase), and a machine's FIRST run must decrypt-verify the newest existing snapshot with its local key (producer admission) — a wrong key is refused before it can split the archive.
  • Scopebackup/config.mjs SCOPE: board data, guard data, config, the vault. The vault entry is resolved from config/cos.env VAULT_NAME (vault/<VAULT_NAME>, the same active vault setup-vault records), so a renamed/relocated vault is always captured — never silently dropped. If the configured vault dir is missing at backup time, backup.mjs logs a loud WARN (visible in the /backups log tails) rather than omitting it quietly. Falls back to vault/my-personal-thoughts-vault when VAULT_NAME is unset (a slug guard rejects any name with a path separator).
  • Three triggers, one floor — the launchd 03:30 agent is the GUARANTEED DAILY FLOOR. While the board is running it ADDS two more triggers of the SAME backup/backup.mjs: an opportunistic top-up (fires non-blocking from hot read routes when the newest snapshot is >12h old) and the "Back up now" button on the board's /backups surface. All three callers are serialized by a single-flight lock inside backup.mjs (see §3 + §6) and share the same exit codes.
  • Board /backups surface — a READ-ONLY health UI (board sidebar → Review → Backups; the Backups item sits next to Security/Trash/Activity, it is NOT nested under Security). The new at-a-glance health check: a healthy/warning/error verdict, last-run time/size/store-count, push-state, snapshot history, log tails, the repo-path provenance, and a Setup & Diagnostics readiness card. Look here FIRST; the CLI below is the headless fallback. See §4.

Read the full file on GitHub · 332 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. 10d ago First seen · 332 lines · 134 tokens per session scan A f0dc301398be

Subscribe to this mod's changes

backup-recovery is a skill published in the GitHub repository philipyaz/cos (4 stars, last pushed today), licensed MIT. It adds 134 tokens to every session and 4,996 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

wiki-lint

Health-check a wiki vault. Finds orphan pages (no inbound links), dead wikilinks (point to non-existent pages), missing frontmatter fields, stale claims, empty sections, and pages absent from catalog.md. Produces a structured report with severity tiers and proposes concrete fixes — but does not auto-apply them unless…

tboome33/obsidian-mcp-router · 119 tokens

opencode-plugin-idioms

Event hook payload shapes, session lifecycle timing, toast/TUI-route render boundaries, and child-session tagging conventions for OpenCode server (@opencode-ai/plugin) and TUI (@opencode-ai/plugin/tui) plugins, grounded in the vendored OpenCode source at references/opencode.

kagan-sh/kagan · 64 tokens

meta-sync-template

Interactive flow to propagate the reference (.template) vault's plugins, snippets, and root docs to one or more configured vaults. Reads the active router config, lists every vault with online status, flags vaults missing obsidian-local-rest-api upfront, lets the user pick all or a subset, and optionally re-clones…

tboome33/obsidian-mcp-router · 159 tokens

save

File the current Claude conversation (or a specific insight from it) as a structured wiki note. Auto-detects the right type (decision, answer, session-log, technique, ADR), writes appropriate frontmatter, places the file in the correct wiki folder, and updates catalog.md, journal.md, hot.md. Use when the user says…

tboome33/obsidian-mcp-router · 112 tokens

wiki-export

Export a vault's wiki either as a single portable file (llms.txt or llms-full.txt per the llmstxt.org standard) or as an OKF knowledge bundle (Google's Open Knowledge Format v0.1 — a shareable directory of markdown files any AI agent can consume). Use when the user says "export my wiki", "make an llms.txt", "share my…

tboome33/obsidian-mcp-router · 129 tokens

wiki-boundary

Rank the "frontier" pages of a wiki — the crossroads many pages link to that stay thin inside — so you can decide where research would pay off most. Use when the user says "what should I write about next", "where are the gaps", "which pages need work", "find the thin hub pages", "boundary pages", "/wiki-boundary"…

tboome33/obsidian-mcp-router · 141 tokens