Features

Sharing between accounts

By jhyunwoo
Last updated November 29, 2026
Checked with ccam 0.16.1 and Claude Code 2.1.302

On this page

Each account keeps its own login. Everything else can be shared through groups: a group names the items it shares and the accounts in it, and ccam links each of those accounts' files to one folder, ~/.local/share/ccam/groups/<group>/, so a change made in one account appears in all of them.

What can be shared

Item What is shared
mcp MCP servers: the group's mcp.json, passed to Claude Code at start (Shared MCP servers)
settings settings.json: permissions, hooks, model, status line
memory the global CLAUDE.md
extensions agents/, commands/, skills/, plugins/, output-styles/, rules/
history conversation history: projects/ and history.jsonl, so another account can continue a conversation

Your first account creates the default group, which shares everything except conversation history, and later accounts join it unless you say otherwise. If none of an account's groups shares an item, that item stays in the account's own folder.

The login files .credentials.json and .claude.json are never shared. ccam links only paths from a fixed list, and these two are not on it.

Groups

To continue conversations from one account in another, the most common change, add history to the group:

ccam group set default --add history

Every account in default then shares one conversation history. An account can be in several groups, but each item comes from one group only. To share history between work and side but not your other accounts, keep history out of default and give the two a group of their own. In config.toml that setup reads:

[[group]]
name = 'default'
items = ['mcp', 'settings', 'memory', 'extensions']
members = ['personal', 'work', 'side']

[[group]]
name = 'team'
items = ['history']
members = ['work', 'side']

ccam share work shows what an account shares and through which group. The Groups tab of the dashboard makes the same changes; press s on an account to choose its groups.

Usage

Accounts are given by name or number, and items as a comma-separated list of mcp, settings, memory, extensions and history. When you add an account, ccam add --group <group> (repeatable) or --no-group chooses its groups (Adding accounts).

Seeing the groups

ccam group
ccam group show default
ccam share work

ccam group (or ccam group list) lists the groups, what each one shares and its accounts. ccam group show default adds the group's folder and its MCP servers. ccam share work looks from the other side: what one account shares, and through which group.

$ ccam group
Group    Shares                          Accounts
default  mcp settings memory extensions  personal, work, side
team     history                         work, side

$ ccam share work
Sharing for work
  mcp         MCP servers                        group default
  settings    settings.json                      group default
  memory      global CLAUDE.md                   group default
  extensions  agents, commands, skills, plugins  group default
  history     conversation history               group team
Groups: default, team. Change them with `ccam group`.

Creating a group

ccam group add team --items history --members work,side

ccam group add creates a group that shares the items given with --items between the accounts given with --members. You can leave --members out and add accounts later with ccam group join. The accounts' copies of those items move into the group's folder: the first copy fills it, and the others are merged in, with each file that differs kept in the account's backup (When an account starts sharing). --from <account> chooses whose copy goes in first; without it, the default account comes first, then the others by number.

Changing what a group shares

ccam group set default --add history
ccam group set default --remove history --fresh
ccam group set team --items history,memory --from work

--add makes every account in the group start sharing the items, and --remove makes them stop; the two can be given together. --items sets the whole list instead and cannot be combined with them. An account that stops sharing an item keeps a copy of the group's content, and with --fresh it starts without it (an imported folder still keeps one). --from works as for ccam group add.

Adding and taking out accounts

ccam group join team personal
ccam group join team personal --replace
ccam group leave team side

ccam group join team personal puts personal in team, so it starts sharing the group's items. An account that already gets one of those items from another group is refused; --replace takes it out of that group first. ccam group leave team side takes side out: it keeps a copy of the group's items, MCP servers included, or with --fresh starts without them (When an account stops sharing). Both commands take several accounts at once.

Renaming and removing a group

ccam group rename team pair
ccam group remove pair --leave

