<?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>Forem: Sreyas</title>
    <description>The latest articles on Forem by Sreyas (@codebysreyas).</description>
    <link>https://forem.com/codebysreyas</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3923058%2F3e3d1d32-ca60-4c78-ab88-74854618f6ca.jpeg</url>
      <title>Forem: Sreyas</title>
      <link>https://forem.com/codebysreyas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/codebysreyas"/>
    <language>en</language>
    <item>
      <title>I Built a Chrome Extension to Fix My Biggest Claude.ai Frustration</title>
      <dc:creator>Sreyas</dc:creator>
      <pubDate>Sun, 10 May 2026 09:03:00 +0000</pubDate>
      <link>https://forem.com/codebysreyas/i-built-a-chrome-extension-to-fix-my-biggest-claudeai-frustration-kn</link>
      <guid>https://forem.com/codebysreyas/i-built-a-chrome-extension-to-fix-my-biggest-claudeai-frustration-kn</guid>
      <description>&lt;p&gt;I use Claude for everything — work research, personal projects, side experiments. The problem: I have multiple accounts and switching between them meant logging out, logging back in, waiting for the page to load, every single time.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;ClaudeShift&lt;/strong&gt; — a Chrome extension that saves your Claude.ai sessions and switches between them with one click.&lt;/p&gt;

&lt;p&gt;Here's how it works, what I learned, and why I almost gave up halfway through.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;If you only use one Claude account, this won't resonate. But if you have a work account and a personal account — or you're a developer managing multiple workspaces — you know the pain.&lt;/p&gt;

&lt;p&gt;Every switch looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open settings&lt;/li&gt;
&lt;li&gt;Log out&lt;/li&gt;
&lt;li&gt;Wait for redirect&lt;/li&gt;
&lt;li&gt;Type email&lt;/li&gt;
&lt;li&gt;Type password&lt;/li&gt;
&lt;li&gt;Wait for login&lt;/li&gt;
&lt;li&gt;Finally back where you wanted to be&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Multiply that by 10 times a day and you've wasted a meaningful chunk of your week on something that should take one click.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Idea
&lt;/h2&gt;

&lt;p&gt;The fix was obvious once I thought about it: Claude.ai uses session cookies to keep you logged in. If I could save those cookies for each account and restore them on demand, switching would be instant.&lt;/p&gt;

&lt;p&gt;That's exactly what ClaudeShift does.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;ClaudeShift is a Chrome extension built with Manifest V3 and plain JavaScript — no frameworks, no build step.&lt;/p&gt;

&lt;h3&gt;
  
  
  Saving a session
&lt;/h3&gt;

&lt;p&gt;When you hit "Save Session", the extension reads your active Claude.ai session cookies using the Chrome Cookies API and stores them locally using &lt;code&gt;chrome.storage.local&lt;/code&gt;. Nothing leaves your browser.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Read cookies for claude.ai&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cookies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAll&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;domain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;claude.ai&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Store them with a profile name&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;profileName&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;savedAt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Switching accounts
&lt;/h3&gt;

&lt;p&gt;When you select a saved profile, the extension:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clears the current claude.ai cookies&lt;/li&gt;
&lt;li&gt;Restores the saved cookies for the selected profile&lt;/li&gt;
&lt;li&gt;Refreshes the active Claude tab
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Clear existing session&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAll&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;domain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;claude.ai&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cookies&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://claude.ai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;}))&lt;/span&gt;
  &lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="c1"&gt;// Restore saved cookies&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cookie&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;savedCookies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://claude.ai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;cookie&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;cookie&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;// ...other properties&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Refresh the tab&lt;/span&gt;
&lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tabs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tabId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The whole switch happens in under a second.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Hard Parts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Manifest V3 service workers
&lt;/h3&gt;

&lt;p&gt;Chrome's Manifest V3 replaced persistent background pages with service workers. Service workers are great for performance but they go to sleep when idle — which means any state stored in memory gets wiped.&lt;/p&gt;

&lt;p&gt;I had to move all session state to &lt;code&gt;chrome.storage.local&lt;/code&gt; and re-fetch it every time the service worker woke up. It took me longer than I'd like to admit to figure out why my saved sessions kept disappearing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cookie scope
&lt;/h3&gt;

&lt;p&gt;Claude.ai sets cookies with specific domain and path attributes. When restoring cookies, you have to match those attributes exactly or the session won't be recognized. One wrong attribute and you get silently logged out.&lt;/p&gt;

&lt;p&gt;I spent an afternoon debugging what looked like a working restore that consistently failed — turned out the &lt;code&gt;sameSite&lt;/code&gt; attribute was being dropped during serialization.&lt;/p&gt;

&lt;h3&gt;
  
  
  The incognito window approach
&lt;/h3&gt;

&lt;p&gt;Adding a second account while already logged into the first was tricky. The solution: open a temporary incognito window, let the user log in, detect the successful login, capture those cookies, then close the window. It feels seamless from the user's side but there's a fair bit of tab monitoring happening in the background.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I'd Do Differently
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Start with the edge cases.&lt;/strong&gt; I built the happy path first and spent twice as long fixing the edge cases after. Cookie expiry, tabs that aren't claude.ai, users with no saved sessions — every one of these needed handling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test with real accounts from day one.&lt;/strong&gt; I used placeholder data early on and it masked several bugs that only appeared with actual session cookies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Design the UI last.&lt;/strong&gt; I wasted time polishing the popup before the core logic was stable. Ship the logic first.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Manifest V3&lt;/strong&gt; Chrome Extension API&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vanilla JavaScript&lt;/strong&gt; — no frameworks, no dependencies&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;chrome.cookies&lt;/strong&gt; — reading and writing session cookies&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;chrome.storage.local&lt;/strong&gt; — persisting session data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;chrome.tabs&lt;/strong&gt; — detecting and refreshing Claude tabs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;chrome.windows&lt;/strong&gt; — incognito window management for adding accounts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Total bundle size: essentially zero. No npm, no webpack, no config files.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;ClaudeShift is free and open source.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/codebysreyas/ClaudeShift" rel="noopener noreferrer"&gt;github.com/codebysreyas/ClaudeShift&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Landing page:&lt;/strong&gt; &lt;a href="https://codebysreyas.github.io/ClaudeShift" rel="noopener noreferrer"&gt;codebysreyas.github.io/ClaudeShift&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Installation takes about 30 seconds via Chrome developer mode — full instructions in the README.&lt;/p&gt;

&lt;p&gt;If you use Claude with multiple accounts, give it a try. And if you find a bug or want to contribute, PRs are open.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;Building a browser extension is a different kind of challenge from building a web app. You're working within a heavily sandboxed environment, the APIs are quirky, and the documentation assumes you already know things it never explains.&lt;/p&gt;

&lt;p&gt;But it's also one of the most satisfying things I've built — because every time I switch accounts in one click, I feel it. The problem was real, the solution is real, and the extension is running in my browser right now while I write this.&lt;/p&gt;

&lt;p&gt;That's what good side projects should feel like.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built by Sreyas VM · &lt;a href="https://github.com/codebysreyas" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; · &lt;a href="mailto:sreyasmurali150@gmail.com"&gt;sreyasmurali150@gmail.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
