Switch Claude Code login sessions while sharing settings and history across them.
Each named session is a symlink to ~/.claude, so settings and conversation history stay shared with your default profile — only the login session is separated. Sign in once per session and switch between accounts without losing your customizations.
bun install -g him0/claude-code-session-switcheror
npm install -g him0/claude-code-session-switcherbunx him0/claude-code-session-switcheror
npx him0/claude-code-session-switcherccss Show help
ccss create <name> Create a new session
ccss list List all sessions
ccss delete <name> Delete a session (--force to skip prompt)
ccss [-s <name>] exec <cmd> [args...] Run <cmd>; -s sets CLAUDE_CONFIG_DIR, omit for default
# Create a session
ccss create work
# Launch Claude Code with that session
ccss -s work exec claude
# Pass additional arguments through to claude
ccss -s work exec claude --resume
# Run any command with the session's env (useful for debugging)
ccss -s work exec bash
ccss -s work exec env | grep CLAUDE
# List sessions
ccss list
# Delete a session
ccss delete workFrequent users can alias their main flow:
alias cc-work='ccss -s work exec claude'Sessions are stored under ~/.config/ccsession/sessions/. Each session is a symlink to ~/.claude at creation time, so settings and conversation history are shared across all sessions. When running ccss -s <name> exec <cmd>, ccss sets CLAUDE_CONFIG_DIR to the session directory and spawns <cmd> — only the login session is separated.
When ccss exec launches a command, these variables are set in the child process:
CCSS— always1, a marker that the command is running under ccssCLAUDE_CONFIG_DIR— path to the session directory (only set when-s <name>is given)CCSS_SESSION_NAME— the session name (defaultwhen-sis omitted)
CCSS and CCSS_SESSION_NAME are handy for showing the current session in your shell prompt or status line.
MIT