ccam group rename team pair renames the group in the config only, so nothing moves. ccam group remove pair --leave takes the group's accounts out, each with a copy of its items, and then removes the group; without --leave, a group that still has accounts is refused (details).

Plans, questions and dry runs

ccam --dry-run group set default --add history

Every command that moves data prints a plan, asks about each file that differs from the group's copy, and asks Proceed? [y/N] before it changes anything:

$ ccam group set default --add history
Plan (paths in /home/me/.local/share/ccam):
personal: +history (group default)
  move     projects, history.jsonl: profiles/personal → groups/default (first content of the group)
  link     projects, history.jsonl, file-history, tasks, paste-cache: profiles/personal → groups/default
work: +history (group default)
  merge    new files in projects: profiles/work → groups/default
  conflict profiles/work/history.jsonl ↔ groups/default/history.jsonl: merge by line
  back up  projects, history.jsonl: profiles/work → profiles/work/.ccam-backup/20261023-213057
  link     projects, history.jsonl, file-history, tasks, paste-cache: profiles/work → groups/default
  Note: projects: 1 file differs from the group's copy (-home-me-code-app/s1.jsonl); the group's is kept, the account's stays in profiles/work/.ccam-backup/20261023-213057/projects
Proceed? [y/N]

--dry-run prints the plan and changes nothing; ccam group rename, which moves nothing, refuses it. --prefer group|mine|merge decides every conflict the same way instead of asking. -y or --yes runs without asking, and conflicts then follow --prefer, or each file's default (conflicts).

When an account starts sharing

When an account starts sharing an item (it joins a group, or its group adds the item), ccam:

  1. prints a plan of every file it will move, copy or link for each account, and asks before it starts;
  2. moves the account's files into the group folder if the group is still empty, or adds the files the group does not have yet;
  3. when the same file differs, asks whether to keep the group's version, use yours, or merge the JSON;
  4. keeps your original in .ccam-backup/<time>/ inside the account folder;
  5. replaces the original with a link to the group.

Conversation files are named after their session ID, so histories from several accounts combine without conflicts.

ccam does not change an account while Claude Code is running as that account, however it was started (background sessions included), because the session keeps writing into the files being moved. Quit it first. ccam checks again right before it saves, so it also catches a session that started while ccam was waiting for your answer.

When an account stops sharing

ccam group leave team work
ccam group set default --remove history

ccam group leave team work takes one account out of a group, and ccam group set default --remove history stops a whole group sharing an item. Either way, the link is removed and the account gets its own copy of the group's current content; the group's MCP servers go into its own .claude.json, next to servers of its own. Add --fresh to start empty instead; the plan then lists the MCP servers that stop loading. An imported folder such as ~/.claude always keeps a copy. The group keeps its content for the other accounts.

Copy an existing setup

If you used Claude Code before ccam, your settings are in ~/.claude and your MCP servers in ~/.claude.json. ccam migrate copies them into a group, so every account that shares those items gets them:

ccam migrate

ccam shows what it will copy and asks first. It only reads ~/.claude, never copies a login, and copies conversation history only with --history. Copying an existing setup covers the checklist, the options and the MCP sign-ins.

MCP servers

Claude Code stores MCP servers in .claude.json, together with the login, so that file cannot be shared. ccam keeps a group's servers in its mcp.json instead and starts Claude Code with --mcp-config=<group>/mcp.json:

ccam mcp add fs -- npx -y @modelcontextprotocol/server-filesystem ~/code
ccam mcp list

A server you add inside a session with claude mcp add stays in that account; at its next start, ccam names it with the command that moves it to the group (ccam mcp import work gh). Servers that sign in with OAuth keep their sign-in in each account's login, so sign in once per account with /mcp. Shared MCP servers covers the commands, the sync strategy and Remote Control.

Two accounts in the same folder

Accounts that share conversation history write to the same files. If you start a second Claude Code session in a folder where another account of the same group is already running, ccam warns you and asks whether to continue.

