? @anthropic-ai/claude-code Uninstall and Complete Cleanup Guide
Applies to: the @anthropic-ai/claude-code package installed globally or locally via npm
? Step 1: Check the Installation Location
Check whether it is installed in a local project
npm ls @anthropic-ai/claude-code
Check whether it is installed globally npm ls -g @anthropic-ai/claude-code
? Step 2: Run the Uninstall
Uninstall the locally installed package npm uninstall @anthropic-ai/claude-code
Uninstall the globally installed package npm uninstall -g @anthropic-ai/claude-code
? Step 3: Clean Up Leftover Folders
Check whether any empty directory remains in node_modules ls -la ~/node_modules/@anthropic-ai
Delete the leftover local directory (if it exists) rm -rf ~/node_modules/@anthropic-ai
View the global module directory npm root -g Example result: /opt/homebrew/lib/node_modules
Delete the leftover global directory (if it exists) sudo rm -rf /opt/homebrew/lib/node_modules/@anthropic-ai
? Step 4: Clear the npm Cache (Optional)
npm cache clean --force
##? Step 5: Check for Any Remaining References
Search whether any config under your home directory still references this package grep -r "@anthropic-ai/claude-code" ~
Search the whole system for any leftover directory (optional, slower) sudo find / -name "claude-code" 2>/dev/null
✅ Confirm After Cleanup Is Complete
- No local dependency remains
- No global dependency remains
- The node_modules/@anthropic-ai directory has been deleted
- The npm cache has been cleared
- grep and find find no references
? Your system has now completely removed @anthropic-ai/claude-code