The recommended method for storing code files when using VS Code and OneDrive is to store the files locally in a directory that won't get backed up to OneDrive. This will allow you to access the code from different computers without any issues. GitHub is a good option for working on and synchronizing coding projects on different machines.
References:
- Configure your local environment for deploying Python web apps on Azure - Working with Visual Studio Code
- Get started using Python on Windows for beginners - Install Git (optional)
- How Visual Studio makes version control easy with Git
- Set up file storage and sharing in Microsoft 365 - Microsoft 365 document storage and management