<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>AI | Giorgi Dalakishvili</title><link>https://www.giorgi.dev/tags/ai/</link><atom:link href="https://www.giorgi.dev/tags/ai/index.xml" rel="self" type="application/rss+xml"/><description>AI</description><generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><copyright>© Giorgi Dalakishvili 2019 - 2026</copyright><lastBuildDate>Wed, 14 Oct 2026 12:00:00 +0400</lastBuildDate><image><url>https://www.giorgi.dev/authors/giorgi/avatar.jpg</url><title>AI</title><link>https://www.giorgi.dev/tags/ai/</link></image><item><title>Running Multiple Claude Code Accounts with herdr</title><link>https://www.giorgi.dev/ai/running-multiple-claude-code-accounts-with-herdr/</link><pubDate>Wed, 14 Oct 2026 12:00:00 +0400</pubDate><guid>https://www.giorgi.dev/ai/running-multiple-claude-code-accounts-with-herdr/</guid><description>&lt;p>I have two Claude Code accounts. One is my work account; the other is a personal account I got through Anthropic&amp;rsquo;s
&lt;a href="https://claude.com/contact-sales/claude-for-oss" target="_blank" rel="noopener">Claude for Open Source program&lt;/a> as the maintainer of
&lt;a href="https://www.giorgi.dev/database/duckdb-net-1-5-performance/">DuckDB.NET&lt;/a> and
&lt;a href="https://www.giorgi.dev/entity-framework/introducing-entityframework-exceptions/">EntityFramework.Exceptions&lt;/a>. For a while I kept them in separate terminal windows and regularly lost track of which window was which. What I actually wanted was to run both at once - sometimes several agents in parallel - without juggling windows or logging in and out.&lt;/p>
&lt;p>That is what pushed me to
&lt;a href="https://herdr.dev" target="_blank" rel="noopener">herdr&lt;/a>. herdr is a terminal multiplexer: it splits one terminal window into many panes and tabs, each running its own shell. But it is built specifically for AI coding agents. If you have used tmux, it is in that family. If you have not, picture a single window hosting a dozen independent terminals that keep running even after you close it.&lt;/p>
&lt;p>What makes it worth reaching for with Claude Code is that it &lt;em>understands&lt;/em> the agents inside it. Every pane shows its agent&amp;rsquo;s state at a glance - idle, working, blocked on a question, or done. So I can keep several going at once and see which one needs me. It even ships a skill for Claude Code, so Claude can drive herdr itself - opening panes, starting agents, and reading their output.&lt;/p>
&lt;p>&lt;img src="featured.png" alt="herdr&amp;rsquo;s sidebar listing several Claude agents and their live states - idle, working, and done - across multiple workspaces.">&lt;/p>
&lt;p>And its sessions are persistent background servers: I can detach, close the terminal, come back later (even from another machine), reattach, and the agents are still there, mid-task. That is exactly what I wanted for running a wall of Claudes. The only question was how to make one of them &amp;ldquo;work&amp;rdquo; and another &amp;ldquo;personal.&amp;rdquo;&lt;/p>
&lt;h2 id="an-account-is-just-a-config-directory">An account is just a config directory&lt;/h2>
&lt;p>The key realization is that a Claude Code account is not some global login - it is whatever lives in its &lt;strong>config directory&lt;/strong>. Claude Code reads the &lt;code>CLAUDE_CONFIG_DIR&lt;/code> environment variable, and everything that makes an account an account - its credentials, its settings, its stored conversation transcripts - lives in that folder. Point &lt;code>CLAUDE_CONFIG_DIR&lt;/code> at one folder and you are your work account; point it at another and you are personal.&lt;/p>
&lt;p>I manage the two with
&lt;a href="https://docs.ccs.kaitran.ca" target="_blank" rel="noopener">ccs&lt;/a>, a small profile switcher for Claude Code. &lt;code>ccs work&lt;/code> and &lt;code>ccs personal&lt;/code> each launch Claude with the right config directory. When I asked it what a profile actually does under the hood, the answer was refreshingly small:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-powershell" data-lang="powershell">&amp;gt; ccs env work --format raw
$env:CLAUDE_CONFIG_DIR = &lt;span style="color:#e6db74">&amp;#39;C:\Users\me\.ccs\instances\work&amp;#39;&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>That is the whole trick. A profile is one environment variable.&lt;/p>
&lt;h2 id="one-herdr-session-per-account">One herdr session per account&lt;/h2>
&lt;p>herdr supports named, persistent &lt;strong>sessions&lt;/strong> - independent background servers that you attach to. That maps perfectly onto accounts: a &lt;code>work&lt;/code> session and a &lt;code>personal&lt;/code> session. You attach to one with:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-powershell" data-lang="powershell">herdr session attach work
&lt;/code>&lt;/pre>&lt;/div>&lt;p>So I set &lt;code>CLAUDE_CONFIG_DIR&lt;/code> for the work account, attached the &lt;code>work&lt;/code> session, launched a few Claudes across its panes, and everything was my work account. Lovely.&lt;/p>
&lt;p>And then I restarted herdr.&lt;/p>
&lt;h2 id="the-agents-came-back-as-the-wrong-account">The agents came back as the wrong account&lt;/h2>
&lt;p>herdr has a feature called native session restore: when its server restarts, it relaunches the agents that were running and resumes their conversations. Except after a restart, my work agents came back logged in as my &lt;strong>personal&lt;/strong> account - and could not find the conversations they were supposed to resume.&lt;/p>
&lt;p>It took me a minute to see why. herdr restores an agent by running a fixed command, essentially &lt;code>claude --resume &amp;lt;id&amp;gt;&lt;/code>. That command inherits the environment of the &lt;strong>herdr server&lt;/strong> - not whatever environment the pane was launched in. My account was coming from &lt;code>ccs&lt;/code> at the moment each pane started; the server itself knew nothing about it.&lt;/p>
&lt;p>I confirmed it by spawning a throwaway pane and printing the one variable that matters:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-powershell" data-lang="powershell">&amp;gt; &lt;span style="color:#75715e"># inside a fresh pane the herdr server started for me&lt;/span>
&amp;gt; $env:CLAUDE_CONFIG_DIR
&amp;gt;
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Empty. The server had no account set, so every restored &lt;code>claude --resume&lt;/code> fell back to the default (personal) account. Each account&amp;rsquo;s transcripts live inside its own config directory. So a work conversation id does not even exist under the personal account - the resume could not find it either. Wrong account &lt;em>and&lt;/em> a dead resume.&lt;/p>
&lt;h2 id="the-fix-scope-the-sessions-server-not-the-pane">The fix: scope the session&amp;rsquo;s server, not the pane&lt;/h2>
&lt;p>Once I understood that restore inherits the &lt;strong>server&amp;rsquo;s&lt;/strong> environment, the fix was obvious: start each herdr session&amp;rsquo;s server with &lt;code>CLAUDE_CONFIG_DIR&lt;/code> already set. Then everything the server later spawns - new panes and restored agents alike - inherits the right account.&lt;/p>
&lt;p>Since &lt;code>ccs env&lt;/code> just emits that one variable, I can apply it right before attaching the session. I wrapped it in a small launcher:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-powershell" data-lang="powershell">&lt;span style="color:#75715e"># start-herdr.ps1 - launch a herdr session scoped to a Claude account.&lt;/span>
&lt;span style="color:#75715e"># .\start-herdr.ps1 # default session, default (personal) account&lt;/span>
&lt;span style="color:#75715e"># .\start-herdr.ps1 work # &amp;#39;work&amp;#39; session scoped to the ccs &amp;#39;work&amp;#39; profile&lt;/span>
&lt;span style="color:#66d9ef">param&lt;/span>(&lt;span style="color:#66d9ef">[string]&lt;/span>$Account)
&lt;span style="color:#66d9ef">if&lt;/span> (&lt;span style="color:#f92672">-not&lt;/span> $Account) {
herdr &lt;span style="color:#75715e"># default session + default account&lt;/span>
&lt;span style="color:#66d9ef">return&lt;/span>
}
&lt;span style="color:#75715e"># Apply the account&amp;#39;s CLAUDE_CONFIG_DIR, then attach the same-named session so the&lt;/span>
&lt;span style="color:#75715e"># server - and everything it spawns, including restore - inherits that account.&lt;/span>
ccs env $Account --format raw |
Where-Object { $_ &lt;span style="color:#f92672">-match&lt;/span> &lt;span style="color:#e6db74">&amp;#39;^\s*\$env:&amp;#39;&lt;/span> } |
Invoke-Expression
herdr session attach $Account
&lt;/code>&lt;/pre>&lt;/div>&lt;p>(The &lt;code>Where-Object&lt;/code> filter is there because on its very first run &lt;code>ccs env&lt;/code> can print a one-line status message alongside the assignment. Keeping only the real &lt;code>$env:&lt;/code> line stops &lt;code>Invoke-Expression&lt;/code> from choking on it.)&lt;/p>
&lt;p>One catch worth knowing: &lt;code>session attach&lt;/code> only sets the server&amp;rsquo;s environment when it &lt;strong>starts&lt;/strong> the server. If the session is already running - launched the old, unscoped way - attaching again will not re-scope it. You have to &lt;code>herdr session stop &amp;lt;name&amp;gt;&lt;/code> first, then relaunch with the script.&lt;/p>
&lt;p>With that in place, I get exactly what I wanted:&lt;/p>
&lt;ul>
&lt;li>&lt;code>start-herdr.ps1 work&lt;/code> - a herdr session where every pane is my work account, and restore brings agents back on the work account.&lt;/li>
&lt;li>&lt;code>start-herdr.ps1 personal&lt;/code> - the same for my personal account.&lt;/li>
&lt;li>A bonus I did not expect: the account lives on the server, so every new pane, tab, and spawned agent inherits it. I can fan out reviewers into new tabs - or let Claude spawn them via herdr&amp;rsquo;s skill - and every one is the right account, no &lt;code>ccs&lt;/code> needed.&lt;/li>
&lt;/ul>
&lt;h2 id="where-i-landed">Where I landed&lt;/h2>
&lt;p>Two accounts, two herdr sessions, one launcher - and session restore that no longer sends my work agents off as my personal self. herdr plus a one-variable launcher turned out to be a much calmer way to live than juggling terminal windows.&lt;/p>
&lt;p>And none of this is Claude-specific. herdr detects and drives other coding agents too - Codex, Gemini, and more - so the same one-session-per-context setup works whatever you run inside it.&lt;/p>
&lt;p>If you are juggling more than one agent or account,
&lt;a href="https://herdr.dev" target="_blank" rel="noopener">give herdr a try&lt;/a>. And if you reach for multiple accounts, remember the rule that caught me: &lt;strong>restore inherits the server&amp;rsquo;s environment, so scope the server, not the pane.&lt;/strong>&lt;/p></description></item></channel></rss>