saikiran-rs/merge-sessions-across-accounts

Merge Claude Code sessions across accounts in the Claude desktop app (macOS), so every account shows all of them. Unofficial.

Shell

0

4 commits

updated Sep 27, 2026

See the code

See what people are saying

README

merge-sessions-across-accounts

A small script for the Claude desktop app on macOS. It's unofficial and not affiliated with Anthropic.

The app keeps a separate Claude Code session list for each account. If you use more than one account on the same Mac, each account only shows its own sessions. This script merges them so that every account shows all of your sessions.

How to run

First, sign in to the Claude desktop app with your other account. Then run this in Terminal. It quits Claude, merges the sessions, and reopens Claude:

curl -fsSL https://raw.githubusercontent.com/saikiran-rs/merge-sessions-across-accounts/main/merge-sessions.zsh | zsh

When Claude reopens, every account shows all of your sessions. Each time you switch accounts after that, run the same command again. Nothing is installed or left behind.

To preview what would change first (this changes nothing):

curl -fsSL https://raw.githubusercontent.com/saikiran-rs/merge-sessions-across-accounts/main/merge-sessions.zsh | zsh -s -- -n

Prefer to read the script before running it? Download it, look through it, then run it:

curl -fsSLO https://raw.githubusercontent.com/saikiran-rs/merge-sessions-across-accounts/main/merge-sessions.zsh
less merge-sessions.zsh
zsh merge-sessions.zsh

Or clone the repo and run it from there:

git clone https://github.com/saikiran-rs/merge-sessions-across-accounts.git
cd merge-sessions-across-accounts
./merge-sessions.zsh

To update it later, run git pull in that folder.

Use Terminal (or another terminal app), not the terminal inside the Claude app. The script has to quit Claude, which would close that terminal too.

What it does

  • If Claude is open, it quits it first so the app can't save old copies over the merge, then reopens it when done.
  • Copies every session to every account. If a session was changed in more than one account, the newest copy wins.
  • If you delete a session in one account, the script removes it from the others too, unless it was used again after you deleted it.
  • Before changing anything, it backs up the whole sessions folder to ~/.claude/backups/claude-code-sessions-<date>-<time>/. If nothing needs to change, it does nothing.
  • It only merges session files. Scheduled tasks and other per-account data are left alone.

Notes

  • macOS only. It needs nothing beyond the built-in zsh.
  • Sessions are stored in ~/Library/Application Support/Claude/claude-code-sessions/<account>/<org>/.
  • To undo a run, quit the app (⌘Q), then copy the files from the backup folder back into that folder.
  • It relies on how the app stores sessions, which could change in an update. Tested with version 2.9939.2 of the app.
  • If one of your accounts belongs to your employer, merging copies its sessions into your other accounts. Check that this is allowed first.
  • To run the tests, clone the repo and run ./test.zsh. It uses a temporary folder, never your real sessions.

License

Public domain (Unlicense). You're free to use, modify or share it however you like, with no attribution needed.

Contributors

saikiran-rs

4 commits

saikiran-rs/merge-sessions-across-accounts

Merge Claude Code sessions across accounts in the Claude desktop app (macOS), so every account shows all of them. Unofficial.

Shell

0

4 commits

updated Sep 27, 2026

See the code

See what people are saying

README

merge-sessions-across-accounts

A small script for the Claude desktop app on macOS. It's unofficial and not affiliated with Anthropic.

The app keeps a separate Claude Code session list for each account. If you use more than one account on the same Mac, each account only shows its own sessions. This script merges them so that every account shows all of your sessions.

How to run

First, sign in to the Claude desktop app with your other account. Then run this in Terminal. It quits Claude, merges the sessions, and reopens Claude:

curl -fsSL https://raw.githubusercontent.com/saikiran-rs/merge-sessions-across-accounts/main/merge-sessions.zsh | zsh

When Claude reopens, every account shows all of your sessions. Each time you switch accounts after that, run the same command again. Nothing is installed or left behind.

To preview what would change first (this changes nothing):

curl -fsSL https://raw.githubusercontent.com/saikiran-rs/merge-sessions-across-accounts/main/merge-sessions.zsh | zsh -s -- -n

Prefer to read the script before running it? Download it, look through it, then run it:

curl -fsSLO https://raw.githubusercontent.com/saikiran-rs/merge-sessions-across-accounts/main/merge-sessions.zsh
less merge-sessions.zsh
zsh merge-sessions.zsh

Or clone the repo and run it from there:

git clone https://github.com/saikiran-rs/merge-sessions-across-accounts.git
cd merge-sessions-across-accounts
./merge-sessions.zsh

To update it later, run git pull in that folder.

Use Terminal (or another terminal app), not the terminal inside the Claude app. The script has to quit Claude, which would close that terminal too.

What it does

  • If Claude is open, it quits it first so the app can't save old copies over the merge, then reopens it when done.
  • Copies every session to every account. If a session was changed in more than one account, the newest copy wins.
  • If you delete a session in one account, the script removes it from the others too, unless it was used again after you deleted it.
  • Before changing anything, it backs up the whole sessions folder to ~/.claude/backups/claude-code-sessions-<date>-<time>/. If nothing needs to change, it does nothing.
  • It only merges session files. Scheduled tasks and other per-account data are left alone.

Notes

  • macOS only. It needs nothing beyond the built-in zsh.
  • Sessions are stored in ~/Library/Application Support/Claude/claude-code-sessions/<account>/<org>/.
  • To undo a run, quit the app (⌘Q), then copy the files from the backup folder back into that folder.
  • It relies on how the app stores sessions, which could change in an update. Tested with version 2.9939.2 of the app.
  • If one of your accounts belongs to your employer, merging copies its sessions into your other accounts. Check that this is allowed first.
  • To run the tests, clone the repo and run ./test.zsh. It uses a temporary folder, never your real sessions.

License

Public domain (Unlicense). You're free to use, modify or share it however you like, with no attribution needed.

Contributors

saikiran-rs

4 commits

Languages

Shell

100.0%