M3 MacBook Airで複数のClaude Codeを連携させます。
install tmux
% brew install tmux
方針
あとは全てOpus 4.6にやってもらいます。
prompt 1
terminalを起動させて、所望のフォルダーに移動させるところまでは僕がやっておきます。
その状態から、新たにterminalを起動させてください。そして、起動させてあるterminalが画面の左半分となり、新たに起動させたterminalが画面の右半分になるようにしてください。
左半分のterminalの役割が作業指示者です。右半分のterminalの役割が作業者です。
ですので、両方ともtmuxを使う必要があります。
両方でdevcontainer exec –workspace-folder . bashを実行させてください。
その後に両方でclaude –dangerously-skip-permissionsを実行させてください。
上述を実現させるsh scriptを作成してください。
I will start the terminal and move to the desired folder.
From that state, please start a new terminal.
Then, make the terminal that has been started the left half of the screen, and the newly started terminal the right half of the screen.
The role of the left half terminal is the task instructor.
The role of the right half terminal is the worker.
Therefore, both need to use tmux.
Please execute devcontainer exec –workspace-folder . bash in both.
Then, please execute claude –dangerously-skip-permissions in both.
Please create a sh script to realize the above.
prompt 2
作業指示者と作業者にそれぞれ自分の役割を認識するファイルを作り、claudeの起動時に–append-system-promptオプションを使って簡潔な文章で自分の役割を認識するために該当のファイルを読み込ませてください。–append-system-promptオプションに対してcatコマンドでファイルを展開するようなことはせず、ファイルは使わずに直接文章を指定してください。
作業指示者はtmuxを使って作業者のterminalに指示を出します。
The task instructor and the worker should each create a file that recognizes their role, and when starting claude, use the –append-system-prompt option to read the relevant file in a concise sentence to recognize their role. Do not use the cat command to expand the file for the –append-system-prompt option, do not use the file, and specify the sentence directly.
The task instructor will use tmux to give instructions to the worker’s terminal.
まとめ
あとは気になったところを少し修正すれば完成です。
毎回少し違うので、手順書にはならないです。