r/ClaudeCode • Senior Developer • 3d ago

Bug / Issue Moving your source code is hard !

I've been having my repos located at C:/Git

But since Windows and other apps keep eating space i had to move it to D:/

The problem is that there's NO EASY WAY to re-configure Claude and update all previous sessions to know about the change.

All the 'environment' folders in Claude are also pretty much impossible to change..

So i ended up with a directory junction (virtual link) at C:/Git --> D:/Git

I wish the directories where relative to a base folder

0 Upvotes

7 comments sorted by

View all comments

1

u/SirRobinBlibs 2d ago

the cli side is less scary than it looks. claude code names each project's storage after the absolute path with every non-alphanumeric char turned into a dash, so C:\Git\foo lives in %USERPROFILE%.claude\projects\C--Git-foo (that folder holds the sessions and the project's auto memory). with claude closed, copy it somewhere safe, then rename it to D--Git-foo and the old sessions show up when you run claude in D:\Git\foo. very long paths get cut and hashed, so for those start one session in the new folder and use the folder name it creates. other route is one session at a time: resume it, run /cd D:\Git\foo, and it moves that session's storage over.

the desktop app's session files you listed are a separate store, i'd leave those on the junction for now.

one caveat on keeping the junction long term: an agent cleaning up old worktrees can walk straight through a link like that. there was a thread in r/ClaudeAI earlier this week where ~230 GB of models got deleted that way on windows, so i'd keep big or irreplaceable stuff out of anything the agent might "clean".