ParaLLM Tmux Claude 코드 제어 평면
hackernews
|
|
📦 오픈소스
#ai 딜
#anthropic
#claude
#tmux
#개발워크플로우
#병렬처리
#코드제어
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
이 가이드는 Tmux를 활용해 여러 기능 브랜치에서 병렬로 Claude Code 세션을 관리하는 'ParaLLM' 워크플로우를 소개합니다. `Ctrl+b c`로 새 브랜치 환경을 생성하거나 기존 작업을 재개하고, 스크립트를 통해 자동으로 `~/code/envs` 디렉토리에 저장소를 격리 복제하여 작업합니다. 또한 `Ctrl+b k`로 푸시되지 않은 커밋을 경고하고 환경을 안전하게 정리하며, macOS에서는 iTerm2의 'CSI u' 설정을 통해 Shift+Enter 기능을 사용할 것을 권장합니다.
본문
Tmux workflow for managing parallel Claude Code sessions across multiple feature branches. - Ctrl+b c: Create or resume a feature branch environment - Select a project from ~/code - Choose to start new or resume existing feature - Clones repo to ~/code/envs/{Project}-{feature}/{Project}/ - Opens tmux window and starts Claude Code - Select a project from - Ctrl+b k: Cleanup a feature branch environment - Select feature to delete - Warns about unpushed commits - Kills associated tmux window - Deletes the environment directory - Ctrl+b C: Plain new window (original tmux behavior) - Shift+Enter: Insert newline in Claude Code REPL (requires iTerm2 with CSI u — see below) - Mouse/trackpad: Scroll tmux panes and click to select panes - Option+drag: Select and copy text (Cmd+C to copy, iTerm2 native selection) iTerm2 is recommended on macOS for the best experience. macOS Terminal.app does not support extended key sequences, so features like Shift+Enter for newlines in the Claude Code REPL will not work. To set up iTerm2: - Install iTerm2 - Go to Preferences > Profiles > Keys > General - Enable "Report modifiers using CSI u" # Install fzf (required for interactive selection) brew install fzf # Install Claude Code npm install -g @anthropic-ai/claude-code cd ~/code git clone [email protected]:free-soellingeraj/para-llm-directory.git chmod +x ~/code/para-llm-directory/tmux-new-branch.sh chmod +x ~/code/para-llm-directory/tmux-cleanup-branch.sh # Ctrl+b c: interactive project + branch selection, creates clone in envs/ bind-key c display-popup -E -w 60% -h 60% "~/code/para-llm-directory/tmux-new-branch.sh" # Ctrl+b k: cleanup/delete a feature branch environment bind-key k display-popup -E -w 60% -h 60% "~/code/para-llm-directory/tmux-cleanup-branch.sh" # Ctrl+b C: original behavior (plain new window) bind-key C new-window -c "#{pane_current_path}" tmux source-file ~/.tmux.conf mkdir -p ~/code/envs ~/code/ ├── MyProject/ # Base repo (must have git remote) ├── AnotherProject/ # Another base repo ├── para-llm-directory/ # This repo (scripts) └── envs/ # Feature environments ├── MyProject-feature-1/ │ └── MyProject/ # Cloned repo on feature-1 branch └── MyProject-bugfix-2/ └── MyProject/ # Cloned repo on bugfix-2 branch - Press Ctrl+b c - Select your project - Choose "No - start new feature/bug" - Enter the feature/branch name - Wait for clone to complete - Claude Code starts automatically - Press Ctrl+b c - Select your project - Choose "Yes - resume existing" - Select the branch from the list - Claude Code resumes with --resume - Press Ctrl+b k - Select the feature to delete - Confirm deletion - (If unpushed commits exist, confirm again) - Tmux window closes and directory is deleted - All selection screens have ← Back option to go to previous step - Press Esc orCtrl+c to cancel at any time - When typing branch name, type back to go back Projects can define setup and teardown scripts that run automatically: If this script exists in your project root, it runs when creating or resuming an environment (before Claude starts). Example for an iOS project: #!/bin/bash SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Install pods if needed if [[ ! -d "$SCRIPT_DIR/Pods" ]]; then (cd "$SCRIPT_DIR" && pod install) fi # Open Xcode open "$SCRIPT_DIR/MyApp.xcworkspace" If this script exists, it runs when cleaning up an environment (before deletion). Example: #!/bin/bash SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Close Xcode workspace osascript -e " tell application \"Xcode\" repeat with doc in workspace documents if path of doc is \"$SCRIPT_DIR/MyApp.xcworkspace\" then close doc end if end repeat end tell " 2>/dev/null Check the status of all your parallel environments: # Add alias to ~/.zshrc alias envs='~/code/para-llm-directory/envs.sh' # Then run: envs # Show all environments with branch and status envs -v # Verbose: also show unpushed commit messages Output: ENVIRONMENT BRANCH STATUS ----------- ------ ------ RiffyApp-delta-storage-refactor delta-storage-refactor clean RiffyApp-new-feature new-feature 2 modified 1 untracked MyProject-bugfix bugfix ↑3 unpushed - Base repos in ~/code should not have dashes in their names (dashes indicate feature clones) - Each feature gets a fresh clone, so changes are isolated - Claude Code sessions are per-directory, so --resume works per feature - Unpushed commits are detected before deletion to prevent data loss - Project hooks are optional - environments work fine without them
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유