Skip to content

Instantly share code, notes, and snippets.

@isurfer21
Created April 17, 2026 05:43
Show Gist options
  • Select an option

  • Save isurfer21/afd642c6ea04eb8a143aad47ca8befb3 to your computer and use it in GitHub Desktop.

Select an option

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.
#!/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