# Claude Code Archiver

> Download, prettify, and archive @anthropic-ai/claude-code npm packages. Use when user asks to "archive claude code", "download claude code", "get latest claude code", "npm pack claude code", or needs to set up a new Claude Code version in ~/swe/archive with prettified cli.js and git history.

- Skill: `tankygranny05/claude-code-archiver` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tankygranny05/claude-code-archiver`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tankygranny05/claude-code-archiver/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tankygranny05 (https://skillmd.com/u/tankygranny05)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/tankygranny05/claude-code-archiver

---


# Claude Code Archiver

Archive Claude Code npm packages with prettified source and git tracking.

## Quick Reference

**Archive locations:**
- Archive: `~/swe/archive/claude-code-{version}/`
- Production: `~/swe/claude-code-{version}/`
- Tarballs kept: `~/swe/archive/anthropic-ai-claude-code-{version}.tgz`

**First commit message:** `Sotola: Pristine from Anthropic`

## Workflow

### 1. Download and Archive

```bash
cd ~/swe/archive
npm pack @anthropic-ai/claude-code
# Note the version from output (e.g., 2.1.7)

tar -xzf anthropic-ai-claude-code-X.Y.Z.tgz
mv package claude-code-X.Y.Z
cd claude-code-X.Y.Z

# Prettify bundled cli.js (adds newlines/indentation)
npx prettier --write --tab-width 2 --use-tabs false --print-width 80 cli.js

# Initialize git
git init && git add -A
git commit -m "Sotola: Pristine from Anthropic"
```

### 2. Clone to Production

```bash
git clone ~/swe/archive/claude-code-X.Y.Z ~/swe/claude-code-X.Y.Z
```

## Scripts

Two helper scripts in `scripts/`:

- **archive-claude-code.sh** - Downloads latest, extracts, prettifies, commits
- **clone-to-production.sh VERSION** - Clones archived version to ~/swe/

## Notes

- Prettification expands cli.js from ~11MB to ~16MB (formatting adds whitespace)
- Keep .tgz files in archive for reference
- Production clones track the archive as origin remote

