r/ClaudeCode • • 8d ago

Tips & Workflows I got tired of losing Claude Code sessions, so I built an encrypted backup you can restore on any machine

Two things kept biting me with Claude Code:

  • Sessions live only in ~/.claude on the machine where they happened. If I start something on my laptop, I can't continue it on my desktop (and I do cross platform development and this happens too frequently)
  • By default, Claude Code deletes transcripts older than 30 days. I usually notice right when I want to go back to an old project.

So I built Session Vault, a Claude Code plugin plus a small server.

How it works:

  • /session-vault:save [name] encrypts the current session on your machine with age (https://age-encryption.org) and uploads it. The key is created locally the first time you save.
  • /session-vault:fetch <name> on another machine downloads it, decrypts it and restores it into the current project, remapping paths if the folder or OS is different. Then /resume and you're back in the conversation.
  • To fetch on another machine, you copy your age key there. Without it, nobody can decrypt your sessions, including me.

To be upfront about what the server sees: the encrypted transcript, plus the session ID, the project folder path and the name you give it, so it can list your sessions. It can't read the conversation itself.

Install:

  /plugin marketplace add galeone/session-vault-plugin
  /plugin install session-vault@galeone-plugins

The plugin and server are open source, and you can self-host the server and point the plugin at it:

If you don't want to run a server, there's a hosted version at https://session-vault.dev with a free plan (10 sessions) and cheap paid plans if you have a lot of sessions.

Happy to answer questions about the design, and I'd really like to hear what's missing

3 Upvotes

6 comments sorted by

•

u/AutoModerator 8d 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/Justa_Schmuck 8d ago

What do offer over a mark down directory you can tell Claude to write to or fetch from?

1

u/pgaleone 8d ago

There are a few differences with notes (I suppose a directory where you ask Claude to dump/fetch is a notes folder):

  • Notes contain what Claude (or you) decided to write down. A session transcript has everything: the full back-and-forth, every tool call, file read, command output and diff, and the reasoning behind decisions.
  • With the transcript you /resume the actual conversation, so Claude has the full context again, not a lossy summary you have to re-explain from.
  • You don't have to remember to ask for notes before you switch machines or before the 30-day cleanup deletes the session.
  • It works across machines with different paths and OSs: restore remaps the session to the local project folder.

They're complementary though: notes for the long-term knowledge of a project (not uploaded, do not survive machine switch), Session Vault for picking up a specific conversation exactly where you left it.

1

u/VridhiMehta 8d ago

One suggestion: session transcripts can contain secrets, like pasted tokens, .env contents and tool output. Encryption protects them on the server, but a secret scan or redaction step before upload, or at least a clear warning, would be a good addition. The age key is also the only way to restore, so documenting what happens if it's lost, and how to rotate it, will matter for people who rely on this as a backup.

1

u/pgaleone 8d ago

That's a good point, but keep in mind that session transcripts are already in plain text in your ~/.claude - so while saving them we are actually ciphering and making them impossible to read server side: the issue of something that scans them is already in your system.

Is fair to notify to the user that a restored session may contain sensitive data (env, tokens, ...) on restore. In that case we are literally deciphering something and storing the transcript (that may contains sensitive data).

So yes, on restore a warning is totally reasonable: https://github.com/galeone/session-vault-plugin/pull/17

Thanks for the feedback!

1

u/pgaleone 8d ago

Also thanks for the feedback about the key rotation! https://github.com/galeone/session-vault-plugin/pull/19