The repo owner gets to define the base Docker image that’s used in the codespace. And then it also looks for a dotfiles repo under your user account, which you can use to install all of your personal customizations. You can see mine at https://github.com/dcreager/dotfiles
The codespaces can have their own dotfiles.
Just use an sshfs mount and a local editor.
I think this defeats the purpose of Codespaces, because it would mean that all the code runs locally and only thing that remote server provides is storage?