<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tarun Gupta</title>
    <description>The latest articles on DEV Community by Tarun Gupta (@gtarun).</description>
    <link>https://dev.to/gtarun</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4236565%2F569cbdc9-6420-4fef-8dea-fdb5bf727b43.jpg</url>
      <title>DEV Community: Tarun Gupta</title>
      <link>https://dev.to/gtarun</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gtarun"/>
    <language>en</language>
    <item>
      <title>How Claude Desktop stores Code sessions, and how I share them across accounts</title>
      <dc:creator>Tarun Gupta</dc:creator>
      <pubDate>Tue, 10 Nov 2026 07:57:03 +0000</pubDate>
      <link>https://dev.to/gtarun/how-claude-desktop-stores-code-sessions-and-how-i-share-them-across-accounts-pej</link>
      <guid>https://dev.to/gtarun/how-claude-desktop-stores-code-sessions-and-how-i-share-them-across-accounts-pej</guid>
      <description>&lt;p&gt;I use Claude Code inside Claude Desktop with two accounts on the same laptop: a personal one and a work one. For a while, one small thing annoyed me every day:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;every time I switched accounts, my entire Code sidebar changed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The session I'd been working in an hour earlier was simply gone until I switched back. Nothing was deleted. It just belonged to the other account.&lt;/p&gt;

&lt;p&gt;So I dug into where Claude Desktop keeps those sessions, and wrote a small open-source helper, &lt;a href="https://github.com/gtarun/My-Shared-Claude" rel="noopener noreferrer"&gt;My Shared Claude&lt;/a&gt;, that gives all my accounts one shared local session list. This post covers what I found and how it works.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Not affiliated with Anthropic. This relies on Claude Desktop's current on-disk layout, which could change in any update.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkj4v163d547hx4okwg5x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkj4v163d547hx4okwg5x.png" alt="Before and after: the work account's sidebar is empty before setup and full after" width="800" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the sessions live
&lt;/h2&gt;

&lt;p&gt;Claude Desktop keeps a data folder per user:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;OS&lt;/th&gt;
&lt;th&gt;Data folder&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;macOS&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Application Support/Claude&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Windows&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;%APPDATA%\Claude&lt;/code&gt; (plus some Store-package variants)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Linux&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.config/Claude&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Inside it, local Code sessions are stored like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;claude-code-sessions/
  &amp;lt;account-uuid&amp;gt;/
    &amp;lt;organization-uuid&amp;gt;/
      local_&amp;lt;session-uuid&amp;gt;.json
      local_&amp;lt;session-uuid&amp;gt;.json
      ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each account/organization pair gets its own folder of &lt;code&gt;local_*.json&lt;/code&gt; session records. The Code sidebar only reads the folder that matches whoever is signed in. That's the whole reason sessions "disappear" when you switch.&lt;/p&gt;

&lt;p&gt;One surprise: &lt;strong&gt;a single email login can have several organization folders&lt;/strong&gt;, so you'll often find more folders than you have accounts.&lt;/p&gt;

&lt;h2&gt;
  
  
  The approach: merge once, then link
&lt;/h2&gt;

&lt;p&gt;I considered syncing copies back and forth, but that means watching files, resolving conflicts on every change, and running something in the background. Instead, the tool does a one-time merge and then lets the filesystem do the work:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Find&lt;/strong&gt; every &lt;code&gt;claude-code-sessions/&amp;lt;account&amp;gt;/&amp;lt;org&amp;gt;/&lt;/code&gt; folder.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Merge&lt;/strong&gt; all &lt;code&gt;local_*.json&lt;/code&gt; records into one shared store (&lt;code&gt;shared-code-sessions/&lt;/code&gt;). If the same session ID appears in two folders, the most recently modified file wins.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Back up&lt;/strong&gt; each original folder by moving it to a timestamped backup directory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Link&lt;/strong&gt; each original folder path to the shared store.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After that, every account reads and writes the same folder, so new sessions show up everywhere automatically. Nothing runs in the background.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_directory_link&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;platform&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;'win32'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# A junction needs no Developer Mode or admin rights&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;  &lt;span class="c1"&gt;# New-Item -ItemType Junction via PowerShell&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;symlink_to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target_is_directory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Windows: junctions, not symlinks
&lt;/h2&gt;

&lt;p&gt;On macOS and Linux a plain symlink is fine. On Windows, creating a symlink usually needs Developer Mode or admin rights, which I wanted to avoid for non-technical teammates. &lt;strong&gt;Directory junctions&lt;/strong&gt; work for a normal user, so the tool creates those through PowerShell.&lt;/p&gt;

