ast-grep-npm-install-overwrites-system-sg-newgrp-symlink

npm install -g @ast-grep/cli places sg binary at /usr/bin/sg, overwriting the system sg → newgrp symlink silently — even without --force. After installation, immediately restore with ln -sf /usr/bin/newgrp /usr/bin/sg. Reference ast-grep via /usr/bin/ast-grep directly in scripts rather than relying on the sg alias.