CLI to Manage Multiple Claude Code Projects - Worktrees, Accounts, and Parallel Sessions

Fazm Team··2 min read

Managing Multiple Claude Code Projects from the CLI

Running a single Claude Code session is straightforward. Running five at once across different projects - that's where most developers hit a wall. The CLI tooling exists, but knowing the right combination makes the difference.

Git Worktrees Are the Foundation

Instead of cloning a repo multiple times, use git worktree add to create lightweight working directories. Each worktree gets its own branch and file state while sharing the same git history.

git worktree add ../project-feature-a -b feature/auth-rewrite
git worktree add ../project-feature-b -b feature/api-migration

Now you can run a Claude Code instance in each directory without file conflicts. One agent rewrites authentication while another migrates API endpoints - no stepping on each other's changes.

Account and Session Management

If you're working across multiple organizations, you'll need separate Claude Code configurations. The trick is using environment variables per session:

ANTHROPIC_API_KEY=$ORG_A_KEY claude --project ../project-feature-a
ANTHROPIC_API_KEY=$ORG_B_KEY claude --project ../project-feature-b

Pair this with tmux panes and you can monitor all sessions from one terminal window.

Practical Limits

Context windows are per-session, so each agent has its full allocation. The bottleneck is usually your own attention - reviewing output from five parallel agents is harder than running them.

Start with two parallel sessions. Add more only when you've built the habit of checking diffs before approving changes. Three agents producing unchecked code is worse than one agent producing reviewed code.

The Real Killer Feature

The combination of worktrees plus per-session configurations means you can treat Claude Code projects like browser tabs - open what you need, close what you don't, and switch context without losing state. Your CLI becomes the orchestration layer that keeps everything organized.

Fazm is an open source macOS AI agent. Open source on GitHub.

More on This Topic

Related Posts