Codonic

hopsesh guide · Claude Code accounts

Claude Code with two accounts on one computer: switching and moving sessions

One configuration folder per account, why the other account can’t see your sessions, the manual copy and its cautions, and account profiles in hopsesh.

Two accounts, two folders

Claude Code’s documentation describes one way to stay signed in to two accounts at once, such as work and personal: a separate configuration folder for each.

# in ~/.zshrc or ~/.bashrc
alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'

claude keeps using ~/.claude and your personal login; claude-work uses ~/.claude-work, where you run /login once with the work account. Each folder has its own settings, session history and claude.ai login or API key. On macOS the Keychain entry is keyed to the folder too, so the two logins don’t overwrite each other.

The same works for Codex with CODEX_HOME: alias codex-work='CODEX_HOME=~/.codex-work codex'.

Why your sessions “disappear” when you switch

Because each folder has its own history, a session you started with claude-work lives in ~/.claude-work/projects/..., and plain claude never looks there. claude --resume doesn’t list it, Ctrl+A doesn’t find it, and claude --resume <id> says No conversation found with session ID. Nothing is lost; it’s in the other tree.

Common ways to hit this:

  • You hit the usage limit on one account and want to carry on with the other.
  • A work session should continue under the personal account for a side project, or the other way round.
  • You started in the wrong one.

Move a session to the other account by hand

  1. Find it: ls -t ~/.claude-work/projects/-Users-alice-src-webapp/.

  2. Copy it into the same project folder in the other tree:

    mkdir -p ~/.claude/projects/-Users-alice-src-webapp
    cp ~/.claude-work/projects/-Users-alice-src-webapp/<id>.jsonl ~/.claude/projects/-Users-alice-src-webapp/
  3. Resume it with the other account: claude --resume <id>.

The paths inside don’t change, because it’s the same computer and the same repository. What does change is the account: Claude’s thinking blocks are signed for the account that made them, and the other account can’t use them. hopsesh’s account docs describe what happens next: Claude Code resumes the session and the API ignores reasoning signed for the other organisation, so the conversation continues without it.

Two cautions:

  • Don’t keep both copies in use. You now have the same id in two trees with two diverging histories.
  • Mind what you’re sharing. A work session’s history can hold code, logs and tokens that shouldn’t end up in a personal account, and the next request sends that history to the other account.

Codex is stricter

According to hopsesh’s account docs, a Codex session fails to resume under another account, because its encrypted reasoning is bound to the account that produced it. To continue one under another CODEX_HOME, start a new session there from a handoff note, or let a tool write a copy without that reasoning.

Do it with hopsesh

hopsesh is a free, open-source command-line tool, terminal UI and app for macOS and Windows that treats accounts as named profiles: a Claude Code or Codex folder, on this computer or any of yours.

hopsesh accounts scan                        # find the folders and who is signed in to each
hopsesh accounts list
hopsesh accounts add claude "Work" --tag Work
hopsesh accounts login <profile-id> --run    # sign the new folder in

Settings › Accounts in the app shows, across your computers, which account each tool (Claude Code, Claude desktop, Codex, the Codex app) is signed in as in each folder, and how many sessions each account ran. Add an account… makes a folder under ~/.hopsesh/accounts/<agent>/<name>, signs it in and, by default, adds a claude-<name> command to ~/.local/bin for using it outside hopsesh. Your other sign-ins aren’t touched.

Which account ran a session

Every session shows the account that ran it, taken from what was recorded while it ran, not from whoever the folder is signed in to now. So a folder that has been signed in to two accounts over time still labels each session correctly.

Moving to the other account

Choose Move › Move to another account… on a session (or A in the terminal UI), pick the profile and review the plan:

  • The plan names both profiles and shows what carries over.
  • The conversation is written as a new session, with a fresh id, in the other folder. Signed reasoning and other private state from the first account are left out, and the plan reports the loss. The original stays as it was.
  • Codex sessions get the same treatment, which is how hopsesh continues them under another account when Codex itself refuses.
  • Moving a session to another account and continuing it in the other agent combine: hopsesh pull claude@<profile>/<id> --in codex --target-profile <profile>.
  • If both copies change, hopsesh never merges them; --keep-both keeps the new work as a separate session.

hopsesh reads only the public identity next to each login, such as the email and account id, never tokens, and never moves logins between folders or computers. It is alpha software, and an independent project, not affiliated with Anthropic or OpenAI. More: Claude Code usage limit? Continue in Codex.

Two Claude accounts

How do I use two Claude accounts in Claude Code?

Give each its own configuration folder with CLAUDE_CONFIG_DIR, for example alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude', and run /login once in each. Each folder has its own settings, session history and login.

Why can’t I see my sessions after switching accounts?

Each configuration folder has its own session history, so a session started with one account is in that folder’s projects tree, and Claude Code with the other folder never looks there. Nothing is deleted.

Can I continue a session under the other account?

Claude Code resumes a copied session under another account; Claude’s reasoning signed for the first account can’t be used and is ignored, and the conversation continues. hopsesh moves it with a plan that names both accounts and reports what is left out.

Does hopsesh read my Claude or Codex login?

No. It reads only the public identity next to each login, such as the email and account id, to label sessions and folders. It never reads or moves tokens, and never copies logins between folders or computers.

Use the method

Try it with hopsesh

Open-source CLI and desktop app: move a Claude Code or Codex session to another computer, into the other agent, or to the cloud, with undo built in.

See everything hopsesh does →
Install the CLI Terminal macOS and Linux · Command line and terminal UI brew install roeehrl/tap/hopsesh Without Homebrew: curl -fsSL https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.sh | sh, which checks the download against the release’s checksums and signature.
Install the CLI Terminal Windows, in PowerShell · Command line and terminal UI irm https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.ps1 | iex Same checks as the macOS and Linux script. The Windows app installs this command as well.
hopsesh for Mac .dmg macOS app · macOS 13 or later · Apple silicon and Intel Download Signed and notarized by BlueGuru LLC. Updates itself from Settings → Updates.
hopsesh for Windows .exe Windows app · Windows 10 or 11 · x64 Download Not code-signed yet: at SmartScreen, click More info, then Run anyway. Smart App Control, if on, blocks it.
More ways to install
  • Installer for Arm64 Windows 10 or 11 on Arm
  • Portable .zip x64 or Arm64, no install, on the release page
  • Command line with Scoop from the roeehrl bucket, without the app scoop bucket add roeehrl https://github.com/roeehrl/scoop-bucket; scoop install hopsesh
  • Command line only in PowerShell, without the app irm https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.ps1 | iex
Linux packages and all files GitHub Latest release · .deb, .rpm and .apk for amd64 and arm64, a portable Windows app .zip, plus archives Open on GitHub Release notes, checksums and every build of the current version. Source on GitHub GitHub Apache-2.0 · Go 1.26 or later to build Open on GitHub From source: go install github.com/roeehrl/hopsesh/cmd/hopsesh@latest