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