This seems to be a recurring issue after every major OS update. You need to reinstall XCode and the Command Line Tools to get them working again.
Trying a ‘git status’ after upgrading to Ventura over the weekend, I get this error:
> git status xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
To fix this you need to reinstall the XCode Command Line Tools (described here) with:
xcode-select --install
Press Install when prompted:
After the install completes, restart your Terminal and you should be good to go.