Skip to content

📦 @anthropic-ai/claude-code Uninstall and Complete Cleanup Guide

For: npm global or local installations of @anthropic-ai/claude-code package

🧭 Step 1: Check Installation Location


Check if installed in local project

npm ls @anthropic-ai/claude-code

Check if globally installed npm ls -g @anthropic-ai/claude-code

🧹 Step 2: Execute Uninstall


Uninstall locally installed package npm uninstall @anthropic-ai/claude-code

Uninstall globally installed package npm uninstall -g @anthropic-ai/claude-code

📁 Step 3: Clean Residual Folders


Check if empty directories still exist in node_modules ls -la ~/node_modules/@anthropic-ai

Delete local residual directory (if exists) rm -rf ~/node_modules/@anthropic-ai

View global modules directory npm root -g Example result: /opt/homebrew/lib/node_modules

Delete global residual directory (if exists) sudo rm -rf /opt/homebrew/lib/node_modules/@anthropic-ai

🧼 Step 4: Clean npm Cache (Optional)


npm cache clean --force

##🔍 Step 5: Check for Remaining References


Search user directory for configuration references to the package grep -r "@anthropic-ai/claude-code" ~

Search entire system for residual directories (optional, slower) sudo find / -name "claude-code" 2>/dev/null

✅ Confirm After Cleanup


  • No local dependency residuals
  • No global dependency residuals
  • node_modules/@anthropic-ai directory deleted
  • npm cache cleared
  • grep and find show no references

🎉 Your system has now completely removed @anthropic-ai/claude-code