mit einem Klick
ai-tools-management
// Scan, back up, clean, and uninstall AI development tools on macOS. Use when the user asks about AI tool disk usage, wants to clean caches, back up chat histories, or completely remove an AI coding assistant.
// Scan, back up, clean, and uninstall AI development tools on macOS. Use when the user asks about AI tool disk usage, wants to clean caches, back up chat histories, or completely remove an AI coding assistant.
[HINT] Laden Sie das komplette Skill-Verzeichnis einschließlich SKILL.md und aller zugehörigen Dateien herunter
| name | ai-tools-management |
| description | Scan, back up, clean, and uninstall AI development tools on macOS. Use when the user asks about AI tool disk usage, wants to clean caches, back up chat histories, or completely remove an AI coding assistant. |
| author | Henri |
| created | 2026-03-12 |
| last_updated | 2026-03-13 |
Scan, back up, clean, and uninstall AI development tools on macOS.
Non-negotiable. Violating any rule risks permanent data loss.
sqlite3 ... "PRAGMA integrity_check" on databases.pgrep -f <process> — warn the user to close running tools first.rm -rf on dynamically constructed paths without validation. Verify path is not empty, not a system directory, and falls under a known tool data directory./Applications/*.app bundles. Never sudo rm -rf with variable paths.trash() {
for path in "$@"; do
if [ -e "$path" ]; then
osascript -e "tell application \"Finder\" to delete POSIX file \"$path\"" 2>/dev/null || \
mv "$path" ~/.Trash/ 2>/dev/null || \
rm -rf "$path"
fi
done
}
| Tool | ID | Detect App | Detect Data | Process Name |
|---|---|---|---|---|
| VS Code | vscode | /Applications/Visual Studio Code.app | ~/Library/Application Support/Code/ | Electron (Code) |
| Cursor | cursor | /Applications/Cursor.app | ~/.cursor/ | Cursor |
| Windsurf | windsurf | /Applications/Windsurf.app | ~/.windsurf/, ~/.codeium/ | Windsurf |
| Claude Code | claude-code | — (CLI) | ~/.claude/ | claude |
| OpenCode | opencode | — (CLI) | ~/.local/share/opencode/ | opencode |
echo "=== AI Tool Detection ==="
for p in \
"/Applications/Visual Studio Code.app" \
"/Applications/Cursor.app" \
"/Applications/Windsurf.app" \
"$HOME/.windsurf" \
"$HOME/.codeium" \
"$HOME/.claude" \
"$HOME/.local/share/opencode" \
"$HOME/.opencode"; do
if [ -e "$p" ]; then
size=$(du -sh "$p" 2>/dev/null | cut -f1)
echo " ✅ Found: $p ($size)"
fi
done
/Applications/Visual Studio Code.app # App bundle (~715M)
~/.vscode/extensions/ # Installed extensions (~2G+)
~/Library/Application Support/Code/
├── User/settings.json # ⛔ CONFIG
├── User/keybindings.json # ⛔ CONFIG
├── User/workspaceStorage/<hash>/
│ ├── state.vscdb # SQLite: workspace state
│ └── chatSessions/ # ⚠️ CHAT: Copilot chat logs (JSON)
├── User/globalStorage/state.vscdb # Global state DB
├── CachedExtensionVSIXs/ # ✅ CACHE
├── CachedData/ # ✅ CACHE
├── Cache/ # ✅ CACHE
├── WebStorage/ # 🟡 MODERATE
├── logs/ # ✅ CACHE
└── History/ # 🟡 MODERATE
~/Library/Caches/com.microsoft.VSCode/ # ✅ CACHE
~/Library/Saved Application State/com.microsoft.* # ✅ CACHE
Chat extraction:
find ~/Library/Application\ Support/Code/User/workspaceStorage \
-name "*.json" -path "*/chatSessions/*" 2>/dev/null
Duplicate extension detection:
ls ~/.vscode/extensions/ 2>/dev/null | \
sed 's/-[0-9]*\.[0-9]*\.[0-9]*$//' | sort | uniq -d | while read ext; do
echo "Duplicate: $ext"
ls -d ~/.vscode/extensions/${ext}-* 2>/dev/null | while read dir; do
echo " $dir ($(du -sh "$dir" | cut -f1))"
done
done
/Applications/Cursor.app # App bundle
~/.cursor/
├── extensions/ # ✅ CACHE — reinstallable (~627M)
├── projects/ # ⛔ CONFIG
├── ai-tracking/ai-code-tracking.db # ⚠️ CHAT — SQLite (may be empty)
└── *.json # ⛔ CONFIG
/Applications/Windsurf.app # App bundle
~/.windsurf/
├── extensions/ # ✅ CACHE — installed extensions (~1G+)
├── plans/ # 🟡 MODERATE
└── worktrees/ # 🟡 MODERATE
~/.codeium/windsurf/
├── cascade/*.pb # ⚠️ CHAT — Protobuf binary (~80M)
├── database/ # 🟡 MODERATE — embedding DB (~62M)
├── memories/ # ⛔ CONFIG — global rules
├── codemaps/ # 🟡 MODERATE
└── implicit/ # 🟡 MODERATE
Notes:
.pb files cannot be converted to text without the .proto schema. Always preserve originals.~/.windsurf/extensions/ can be reinstalled from Marketplace.ls ~/.windsurf/extensions/ 2>/dev/null | \
sed 's/-[0-9].*$//' | sort | uniq -d | while read ext; do
echo "Duplicate: $ext"
ls -d ~/.windsurf/extensions/${ext}-* 2>/dev/null | while read dir; do
echo " $(du -sh "$dir" | cut -f1) - $(basename "$dir")"
done
done
~/.claude/
├── history.jsonl # ⚠️ CHAT — command history
├── settings.json # ⛔ CONFIG + 🔴 SENSITIVE (may contain API tokens)
├── projects/ # ⛔ CONFIG — per-project data and CLAUDE.md
├── shell-snapshots/ # ✅ CACHE
├── todos/ # 🟡 MODERATE
├── skills/ # ⛔ CONFIG — skill definitions
└── plugins/ # ⛔ CONFIG
Sensitive data check:
grep -E "(TOKEN|KEY|SECRET|PASSWORD)" ~/.claude/settings.json 2>/dev/null
~/.local/share/opencode/
├── opencode.db # ⚠️ CHAT — SQLite (~14M)
├── opencode.db-shm # temp
└── opencode.db-wal # temp
~/.opencode/ # ⛔ CONFIG (if exists)
Chat extraction:
db="$HOME/.local/share/opencode/opencode.db"
if [ -f "$db" ]; then
echo "Sessions: $(sqlite3 "$db" 'SELECT COUNT(*) FROM session;')"
echo "Messages: $(sqlite3 "$db" 'SELECT COUNT(*) FROM message;')"
fi
Goal: Discover installed AI tools and report space usage.
du -sh <path> 2>/dev/nullGoal: Export chat histories and critical configs before destructive operations.
~/Downloads/ai-tools-backup-$(date +%Y%m%d-%H%M%S)/manifest.json with tool details, file counts, checksumstar czfAlways scan first. Always dry-run before executing.
| Target | Tool | Command |
|---|---|---|
| Extension VSIX cache | VS Code | trash ~/Library/Application\ Support/Code/CachedExtensionVSIXs |
| App cache | VS Code | trash ~/Library/Application\ Support/Code/CachedData |
| Browser cache | VS Code | trash ~/Library/Application\ Support/Code/Cache |
| State DB backup | VS Code | trash .../User/globalStorage/state.vscdb.backup |
| Old logs (>7d) | VS Code | find .../Code/logs -mtime +7 -exec trash {} + |
| Duplicate extensions (old versions) | VS Code/Cursor/Windsurf | detect then trash older dirs |
| Shell snapshots | Claude Code | trash ~/.claude/shell-snapshots |
| System cache | VS Code | trash ~/Library/Caches/com.microsoft.VSCode |
| Target | Tool | Notes |
|---|---|---|
| Bundled Chromium | Windsurf | ws-browser/ ~465M, re-downloaded on launch |
| WebStorage | VS Code | ~1.4G browser storage |
| All extensions | Cursor/Windsurf | reinstallable from Marketplace |
| Target | Tool | Notes |
|---|---|---|
| All extensions | VS Code | ~2.2G, private extensions may be lost |
| Embedding database | Windsurf | rebuilt on next indexing |
| Extension data (globalStorage) | VS Code | may contain extension state |
Dry-run template:
echo "=== DRY RUN ==="
total=0
for target in \
"$HOME/Library/Application Support/Code/CachedExtensionVSIXs" \
"$HOME/Library/Application Support/Code/CachedData" \
"$HOME/Library/Application Support/Code/Cache"; do
if [ -d "$target" ]; then
size=$(du -sk "$target" 2>/dev/null | cut -f1)
total=$((total + size))
echo " Would delete: $target (${size}K)"
fi
done
echo "Total to free: $((total / 1024))M"
Goal: Completely remove an AI tool.
Per-tool uninstall commands:
trash ~/.vscode ~/Library/Application\ Support/Code ~/Library/Caches/com.microsoft.VSCode + sudo rm -rf "/Applications/Visual Studio Code.app"trash ~/.cursor + sudo rm -rf "/Applications/Cursor.app"trash ~/.windsurf ~/.codeium + sudo rm -rf "/Applications/Windsurf.app"trash ~/.claude + npm uninstall -g @anthropic-ai/claude-codetrash ~/.local/share/opencode ~/.opencode + trash "$(which opencode)"When scanning or backing up, check and warn:
| Pattern | Type |
|---|---|
*TOKEN*, *_KEY, *SECRET* | API credentials |
ANTHROPIC_*, OPENAI_*, GOOGLE_* | AI service tokens |
mongodb://, postgres:// | Connection strings |
grep -rIl -E "(TOKEN|API_KEY|SECRET|PASSWORD|mongodb://|postgres://)" <directory> 2>/dev/null
When encountering an unlisted AI tool:
~/.<tool>, ~/.local/share/<tool>, ~/Library/Application Support/<Tool>