Created
April 17, 2026 05:43
-
-
Save isurfer21/afd642c6ea04eb8a143aad47ca8befb3 to your computer and use it in GitHub Desktop.
A zsh script to uninstall claude code, if installed via curl or shell-script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| confirm() { | |
| local prompt="$1" | |
| local response | |
| while true; do | |
| # -n prevents newline, read -r prevents backslash escapes | |
| read -r "?$prompt [y/N]: " response | |
| case "$response" in | |
| [yY][eE][sS]|[yY]) return 0 ;; # Yes | |
| [nN][oO]|[nN]|"") return 1 ;; # No or empty | |
| *) echo "Please answer yes or no." ;; | |
| esac | |
| done | |
| } | |
| removeBinary() { | |
| echo "Remove the claude binary" | |
| rm -f ~/.local/bin/claude | |
| rm -rf ~/.local/share/claude | |
| } | |
| removeData() { | |
| echo "Remove the claude data" | |
| rm -rf ~/.claude | |
| } | |
| main() { | |
| echo "Uninstall Claude Code" | |
| if confirm "Remove Claude Binary. Are you sure?"; then | |
| removeBinary | |
| else | |
| echo "Skipped" | |
| fi | |
| if confirm "Remove Claude Data. Are you sure?"; then | |
| removeData | |
| else | |
| echo "Skipped" | |
| fi | |
| echo "Done!" | |
| } | |
| main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment