forked from FlorianBruniaux/claude-code-ultimate-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean-reinstall-claude.sh
More file actions
33 lines (26 loc) · 1.03 KB
/
clean-reinstall-claude.sh
File metadata and controls
33 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# ⚠️ Warning: This will delete all Claude Code data and configuration
# Backup your CLAUDE.md files and settings first!
echo "Starting Claude Code clean reinstall..."
# 1. Uninstall
echo -e "\n[1/5] Uninstalling Claude Code..."
npm uninstall -g @anthropic-ai/claude-code
# 2. Remove global bin files
echo "[2/5] Removing npm global files..."
rm -f "$(npm config get prefix)/bin/claude"
rm -rf "$(npm config get prefix)/lib/node_modules/@anthropic-ai/claude-code"
# 3. Delete cache and local data
echo "[3/5] Deleting cache and local data..."
rm -rf ~/.claude/downloads/*
rm -rf ~/.claude/local
# 4. Backup and remove config (optional)
echo "[4/5] Backing up config..."
timestamp=$(date +%Y%m%d-%H%M%S)
cp ~/.claude.json ~/.claude.json.backup-$timestamp 2>/dev/null || true
# Uncomment next line to remove config:
# rm -f ~/.claude.json
# 5. Reinstall
echo "[5/5] Reinstalling Claude Code..."
npm install -g @anthropic-ai/claude-code
echo -e "\n✓ Clean reinstall complete!"
echo "Run 'claude --version' to verify installation"