All Is there any way to disable the sidebar in Code permanently? I've searched everywhere. in I can't find this option in code and OS settings.
It looks like hiding the sidebar permanently hasn't been implemented into Code. Indeed, the app always restores its sidebar after restart, and, as far as I know, there is no shortcut for toggling the sidebar as well. You can suggest to implement this feature via the dedicated elementary/code github page.
For anyone stumbling across this (like me):
In the coming Elementary OS 6.0 Odin this is fixed and the sidebar will stay as it is set. So if you want to have this feature for Elementary Code, you can just update Elementary OS as soon as Odin is available :)