This is really cool, and has inspired the latest function to be added to my zshrc:
vscodetmp () {
local repo=$1
[[ ! $repo =~ "https://*" ]] && repo="https://github.com/${repo}"
local temp="$(mktemp -d)"
git clone "${repo}" "${temp}"
code --wait -n "${temp}"
rm -rf "${temp}"
}