How it works

The files involved:

  • ~/.config/ccam/config.toml: the [[group]] entries: name, items, members and, when the folder's name differs, dir.
  • ~/.local/share/ccam/profiles/<name>/: the account's CLAUDE_CONFIG_DIR.
  • ~/.local/share/ccam/groups/<folder>/: the shared copies.

When config.toml is read, each account's groups are resolved into one folder per item. This takes about 25 µs for five accounts, so a launch still reads only config.toml. A config where an account would get an item from two groups is an error, and nothing starts until it is fixed.

A change works on a copy of the config:

  1. The command edits the copy, which checks the rules.
  2. ccam compares old and new and, for each account whose items change, builds a plan. The plans are built one after another, and each sees what the earlier ones will put into the group folders, so only the first account moves its copy in. The group's first copy comes from, in this order: the group folder (if it already has one), the --from account, the default account, then the other accounts by number.
  3. ccam refuses if one of those accounts is running, however Claude Code was started (work is running; quit Claude Code there first, then change the groups (`ccam agents` lists the sessions)), and on Windows without Developer Mode if a file would need a link.
  4. ccam resolves conflicts (by asking, or with --prefer), prints the plan and asks for confirmation.
  5. Right before saving, ccam checks again. If an account started while ccam waited for your answers, the change stops; it also stops if another ccam process changed the same groups in the meantime (the groups changed while this plan waited; nothing was moved, make the change again). The new config is saved before anything moves, and the change is noted in ~/.local/state/ccam/group-change.json. If a step stops halfway, the note stays: ccam doctor --fix finishes the change in its order, with the answers you gave, MCP steps included, and until then no other group change starts (the last group change stopped halfway; finish it with `ccam doctor --fix` first).
  6. The MCP steps run first. When accounts take extensions out of a group, the group's plugin lists are pointed at the group folder wherever their paths run through an account's folder (group plugin lists: in the plan). Then the plans run in order. Every step moves data into the group or into the backup folder; only files identical to the group's copy are deleted instead of backed up.

ccam keeps an allow list of the paths each item covers. Anything not on it can never reach a group. ccam also names .credentials.json and .claude.json as never shared, and stops with an internal error if either ever appears in the list. The mcp item has no paths: the server list lives inside .claude.json, so MCP sharing works through the group's mcp.json.

This is what happens to one folder, projects/, when side starts sharing history and the group already has content:

If the group has nothing at that path yet, the account is the first to share it and its folder is moved there as it is. Otherwise each file the group lacks is moved into the group, and files that exist on both sides stay in the account's folder, so the group's version is kept. Files identical to the group's are deleted, and the plan names the ones that differ (Note: projects: 1 file differs from the group's copy (…); the group's is kept, the account's stays in …).

The account's folder then goes to .ccam-backup/<time>/ inside the account folder, and a link takes its place. If the group's entry is itself a link to the joining account's own entry, the account's content goes into the group in its place. Conversation files are named after their session ID, so histories from several accounts combine without clashes. The plugins/ registries store absolute paths through the account folder; ccam points them at the group's folder and merges the account's entries into a registry the group already has.

Leaving reverses the link:

ccam copies the group's current content into .ccam-backup/incomplete-<name> in the account folder first, and replaces the link only once the copy is complete. If the copy stops, the link stays in place and ccam doctor --fix copies again (the plan of such a finish shows restore <entry>: … (copied back from the group before a stop)). The group keeps its content for the other accounts.

  • ccam removes the link only if it still points into the groups folder as it did when the plan was created. A path that changed since, such as a real file where the link was, is left as it is and the change stops.
  • With --fresh, the copy is skipped.
  • An account that moves an item to a group whose folder is still empty brings a copy of what it saw, so it keeps its files. That copy is staged in <group>/.ccam-incomplete-<name> until it is complete.
  • An account that stops sharing MCP keeps the group's servers: they go into its own .claude.json (a backup is kept), except where the account already has a server of the same name, which stays as it is. With --fresh the plan lists the servers that stop loading instead. Joining again removes the copies that nobody changed.
  • Leaving extensions also points the group's plugin lists at the group folder where their paths ran through the leaving account's folder; for the other accounts, the rewritten paths lead to the same plugins.