&lt;p&gt;Two details mattered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paths are passed as quoted literals inside an encoded PowerShell command, so a folder name with odd characters stays data and can't become part of the command.&lt;/li&gt;
&lt;li&gt;Removing a link has to remove &lt;em&gt;the link&lt;/em&gt;, not the folder it points to. On Windows a junction is removed with &lt;code&gt;rmdir&lt;/code&gt;. The tool refuses to remove anything that isn't actually a link.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Not sharing what shouldn't be shared
&lt;/h2&gt;

&lt;p&gt;Session records contain some fields that belong to the account that created them, such as Remote Control / bridge IDs and remote MCP server configuration. Carrying those into another account would be wrong, so imported copies have them stripped:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;clean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;record&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;record&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="kt"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'remoteControl'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bridge'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'steeredByRemote'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="s1"&gt;'remoteMcpServersConfig'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'remoteControlAutoEligible'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What it deliberately &lt;strong&gt;doesn't&lt;/strong&gt; touch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;logins and subscriptions&lt;/li&gt;
&lt;li&gt;ordinary chats, Cowork and cloud sessions&lt;/li&gt;
&lt;li&gt;connectors and their authentication&lt;/li&gt;
&lt;li&gt;org policies and available models&lt;/li&gt;
&lt;li&gt;sidebar preferences (folder grouping is per account)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmfu64bbnwp0b5vv3ytmk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmfu64bbnwp0b5vv3ytmk.png" alt="What's shared vs separate" width="800" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One honest caveat: only combine histories you're comfortable having available under every included account. If one of them is a work org, think about that first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Safety rails
&lt;/h2&gt;

&lt;p&gt;Since this moves folders that hold your conversation history, most of the code is about not making things worse:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Claude must be closed.&lt;/strong&gt; It checks for running Claude processes and stops if it finds any.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preview first.&lt;/strong&gt; The default run is a dry run that reports what it found. Nothing changes until you type &lt;code&gt;SHARE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validation before touching anything.&lt;/strong&gt; Every record must be a real file (not a symlink), parse as JSON, and have a &lt;code&gt;sessionId&lt;/code&gt; that matches its filename and is a valid UUID. Anything unexpected stops the run before any folder is moved.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Journal plus backups.&lt;/strong&gt; Each change is recorded in a small JSON journal (written atomically, owner-only permissions), so &lt;code&gt;status&lt;/code&gt; and &lt;code&gt;undo&lt;/code&gt; know exactly what was done.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One-step undo.&lt;/strong&gt; Undo removes the links and restores the original folders from backup. New sessions created while sharing was on stay in the shared store, so nothing is lost.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc0q12xj3p9fwtaj9zd4r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc0q12xj3p9fwtaj9zd4r.png" alt="Preview before anything changes" width="800" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Making it usable for non-developers
&lt;/h2&gt;

&lt;p&gt;Half the people I wanted to help don't use a terminal, so each OS gets a double-click launcher (&lt;code&gt;.command&lt;/code&gt;, &lt;code&gt;.cmd&lt;/code&gt;, &lt;code&gt;.sh&lt;/code&gt;) that checks for Python 3.9+ and then shows a small menu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Set up / add accounts (default)
2. Check status
3. Undo sharing
4. Exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are no dependencies, nothing to &lt;code&gt;pip install&lt;/code&gt;, and it never asks for admin rights or &lt;code&gt;sudo&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing on three OSes
&lt;/h2&gt;

&lt;p&gt;The filesystem behavior is the risky part, and it differs per OS. GitHub Actions runs the test suite on &lt;strong&gt;macOS, Windows and Ubuntu with Python 3.9 and 3.12&lt;/strong&gt;, covering setup, adding a new account later, and undo using real symlinks and junctions.&lt;/p&gt;

&lt;p&gt;I've verified end-to-end history loading in Claude Desktop on macOS. On Windows and Linux, the automated filesystem tests pass, and I'd really like reports from real installs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Repo (MIT): &lt;a href="https://github.com/gtarun/My-Shared-Claude" rel="noopener noreferrer"&gt;https://github.com/gtarun/My-Shared-Claude&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Direct download: &lt;a href="https://github.com/gtarun/My-Shared-Claude/releases/latest/download/My-Shared-Claude-v1.0.zip" rel="noopener noreferrer"&gt;https://github.com/gtarun/My-Shared-Claude/releases/latest/download/My-Shared-Claude-v1.0.zip&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Product Hunt (launched today, feedback welcome): &lt;a href="https://www.producthunt.com/products/my-shared-claude" rel="noopener noreferrer"&gt;https://www.producthunt.com/products/my-shared-claude&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Quit Claude, double-click the launcher for your OS, check the preview, and type &lt;code&gt;SHARE&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you try it, I'd love to hear:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Does it work on your Windows or Linux setup?&lt;/li&gt;
&lt;li&gt;Would you want to choose which accounts get linked, instead of all of them?&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claude</category>
      <category>productivity</category>
      <category>opensource</category>
      <category>python</category>
    </item>
  </channel>
</rss>
