Accounts by folder
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 personalccam 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 folderccam 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/companyRemoving 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 Codeccam runwithout a name, andccam --dry-runccam --fallback -p "…"for its first attempt- the dashboard,
ccamalone, 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'ccam folderresolves the folder to an absolute path with symbolic links resolved and saves it. Setting a folder again replaces its account.- A launch without a name looks at the folder entries. With no entries it takes the default account at once.
- Otherwise it compares the working directory with each
pathas strings: the folder itself or one below it, never a folder that only starts with the same letters (/code/companydoes not cover/code/companyx). The deepest entry wins, so~/codecan bepersonalwhile~/code/companyiswork. - Only if the working directory matches nothing as given does ccam resolve its symbolic links and compare again.
- 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 renamecarries the folder entries to the new name, andccam removedeletes 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 doctorreports such entries, and entries whose folder is gone. ccam nextchooses by rotation or usage and does not look at folders.