Command reference
On this page
Put --dry-run before a command to see what it would do without doing it, for example ccam --dry-run work. It works when starting Claude Code (ccam <name>, ccam run, ccam next, ccam agent, ccam attach, ccam ccusage) and with group, migrate, folder, shortcut, pick, update, uninstall and doctor --fix. Commands that only read, such as list, usage, share and ext, accept it and change nothing anyway. The rest refuse it instead of running, including group rename.
| Command | What it does |
|---|---|
ccam | Open the dashboard: accounts, agents, groups, folders, extensions, sign-ins and health |
ccam <name|number> [claude arguments] | Start Claude Code as that account; arguments are passed through unchanged |
ccam --fallback [name|number] -p [claude arguments] | For -p runs: at a usage limit, run the same command again as the account with the most room |
ccam add [name] | Add an account: config folder, login and an optional shortcut |
ccam agent [--model <model>] [--resume <id>] [--json] [--] <task> | ccam agent --list [--session <id>] [--json] | Run a task as another account, like a subagent that uses that account's usage |
ccam agents [--all] [--json] | List the background agents and open sessions of every account |
ccam attach <id|name> [claude args] | Open a background session as the account that started it |
ccam ccusage [-a name[,name…]] [ccusage args] | Show ccusage's token and cost reports for the conversations of every account |
ccam completion bash|zsh|powershell | Print bash, zsh or PowerShell completion |
ccam doctor | Check links, permissions, logins and versions, and repair |
ccam ext [name|number] [--json] | Show the skills, commands, plugins, MCP servers and hooks each account loads |
ccam folder [name|number] [folder] | Use an account in a folder and its subfolders when no account is named |
ccam group | Create and change groups, which set what their accounts share; every change shows a plan first |
ccam hook stop-failure|switch | Run by the ccam plugin's hooks in Claude Code (usage limits, /ccam:switch) |
ccam import [folder] | Register an existing ~/.claude folder in place |
ccam list | List accounts |
ccam login <name|number> | login --expired | Log an account in again; --expired logs in every account that needs it |
ccam logout <name|number> | Log an account out: its login and its MCP server sign-ins |
ccam mcp [command] | Manage shared MCP servers |
ccam migrate [folder] | Copy an existing Claude Code setup (~/.claude) into a shared group |
ccam next [--auto] [--continue [--brief]] [-- claude args] | Open the next account; --continue carries the conversation over, --auto picks the most room |
ccam pick [--json] [--model <model>] [--max-usage N] [--strategy S] [--wait[=D]] | Print the account with the most room, for scripts and parallel workers |
ccam remove <name|number> | Remove an account: it is logged out, and its folder goes to the trash folder |
ccam rename <name> <new-name> | Rename an account; its shortcut command stays the same |
ccam share <name|number> | Show what an account shares, and through which group |
ccam shims [command] | Recreate the shortcut links of all accounts |
ccam shortcut <name|number> [command] | Show, create, rename or remove an account's shortcut command, such as ccwork |
ccam statusline | Show the account and usage in Claude Code's status line |
ccam uninstall | Remove every account, the shortcuts, ccam's folders and ccam itself |
ccam update | Update ccam to the latest release after checking its checksum |
ccam usage | Show 5-hour and weekly usage of every account |
ccam use <name|number> | Set the default account |
Adding and removing accounts
ccam addopens the wizard: name, sign-in, groups and shortcut.ccam add work --group default --group teamaddsworkwithout the wizard and puts it in both groups.ccam add side --shortcut ccsidealso creates the commandccside, which startsside.ccam add ci --no-logincreatesciwithout signing in; sign in later withccam login ci.ccam add gw --api --base-url https://llm.example.com --auth bearer --key-from env:GW_KEYadds an account that uses an API key instead of a Claude login. ccam reads the key at each launch and never stores it (API key accounts).ccam login --expiredsigns in, one after another, every account whose login no longer works, including logins Claude Code cleared.ccam logout sidelogssideout, and asks first when MCP sign-ins go with the login.ccam rename work jobrenamesworktojob. On macOS the folder keeps its name, since the Keychain keeps the login under the folder's path.ccam remove sideasks, logs out a managed account (one whose folder ccam created, as opposed to one registered withccam import) unless another account holds the same login, and moves its folder to~/.local/share/ccam/trash. Removing an imported account takes it out of its groups and leaves a copy of each shared item in its folder.ccam import ~/.claude-old --name oldregisters a folder you already have asold, where it is; ccam never moves or copies a login.
ccam import without a folder looks for ~/.claude and ~/.claude-* and asks about each one; a folder that fails is reported as Skipped <path>: <reason> and the others are registered. If a folder's name is already taken, import that folder on its own with ccam import <folder> --name <name>.
ccam rename, ccam remove and the ccam group commands refuse to change an account while Claude Code is running as that account, however it was started (including background sessions). Quit the session first. They also refuse while a group change is unfinished: the last group change stopped halfway; finish it with `ccam doctor --fix` first.
ccam list --json prints every account with its slot, shortcut, email and folder. Its groups array lists the account's groups, and its share object maps each item (mcp, settings, memory, extensions, history) to the group it comes from, or local.
Starting Claude Code
ccam <name|number> [arguments] starts Claude Code as that account. ccam does not read the arguments after the name; it passes them to claude in the same order, and standard input, the exit code and signals behave exactly as with claude itself. A -- after the name is optional.
ccam with arguments but no account name, such as ccam -p "summarise", uses the account set for the current folder, otherwise the default account:
ccam folder work ~/code/companymakesworkthe account inside~/code/companyand every folder below it.ccam folderlists those folders and the account used in the current one.ccam folder --remove ~/code/companyremoves that folder's entry.ccam use workmakesworkthe default account.
--fallback before the account name, as in ccam --fallback work -p "fix the tests", is for -p/--print runs. When the account reaches its usage limit, ccam runs the same command again as the logged-in account with the most room and prints only the output of the run that finished. See Accounts by folder and Run again at the limit.
A shortcut such as ccwork starts its account the same way: ccwork --resume does what ccam work --resume does. See Shortcuts below.
Shortcuts
ccam shortcut work ccworkcreates the shortcutccworkforwork, or renames the one it has.ccam shortcut workshows it.ccam shortcut work --removedeletes it.
A shortcut is a command you name yourself that starts Claude Code as one account. Like ccam work, it passes every argument to Claude Code unchanged, so ccwork --resume and ccwork -p "hi" work as you would expect. It is a link to ccam in ~/.local/bin.
Shortcuts are optional. The ccam add wizard asks whether to create one, ccam add <name> --shortcut <command> creates one without asking, and ccam list shows each account's shortcut, or - when it has none.
Names use the characters a-z, 0-9, ., - and _. A name cannot be a ccam command, another account's shortcut, or the name of another program on your PATH, nor a file in ~/.local/bin that ccam did not create, such as your own copy or link of ccam. A shortcut edited by hand in config.toml that breaks these rules, is claude or ccam, or is given to two accounts makes config.toml fail to load, naming the account.
ccam rename keeps the shortcut name, and ccam remove deletes the shortcut together with the account. ccam shims install recreates the links of all accounts, for example after you have moved ccam; a file in the way of one shortcut does not stop the others.
Usage and switching
ccam usage(orccam u) shows the 5-hour and weekly usage of every account.--watchredraws it every 60 seconds,--jsonprints it for scripts, and--source claudelets Claude Code look it up, so ccam sends no token.ccam next --continuecontinues this folder's last conversation as the next account; with--brief, as a new conversation from a summary of the last one.ccam next --autostarts the account with the most room.--max-usage 80prefers accounts below 80%, and--waitwaits for a reset when no account has room.ccam next -c --auto -- --dangerously-skip-permissionsdoes both and passes Claude Code's own option after--.ccam pickprints the account with the most room for a script, andccam "$(ccam pick)" -p "…"starts a worker on it.ccam agent "…"runs a task as another account, like a subagent, andccam agent --resume <id> "…"follows that agent up.ccam agentslists the background sessions of every account, andccam attach 49ec0028opens one, by its ID or name, as the account that started it.ccam ccusage claude dailyreports Claude Code's tokens and costs over every account with ccusage, andccam ccusage -a work blocks --activeshows one account's current 5-hour block.
Team and Enterprise seats. Automatic account selection (ccam next, --fallback, ccam pick, ccam agent, the dashboard's n and, once you turn it on, auto_switch) also switches between seats of the same Claude Team or Enterprise organization, which may violate Anthropic's terms. Read the FAQ and check with your organization and Anthropic before you rely on it.
next --auto,--fallback,ccam pickandccam agentchoose the same way (How ccam picks an account): belowauto_max_usage(config.toml, default 100) first, byauto_strategy(headroom,expiringorbalance), counting the--modelweekly window. They never choose an account at 100% (a window Claude Code reported full counts as 100% until its reset) or an API key login, and they stay within the organization of the account they start from (--cross-orgorcross_org = trueto look further).--waittakes its value after=(--wait=2h); written with a space it is refused with a hint. When none can be chosen they exit with code 75, or, with--wait, wait for the first account to reset.ccam next --continuecarries a conversation over even between accounts that do not share history: Claude Code then copies it into the new account. With--brief, the new account starts a new conversation instead, from a summary ccam writes of the last one without a model (--brief).- Unlike
ccam <name>,ccam nextreads its own options, so Claude Code's options go after--; without it ccam stops withunknown flag. ccam agentruns a task withclaude -pin this folder as another account than the one it is called from, in the calling session's permission mode and effort, and prints Claude's last reply. At that account's limit the conversation goes on as another (Subagents on other accounts).- Inside Claude Code, the plugin's
/ccam:switch [account]hands a conversation on, andccam hookis what its hooks run. - With
auto_switch = trueinconfig.toml(Linux and macOS; off by default), the limit hook also ends an interactive session that ccam started and continues it on another account with room, but only one of the same kind: another seat of the same organization, or another personal plan (auto_switch).
See Continuing at the limit, Picking an account for scripts, Subagents on other accounts and Background sessions of every account.
Sharing
ccam grouplists the groups, what each one shares and its accounts.ccam group add team --items history --members work,sidecreates the groupteam, which shares conversation history betweenworkandside.ccam group set default --add historymakes every account indefaultstart sharing history.ccam group join team personalputspersonalinteam.ccam group leave team side --freshtakessideout ofteam; with--freshit starts without the group's items instead of with a copy.ccam share workshows whatworkshares, and through which group.
A group shares items between its accounts; an account can be in several groups, but each item comes from one group only. See sharing between accounts.
Copying an existing setup
ccam migratecopies~/.claudeinto thedefaultgroup.ccam --dry-run migrateshows the plan and copies nothing.ccam migrate ~/.claude-work --group work --settings --mcpcopies onlysettings.jsonand the MCP servers of~/.claude-work, into the groupwork.ccam migrate --history --yescopies only the conversation history, without asking.
ccam migrate copies settings.json, CLAUDE.md, extensions and user MCP servers from a Claude Code folder into a group, so every account that shares those items gets them. The folder is only read.
--settings,--memory,--extensions,--mcpand--historycopy only the items you name. Without them, a checklist on a terminal lets you choose, with everything except conversation history checked; elsewhere everything except conversation history is copied.--mcpalso works when~/.claudeis empty or missing but~/.claude.jsonhas servers.-gor--grouppicks the group.-yor--yescopies without asking and keeps the group's copy when a file differs.
MCP sign-ins are not copied, since a copied sign-in logs the other holders out; the plan names the accounts that sign in with /mcp. See copying an existing setup.
MCP servers
ccam mcp add fs -- npx -y @modelcontextprotocol/server-filesystem ~/codeadds a server that runs a command, for every account of the group.ccam mcp add docs --url https://mcp.example.com/mcp --header "Authorization: Bearer $TOKEN"adds a remote server, with a header sent on each request.ccam mcp add-json db '{"type":"stdio","command":"db-mcp"}'adds a server from the JSON thatclaude mcp add-jsontakes.ccam mcp listlists the servers of every group, and those only one account has.ccam mcp import work ghmoves the serverghthat onlyworkhas into its group.ccam mcp remove fsremoves a server from the group.
ccam mcp import <account> moves the servers that only that account has into its group, including those it has for one folder only (plain claude mcp add), which then load in every folder. A server whose name the group already uses for a different definition is skipped; add --force to replace the group's copy, which ccam backs up first.
Maintenance
ccam doctorchecks ccam's setup and changes nothing;ccam doctor --fixrepairs what is safe to repair, with backups (Checking and repairing).ccam statusline installputs the account name and its usage in Claude Code's status line.ccam extshows the skills, commands, MCP servers and hooks of every account, and the problems that keep them from loading.ccam shims installrecreates the shortcut links.ccam updateinstalls the latest ccam release, andccam update --checkonly says whether a newer one exists.ccam uninstallremoves every account, ccam's folders and ccam itself.ccam version,ccam -vandccam --versionprint the version.ccam completion bashprints a completion script for bash;zshandpowershellwork the same way.
ccam update checks the release's SHA-256 checksum before it replaces ccam, and --version v0.2.0 installs a particular release. A copy of ccam installed from the .deb package is updated with apt instead. See update.
ccam uninstall lists what it removes and asks first: every account as ccam remove does, the shortcut commands, ccam's folders and the ccam command. An imported folder stays where it is. See uninstall.
Files
| Path | Contents |
|---|---|
~/.config/ccam/config.toml |
Accounts, groups and settings (theme, usage_source, relay, auto_switch, cross_org …). Settings go at the top, above the first [[group]], [[profile]] or [[folder]]: one below a table belongs to that table, so ccam warns about it at every launch and in ccam doctor, and commands that save the config refuse until it is moved. Comments are not kept when ccam saves the file |
~/.local/share/ccam/profiles/<name>/ |
Each account's CLAUDE_CONFIG_DIR |
~/.local/share/ccam/groups/<group>/ |
Shared settings, MCP servers, extensions and history |
~/.local/state/ccam/ |
Usage cache, limit records, locks, notes and other state (see the list below the table) |
~/.local/bin/<shortcut> |
Shortcut commands such as ccwork, links to ccam |
The state folder holds:
- the usage cache and limit records (
usage/<name>.json,usage/<name>.limit.json); - last-used times;
- session markers and locks (
locks/); - the shortcuts ccam created (
shortcuts.json); - a group change that has not finished (
group-change.json); - the notes
/ccam:switchand the limit hook leave (handoff/<account>/<session>.json); - when
ccam pick,ccam agentorauto_switchlast chose each account (picks/<name>; a choice counts for 2 minutes); - the summaries of
--brief, kept 7 days (brief/<session>.md); - the conversations
ccam agentran, kept 30 days (agent/<session id>.json).
Setting XDG_CONFIG_HOME, XDG_DATA_HOME or XDG_STATE_HOME changes where these folders are. On Windows, ~ is %USERPROFILE% and shortcuts are <shortcut>.exe.