Features

Accounts by folder

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

On this page

ccam folder picks the account for a folder, such as work for your company code: after ccam folder work ~/code/company, any launch without an account name in ~/code/company or its subfolders starts Claude Code as work. Outside it, the default account starts as before. Naming an account, with ccam personal or a shortcut such as ccpersonal, always starts that account.

Usage

Setting a folder's account

ccam folder work ~/code/company
ccam folder personal

ccam folder work ~/code/company makes work the account for ~/code/company and every folder below it. Give the account by name or number, and the folder as a relative or absolute path; without a folder, as in the second line, ccam uses the current one. ccam saves the folder with its symbolic links resolved, and setting a folder again replaces its account. With --dry-run, ccam prints the change without saving it.

$ ccam folder work ~/code/company
✓ /home/me/code/company → work
  ccam without an account name starts work here and in every folder below.

Seeing the folders

ccam folder

ccam folder with no arguments lists the folders that have an account, then the account a launch would use in the current folder, and why:

$ cd ~/code/company/api && ccam folder
/home/me/code/company → work

Here (/home/me/code/company/api): work, set for /home/me/code/company

Removing a folder's account

ccam folder --remove ~/code/company

--remove deletes the entry for exactly that folder, or the current folder when you give none. In a subfolder that only inherits its account from a parent folder, ccam names the parent folder and removes nothing.

Starting Claude Code in the folder

cd ~/code/company/api && ccam -p "summarise the open issues"

Inside ~/code/company, this runs as work. These launches use the folder's account:

  • ccam -p "…" and any other launch whose first argument is an option for Claude Code
  • ccam run without a name, and ccam --dry-run
  • ccam --fallback -p "…" for its first attempt
  • the dashboard, ccam alone, which starts with its cursor on the folder's account, even when you reached the folder through a symbolic link

How it works

Each folder is one [[folder]] entry in ~/.config/ccam/config.toml, the file every launch reads anyway:

[[folder]]
path = '/home/me/code/company'
account = 'work'
  1. ccam folder resolves the folder to an absolute path with symbolic links resolved and saves it. Setting a folder again replaces its account.
  2. A launch without a name looks at the folder entries. With no entries it takes the default account at once.
  3. Otherwise it compares the working directory with each path as strings: the folder itself or one below it, never a folder that only starts with the same letters (/code/company does not cover /code/companyx). The deepest entry wins, so ~/code can be personal while ~/code/company is work.
  4. Only if the working directory matches nothing as given does ccam resolve its symbolic links and compare again.
  5. On Windows and macOS the comparison ignores upper and lower case, as their file systems usually do.

No file besides config.toml is read, so a launch inside a folder adds no measurable time (4.0 ms with or without entries, hyperfine, 300 runs).

Safety and edge cases

  • ccam rename carries the folder entries to the new name, and ccam remove deletes the entries of the removed account.
  • An entry whose account no longer exists stops a launch without a name in that folder: <folder> is set to account "<name>", which does not exist. Change it with ccam folder. ccam doctor reports such entries, and entries whose folder is gone.
  • ccam next chooses by rotation or usage and does not look at folders.