A tmux-based workspace manager for Claude Code. Run multiple Claude sessions across different projects, each in its own tmux session with a dedicated terminal tab.
$ cw list
=== Active Workspaces ===
frontend [running]
path: /Users/me/projects/frontend
api [waiting]
path: /Users/me/projects/api
docs [running]
path: /Users/me/projects/docs
If you work with Claude Code across multiple projects, you know the pain:
-
Your terminal crashes or your Mac reboots — all your Claude sessions are gone. You have to reopen every tab,
cdinto each project, and runclaudeagain. If you had 5+ projects open, that's 5+ minutes of mindless setup just to get back to where you were. -
iTerm2 randomly quits, your laptop runs out of battery, or macOS forces a restart for updates — same story. All context lost, all sessions dead.
-
Daily startup friction — every morning you repeat the same ritual: open terminal, make tabs, navigate to projects, start Claude in each one.
cw was built to solve exactly this. It wraps Claude sessions in tmux, so they survive terminal crashes, app quits, and even SSH disconnects. When iTerm2 dies, your Claude sessions keep running in the background. When your Mac reboots, just type cw and all your projects relaunch instantly — no manual cd, no remembering paths, no repetitive setup.
# Mac rebooted? iTerm2 crashed? No problem.
# One command to reconnect everything:
$ cw
=== Starting favorites ===
[attach] frontend - connecting to existing session
[attach] api - connecting to existing session
[attach] docs - connecting to existing session
Done! 3 project(s) started.
- One command to rule them all -
cw myappstarts Claude in your project - Multi-project -
cw frontend api docsopens all three at once - Favorites -
cw(no args) opens all your favorite projects - Persistent sessions - tmux sessions survive terminal disconnects
- Status detection - see which sessions are running vs waiting for input
- Terminal support - iTerm2, Terminal.app, Kitty, WezTerm, or plain tmux
- Self-updating -
cw updatepulls the latest version
- tmux - session management
- python3 - JSON config parsing (ships with macOS/most Linux)
- Claude Code - the CLI itself
curl -fsSL https://raw.githubusercontent.com/galhui/cw/main/install.sh | bash# Clone
git clone https://github.com/galhui/cw.git
cd cw
# Copy to your PATH
cp cw ~/bin/cw
chmod +x ~/bin/cw
# Make sure ~/bin is in your PATH
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc# macOS
brew install tmux
# Ubuntu/Debian
sudo apt install tmux
# Arch
pacman -S tmux# Register a project
cw add myapp ~/projects/myapp
# Start Claude in it
cw myapp
# Register more projects
cw add api ~/projects/api
cw add docs ~/projects/docs
# Open multiple at once
cw myapp api docs
# Add favorites for quick access
cw fav add myapp
cw fav add api
# Open all favorites with just:
cwcw add <alias> <path> # Register a project
cw remove <alias> # Remove a project
cw rename <old> <new> # Rename alias
cw projects # List all registered projectscw # Open all favorites
cw <alias> # Open one project
cw <alias> <alias> ... # Open multiple projectscw fav list # List favorites
cw fav add <alias> # Add to favorites
cw fav remove <alias> # Remove from favoritescw list # Show active sessions with status
cw kill <alias> # Kill a session
cw kill-all # Kill all sessionscw update # Update to latest version
cw version # Show version
cw help # Show helpConfig file: ~/.cw/config.json
{
"projects": {
"myapp": "/Users/me/projects/myapp",
"api": "/Users/me/projects/api"
},
"favorites": ["myapp", "api"],
"claude_flags": "",
"terminal": "auto"
}| Key | Description | Default |
|---|---|---|
projects |
Alias → path mapping | {} |
favorites |
List of favorite aliases | [] |
claude_flags |
Extra flags passed to claude CLI |
"" |
terminal |
Terminal app: auto, iterm, terminal, kitty, wezterm, tmux |
"auto" |
Pass custom flags to the Claude CLI:
{
"claude_flags": "--dangerously-skip-permissions"
}cw myappcreates a tmux session namedcw_myapp- Sets the working directory to your project path
- Runs
claude(with any configured flags) inside the session - Opens a new terminal tab attached to that tmux session
If the session already exists, it just attaches to it (no duplicate sessions).
Sessions persist even if your terminal closes. Just run cw myapp again to reconnect.
- Detach from tmux without killing the session:
Ctrl+BthenD - Switch between sessions in tmux:
Ctrl+BthenS - Use with SSH: Sessions persist on the remote machine; reconnect anytime
- Pair with CLAUDE.md: Each project can have its own Claude instructions
cw updateOr reinstall:
curl -fsSL https://raw.githubusercontent.com/galhui/cw/main/install.sh | bashrm ~/bin/cw
rm -rf ~/.cw # removes config (optional)Claude Code 사용자를 위한 tmux 기반 워크스페이스 관리 도구입니다. 여러 프로젝트에서 Claude를 동시에 실행하고, 각각을 별도의 tmux 세션 + 터미널 탭으로 관리합니다.
Claude Code로 5개 프로젝트를 동시에 진행하고 있었는데...
- 맥북이 재부팅됐다 — iTerm2 탭 5개, 각 프로젝트 경로, Claude 세션 전부 날아감. 다시 하나하나 열고
cd하고claude실행하는 데만 5분. - iTerm2가 갑자기 꺼졌다 — 같은 상황. 작업하던 컨텍스트 전부 소멸.
- macOS 업데이트로 강제 재시작 — 새벽에 몰래 재부팅되어 아침에 출근하면 빈 화면.
- 매일 아침 같은 루틴 — 터미널 열고, 탭 만들고, 폴더 이동하고, claude 실행. 매일 반복.
cw는 이 문제를 해결하기 위해 만들었습니다. Claude 세션을 tmux 안에서 실행하기 때문에 터미널이 꺼져도 세션이 살아있습니다. 맥이 재부팅되더라도 cw 한 번이면 모든 프로젝트가 즉시 재실행됩니다 — 경로 기억할 필요 없이, 반복 설정 없이.
# 맥 재부팅 후, iTerm2 크래시 후... 상관없이:
$ cw
=== Starting favorites ===
[attach] frontend - connecting to existing session
[attach] api - connecting to existing session
[attach] docs - connecting to existing session
Done! 3 project(s) started.curl -fsSL https://raw.githubusercontent.com/galhui/cw/main/install.sh | bash| 종속성 | 설치 방법 | 비고 |
|---|---|---|
| tmux | brew install tmux (macOS) / apt install tmux (Ubuntu) |
세션 관리 |
| python3 | macOS/Linux 기본 탑재 | config 파싱 |
| Claude Code | npm install -g @anthropic-ai/claude-code |
Claude CLI |
git clone https://github.com/galhui/cw.git
cp cw/cw ~/bin/cw
chmod +x ~/bin/cw~/bin이 PATH에 없다면:
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc
source ~/.zshrccw add myapp ~/projects/myapp # 프로젝트 등록
cw add api ~/projects/api # 여러 개 등록 가능
cw projects # 등록 목록 확인cw myapp # 하나만 열기
cw myapp api docs # 여러 개 동시에 열기매일 쓰는 프로젝트를 즐겨찾기에 등록하면 cw 한 번으로 전부 실행:
cw fav add myapp # 즐겨찾기 추가
cw fav add api
cw fav list # 즐겨찾기 목록
cw # 즐겨찾기 전부 실행!cw list # 활성 세션 + 상태 확인
cw kill myapp # 특정 세션 종료
cw kill-all # 전체 종료cw update # 최신 버전으로 업데이트
cw version # 현재 버전 확인~/.cw/config.json에 저장됩니다:
{
"projects": {
"myapp": "/Users/me/projects/myapp"
},
"favorites": ["myapp"],
"claude_flags": "",
"terminal": "auto"
}| 설정 | 설명 | 기본값 |
|---|---|---|
claude_flags |
claude 실행 시 추가 플래그 | "" |
terminal |
터미널 앱 (auto/iterm/terminal/kitty/wezterm/tmux) |
"auto" |
cw myapp실행 → tmux 세션cw_myapp생성- 프로젝트 디렉토리로 이동
claudeCLI 실행- 새 터미널 탭에서 해당 tmux 세션에 연결
이미 세션이 있으면 새로 만들지 않고 기존 세션에 연결합니다. 터미널을 닫아도 tmux 세션은 유지되므로, cw myapp으로 다시 연결하면 됩니다.
rm ~/bin/cw
rm -rf ~/.cw # 설정 파일 삭제 (선택)MIT
Issues and PRs welcome at github.com/galhui/cw.