Claude Code Backup banner
placenameday placenameday

Claude Code Backup

Development community

Description

Back up your Claude Code config (~/.claude/) with automatic secret sanitization. A single slash command — no official backup exists.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

claude-code-backup

Back up your entire Claude Code configuration (`~/.claude/`) with **automatic secret sanitization** — all tokens, keys, and credentials are replaced with descriptive placeholders before export.

Why?

  • No official backup/export/sync exists in Claude Code (#22648, 6+ duplicate issues, zero Anthropic response)
  • Config corruption from concurrent instances is an active bug (#29004, #29395)
  • claude-code-exporter only exports conversations, not config
  • Manual backup is tedious and error-prone — easy to leak secrets

Install

# One-liner: copy the command file
mkdir -p ~/.claude/commands && curl -o ~/.claude/commands/backup.md \
  https://raw.githubusercontent.com/placenameday/claude-code-backup/main/backup.md

Or manually copy `backup.md` to `~/.claude/commands/`.

Usage

In any Claude Code session:

/backup

Output: `~/Desktop/claude-code-backup-{YYYYMMDD}.tar.gz`

What Gets Backed Up

Included Description
settings.json Plugins, MCP servers, hooks, env vars, permissions
config.json API key config
.credentials.json OAuth tokens (sanitized)
CLAUDE.md Global instructions
agents/ Custom agent definitions
commands/ Custom slash commands
skills/ Custom skills
memory/ Persistent memory files
plugins/*.json Installed plugins & marketplace config

**Skipped** (session/transient data): `debug/`, `session-env/`, `file-history/`, `history.jsonl`, `cache/`, `telemetry/`, `todos/`, `tasks/`, `backups/`, `paste-cache/`, `projects/`, `logs/`, `stats-cache.json`

Secret Sanitization

Claude dynamically scans your config and replaces secrets with descriptive placeholders:

| Pattern | Examp