Is it at least guaranteed that if you open a notebook in a fresh notebook server and implicitly start a kernel by running some code, it will get pwd the folder the ipynb-file is in? No. It is not ...