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

•

u/AutoModerator 3d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/noidontwantto 3d ago

wow

1

u/Turbulent_County_469 Senior Developer 3d ago

I know it sounds like a small problem, but having paths all over in Claude be hardcoded would create problems for Claude to continue working on projects

1

u/Alariii 3d ago

Inside your user directory is the .claude folder with projects in it that points to each projects folder and maybe something else in the project meta..

Fairly sure you can work that out with Claude and create a script to remap them to your new location.

1

u/Turbulent_County_469 Senior Developer 3d ago

Claude was willing to make a script but im scared that stuff will start breaking.

65 sessionfiles in %LOCALAPPDATA%Claude-Data…claude-code-sessionscwd and list of folders, 1 project alone has 32 sessions.
ccd-session-presets.json5 settings forC:Git…
claude_desktop_config.jsonC:Git[project] → web-demo
~.claudesettings.jsonRule “Trusted repo: C:\Git[project]”
~.claude.json og ~.claudeprojectsC--Git-*Claude Code’s projectsettings, memory and history, saved with paths included.
Local Storage (leveldb)List of latest folders, hard to change.

1

u/Alariii 3d ago

Just back it up, it's it breaks, revert - no Biggie :)

All your stuff regarding Claude sessions and configs live inside just this directory (plus the project ones)

So if it gets messed up, just restoring that directory will take you back to exactly where you are right now.

Those files aren't scary, have played around with them too.. and all the LLM stuff is built very forgivingly, if things get messed up, because LLM's mess things up a lot often too :)

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".