Skip to main content

Concurrent Sessions

Run multiple Claude CLI instances simultaneously with different accounts. Each profile runs in an isolated environment with independent credentials, sessions, and state.

Overview

# Terminal 1
ccs work "implement feature X"

# Terminal 2 (simultaneously)
ccs personal "research topic Y"

# Both run at the same time with isolated state

Architecture

CCS uses CLAUDE_CONFIG_DIR to create isolated instances:
~/.ccs/instances/work/        # Work account
~/.ccs/instances/personal/    # Personal account
When you run ccs work "task":
  1. Sets CLAUDE_CONFIG_DIR=~/.ccs/instances/work/
  2. Claude loads credentials from that directory
  3. All state stays isolated

Instance Structure

Each profile gets its own directory:
~/.ccs/instances/work/
├── .credentials.json      # OAuth credentials
├── session-env/           # Chat history
├── todos/                 # Task lists
├── logs/                  # Execution logs
├── commands/              # Custom commands
└── skills/                # Custom skills

Performance

MetricFirst UseSubsequent
Activation~20-35ms~5-10ms
Memory~3-5 KB per activation-
Disk~200-700 KB per profile-

Limitations

Running the same profile in multiple terminals causes conflicts.
# This conflicts:
ccs work "task1"  # Terminal 1
ccs work "task2"  # Terminal 2 - same files!

# Do this instead:
ccs work "task1"      # Terminal 1
ccs personal "task2"  # Terminal 2

Other Limitations

  • CLAUDE_CONFIG_DIR is undocumented (keep Claude CLI updated)
  • Commands/skills copied on creation, not synced later
  • Sessions/logs accumulate (manual cleanup if needed)

Sync Commands Manually

If you update ~/.claude/commands/ after creating a profile:
# Option 1: Recreate instance
rm -rf ~/.ccs/instances/work
ccs work "task"  # Recreates with latest

# Option 2: Manual copy
cp -r ~/.claude/commands/* ~/.ccs/instances/work/commands/

Cleanup

# Check sizes
du -sh ~/.ccs/instances/*

# Clear sessions
rm -rf ~/.ccs/instances/work/session-env/*

# Clear logs
rm -rf ~/.ccs/instances/work/logs/*