A single file that exists on both sides with different content is a conflict:

You choose for single files such as settings.json; inside folders the group's copy stays, and the plan names the files that differ. The choices depend on the file; the first one is the default:

File Choices
history.jsonl merge by line, keep group, use mine
Other .json files keep group, use mine, merge JSON
Anything else keep group, use mine

merge JSON merges objects recursively, joins arrays without duplicates, and keeps the group's value when both sides set the same key differently, so the other accounts see no change. Every choice except keep group first saves the group's copy in the account's .ccam-backup/<time>/group/. Your own file always goes to the backup.

At every launch, ccam compares each path on the list with the account's groups using lstat and readlink only. A missing link is created on the spot. A real file where a link belongs, a link to the wrong place, or a stale link stops the launch and points to ccam doctor --fix.

Renaming, removing and the old format

  • ccam group rename changes only the config. The folder keeps its name and the group records it as dir, so nothing moves and nothing can be lost.
  • ccam group remove refuses a group with accounts unless you add --leave. Each account then keeps a copy, and the folder goes to ~/.local/share/ccam/trash/ unless another group uses it.
  • Before groups, config.toml stored a [profile.share] table per account. ccam reads that format as groups without moving anything. On the first save it writes the new format and keeps the old file as config.toml.bak. Items shared by the same accounts become one group named after the folder; the rest get names such as default-history and keep using the same folder.

On Windows

Windows creates symbolic links only in Developer Mode (Settings > System > For developers) or for an administrator. Without that right, a shared folder becomes a directory junction, which works the same for Claude Code. A shared file (settings.json, CLAUDE.md, history.jsonl) can only be a symbolic link, so a group change that needs one is refused before anything moves. For the same reason the first ccam add there creates the default group with only mcp and extensions and says so, and ccam add --group into a group that shares settings, memory or history is refused.

When something breaks

ccam doctor
ccam doctor --fix

If a shared path became an ordinary file, for example after you restored a backup by hand, ccam stops before starting Claude Code and points to ccam doctor --fix. The fix links the path to the group again: the file becomes the group's copy when the group has none; otherwise the group keeps its own copy, and yours goes to a backup that --fix names. A group change that stopped halfway is finished by ccam doctor --fix too (Checking and repairing).

Safety and edge cases

  • Running accounts. A change is refused while Claude Code is running as one of the accounts it moves, because the session keeps writing into those files, whether ccam started it or not (plain claude, an IDE, background sessions). The check is repeated right before saving. Leaving and joining affect only the named account; leaving extensions also rewrites paths in the group's plugin lists, without changing what they mean for the others. --dry-run still prints the plan.
  • Backups. Each plan gets its own .ccam-backup/<time>/ folder in the account folder. ccam never deletes them.
  • Your own links. If a path is already a link you made, for example to a dotfiles repository, and the group is empty, ccam copies the link's target into the group and moves the link itself to the backup. The target is not touched.
  • Imported folders. An account registered in place with ccam import (such as ~/.claude) changes in place, so plain claude sees the change too; the plan says so. When it leaves a group it always keeps a copy, even with --fresh, and ccam remove takes it out of its groups that way before it forgets the account. Its shared files live in the group folder while it is in a group, so remove the account (or leave the groups) before you delete ~/.local/share/ccam.
  • Two accounts in one folder. Accounts that share history write the same files. When a second one starts in a folder where one already runs, ccam warns and asks.
  • Manual edits. If members lists a name that is not an account, ccam ignores it and ccam doctor reports it. The names local, on, off and none cannot be group names.