Skip to content

samuelpatro/.claude / .claude/skills/sync-claude

sync-claude

Verified

Sync the live ~/.claude global config (settings.json, CLAUDE.md, statusline.ts, own skills, skills.sh lock file) into this git backup repo, then commit. Allowlist-based so credentials, history, and project transcripts are never copied. Use when the user says "sync my claude config", "back up .claude", "update the .claude repo", or runs "/sync-claude".

FileKindSize
SKILL.mdskill md3.0 KB
install-skills.tsscript1.8 KB
sync.tsscript8.3 KB
---
name: sync-claude
description: Sync the live ~/.claude global config (settings.json, CLAUDE.md, statusline.ts, own skills, skills.sh lock file) into this git backup repo, then commit. Allowlist-based so credentials, history, and project transcripts are never copied. Use when the user says "sync my claude config", "back up .claude", "update the .claude repo", or runs "/sync-claude".
---

# Sync Claude config to git

Backs up the user's live global Claude Code config (`~/.claude`) into this repo.
This is a project skill of the backup repo, it is not installed globally.

## What it touches

Only these paths are ever read (the allowlist lives in `sync.ts`):

- `~/.claude/settings.json`, `CLAUDE.md`, `statusline.ts`
- `~/.claude/skills/*` that are NOT listed in the skills.sh lock file. These are
  the user's own skills and are mirrored into `skills/<name>/`.
- `~/.agents/.skill-lock.json`, the manifest the skills.sh CLI keeps for skills
  it installed into `~/.agents/skills` and symlinked into `~/.claude/skills`.
  Copied to `.agents/.skill-lock.json`. Those skills are never vendored here;
  `install-skills.ts` reinstalls them from the lock on a new machine.

Everything else in `~/.claude` (`.credentials.json`, `history.jsonl`, `projects/`,
`sessions/`, `todos/`, `tasks/`, ...) is never read. That allowlist is the primary
defense against leaking secrets. A value-shaped secret scan on the copied content
is a second safety net: if a key or token ever appears inside an allowlisted file,
that file (or that whole skill) is skipped.

## Steps

1. From the repo root, show what would change (copies nothing):

   ```
   bun .claude/skills/sync-claude/sync.ts
   ```

   `orphan` lines are skill folders in the repo that are not live own skills.
   A skill "managed by skills.sh" got vendored by mistake: delete it from
   `skills/`. A skill "not in ~/.claude/skills" was removed live: delete it, or
   copy it back to `~/.claude/skills/` if the removal was an accident.

2. Apply the copy:

   ```
   bun .claude/skills/sync-claude/sync.ts --apply
   ```

   If it exits non-zero, a possible secret was detected. Stop, show the user the
   flagged line, and do not commit.

3. Review and commit on `main` (this repo commits directly to main, no PR):

   ```
   git status
   git diff
   git add -A settings.json CLAUDE.md statusline.ts skills .agents
   git commit -m "chore: sync live .claude config"
   ```

   Do not push unless the user asks.

## Restoring skills.sh skills

```
bun .claude/skills/sync-claude/install-skills.ts --list   # print the commands
bun .claude/skills/sync-claude/install-skills.ts          # run them
```

One `bunx skills add <source> -g -y -a claude-code -s <names>` per source repo.

## Notes

- Line endings are normalized to LF on copy, so CRLF/LF differences never show up
  as spurious changes.
- `statusline.ts` is the source. The live status line runs the compiled
  `statusline` binary, which is large and not tracked.
- To add another top-level file to the backup, add its name to `FILES` in
  `sync.ts` (and make sure it never contains secrets).
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 323kUpdated Claude CodeCodexVerifiedInstall