I’ve tried things like that before but never got on with them. I found when I had many projects with similar directory structures it was easy to end up in the wrong place and took more thought to get to the right place than just cding
Happens whenever my laptop goes to sleep and it’s really annoying. As far as I could tell it’s a KDE bug. The only fix (which didn’t work for me) is apparently to stop it trying to dynamically detect displays.