Claude Max 14 / Claude Code on Windows

Claude CodeをWindows 11で使います。(2026.02.02)
tmuxを使います。

Opus 4.5に下調べをしてもらったら、12項目の概要の資料を作ってきました。
1項目ずつ詳細な資料を作って欲しいということがあり、作業を12分割くらいにして、指示を出す役割と、指示を受けて資料を作る役割に分けて進めることにしました。

Install Git for Windows SDK

Opus 4.5が「WSLかMSYS2でやるといいよ。」と言ってくる。
でも、Git for Windows SDKを使います。

git for windows

一番下まで移動します。

Download Git for Windows SDK

GitHubに飛ばされます。

git-sdk-installer-1.0.8-64.7z.exe

変更しなければCドライブ直下に展開するだけのようです。

Git Bash用に設定した.bashrcなどはそのまま使われます。
beepの設定なども引き継がれています。どのファイルでやっているんだろう。ホームディレクトリの下ではあるんだろうけど。これは便利。調べておこう。

Install tmux

変更しなかったとしてC:/git-sdk-64/git-bash.exeを起動します。

インストール。


$ pacman -S tmux

ちなみに、アンインストールする場合。


$ pacman -R tmux

共存が簡単

下記のように複雑です。

  • Claude Codeには設計された意図通りにGit Bash(Git for Windows)を使ってもらいます。
  • Git for Windows SDKのgit-bash.exeでtmuxを使うと何の問題も発生しない。
  • Git Bashのgit-bash.exeでtmuxを使うとエラーで起動しない。
  • Git BashでもGit for Windows SDKでもGit for Windows SDKのvim.exeを使うとおかしくなる。

$ vi ~/.bashrc

GitはCドライブ直下にインストールしたとします。
下記を追加します。

.bashrc

PATH=/c/git/:$PATH
PATH=/c/git/bin:$PATH
PATH=/c/git/usr/bin:$PATH

$ . ~/.bashrc

これでエラーが起きたり遅くなったりすることなく使えるようになります。
PATHは前から見つかった順なので、これで期待通りというわけです。

  • Git for Windows SDKのgit-bash.exeを使う。(batから呼び出す。)
  • Git Bashのbash.exeを使う。
  • Git for Windows SDKのtmux.exeを使う。
  • Git Bashのvim.exeを使う。

作業指示者の役割のClaude Codeと作業者の役割のClaude Codeをつくる

作業者の役割を12個つくってもいいのですが、最初は1個だけつくります。

Claude Codeにつくってもらいます。

下記、要求仕様書。

下記を実現させてください。

  • tmuxを使います。
  • claude –dangerously-skip-permissionsを使う。起動まではこちらでやっておきます。
  • 1つのClaude Codeは作業指示者の役割を持ちます。作業指示者は1つのターミナルを使います。
    • 業務内容が順番に書かれた作業指示書に従って作業者に指示を出します。
    • 1つの作業が完了したら作業者から完了報告が来ます。完了報告が来たら作業者に次の業務を開始するように指示を出します。
    • 上記を業務が完了するまで繰り返します。
  • もう1つのClaudeは作業者の役割を持ちます。作業者は1つのターミナルを使います。
    • 作業指示者から作業指示が来たら、該当の業務を開始します。
    • 業務が完了したら作業指示者に完了報告をします。完了報告をしたら一旦、作業を完了とします。
    • 新しい作業指示が来たら、再度該当の業務を開始します。
  • 作業指示書のフォーマットです。
    • 方法Aについて詳細に図、グラフ、表を使ってわかりやすく説明する。htmlで、日本語で出力する。
    • 方法Bについて詳細に図、グラフ、表を使ってわかりやすく説明する。htmlで、日本語で出力する。
    • 方法Cについて詳細に図、グラフ、表を使ってわかりやすく説明する。htmlで、日本語で出力する。
    • 方法Dについて詳細に図、グラフ、表を使ってわかりやすく説明する。htmlで、日本語で出力する。
    • 方法Eについて詳細に図、グラフ、表を使ってわかりやすく説明する。htmlで、日本語で出力する。

Please achieve the following:

  • Use tmux.
  • Use claude –dangerously-skip-permissions. I will handle the startup.
  • One Claude Code will have the role of task instructor.
    • Follow the task instruction sheet with the list of tasks in order and give instructions to the worker.
    • When a task is completed, the worker will report completion. Upon receiving the completion report, instruct the worker to start the next task.
    • Repeat the above until all tasks are completed.
  • The other Claude will have the role of worker.
    • When a task instruction comes from the task instructor, start the corresponding task.
    • When the task is completed, report completion to the task instructor. Once the completion report is made, the task is considered complete for the time being.
    • When a new task instruction comes, start the corresponding task again.
  • The format of the task instruction sheet is as follows.
    • Explain Method A in detail using diagrams, graphs, and tables to make it easy to understand. Output in HTML, in Japanese.
    • Explain Method B in detail using diagrams, graphs, and tables to make it easy to understand. Output in HTML, in Japanese.
    • Explain Method C in detail using diagrams, graphs, and tables to make it easy to understand. Output in HTML, in Japanese.
    • Explain Method D in detail using diagrams, graphs, and tables to make it easy to understand. Output in HTML, in Japanese.
    • Explain Method E in detail using diagrams, graphs, and tables to make it easy to understand. Output in HTML, in Japanese.

英語で指示して、英語で出力させるのが精度が良いのは今も変わっていないので。少なくともOpusへのinputは英語で行います。

自動化を進める 1

・batファイルを作成してください。
  ・C:\git-sdk-64直下のgit-bashを1つ起動させる
  ・~/Documents/develop/AI/tmuxに移動させてください。
  ・tmuxを使って左半分と右半分にしてください。

– Please create a bat file.
  – launches git-bash located directly under C:\git-sdk-64.
  – move to ~/Documents/develop/AI/tmux.
  – use tmux to split the screen into left and right halves.

自動化を進める 2

・batファイルを作成してください。
  ・C:\git-sdk-64直下のgit-bashを1つ起動させる
  ・~/Documents/develop/AI/tmuxに移動させてください。
  ・tmuxを使って左半分と右半分にしてください。
  ・devcontainer exec –workspace-folder . bashを実行してください。
  ・claude –dangerously-skip-permissionsを実行してください。

– Please create a bat file.
  – launches git-bash located directly under C:\git-sdk-64.
  – move to ~/Documents/develop/AI/tmux.
  – use tmux to split the screen into left and right halves.
  – execute devcontainer exec –workspace-folder . bash.
  – execute claude –dangerously-skip-permissions.

自動化を進める 3

作業指示者のClaude Codeに対してCtrl-cを2回送るのは僕が行います。
作業指示者のtmux側から作業者のclaudeにCtrl-cを少し間隔をあけて2回送り、devcontainerからexitさせて、tmuxからexitさせて、git-bashからexitさせて、その後に、devcontainerからexitさせて、git-bashからexitさせるファイルを作成してください。
つまり終了処理を自動化してください。

複数の案を作成してhtmlで日本語で出力してください。
(Opus 4.5に実装の前にhtmlで出力させることはとてもおすすめです。)

I send Ctrl-c twice to the task instructor’s Claude Code.
Please create a file that sends Ctrl-c twice to the worker’s claude from the task instructor’s tmux side with a slight interval, exits from the devcontainer, exits from tmux, exits from git-bash, and then exits from the devcontainer and exits from git-bash.
In other words, automate the shutdown process.

Create multiple proposals and output them in HTML in Japanese.

ここまでのoutputです。

shutdown.sh

#!/bin/bash
# シンプル版シャットダウンスクリプト
# 使用方法: Instructor Claude に Ctrl-C した後、このスクリプトを実行

SESSION="dev"
WORKER_PANE="0.1"
INSTRUCTOR_PANE="0.0"
INTERVAL=0.5

echo "=== シャットダウン開始 ==="

# セッション確認
if ! tmux has-session -t $SESSION 2>/dev/null; then
    echo "セッション '$SESSION' が見つかりません"
    exit 0
fi

# Step 1: Worker Claude に Ctrl-C × 2
echo "[1/7] Worker Claude に Ctrl-C を送信中..."
tmux send-keys -t $SESSION:$WORKER_PANE C-c; sleep $INTERVAL
tmux send-keys -t $SESSION:$WORKER_PANE C-c; sleep $INTERVAL

# Step 2-3: Worker devcontainer と pane から exit
echo "[2/7] Worker devcontainer から exit..."
tmux send-keys -t $SESSION:$WORKER_PANE "exit" Enter; sleep $INTERVAL
echo "[3/7] Worker pane から exit..."
tmux send-keys -t $SESSION:$WORKER_PANE "exit" Enter; sleep $INTERVAL

# Step 4-5: Instructor devcontainer と pane から exit
echo "[4/7] Instructor devcontainer から exit..."
tmux send-keys -t $SESSION:$INSTRUCTOR_PANE "exit" Enter; sleep $INTERVAL
echo "[5/7] Instructor pane から exit..."
tmux send-keys -t $SESSION:$INSTRUCTOR_PANE "exit" Enter; sleep $INTERVAL

# Step 6: tmux session を終了
echo "[6/7] tmux session を終了中..."
sleep 1
tmux kill-session -t $SESSION 2>/dev/null || true

# Step 7: Git Bash を終了
echo "[7/7] Git Bash を終了します..."
echo "=== シャットダウン完了 ==="
exit 0

自動化を進める 4

作業指示者がtmux send-keysを使って作業者に指示を出すことを実現させてください。

Please enable the task instructor to give instructions to the worker using tmux send-keys.

ここまでのoutputです。

launch-git-bash.bat

@echo off
start "" "C:\git-sdk-64\git-bash.exe" -c "./start-claude.sh"

start-claude.sh

#!/bin/bash
# FX Strategy HTML Creation - Tmux Session Launcher
# Creates a tmux session with:
#   Left  (dev:0.0): Task Instructor
#   Right (dev:0.1): Worker
#
# The Instructor sends instructions directly into the Worker pane via
# tmux send-keys, so both the instruction and the work output are
# visible in the Worker pane.
#
# Usage:
#   ./start-claude.sh              # Run Claude directly (tmux send-keys enabled)
#   ./start-claude.sh --devcontainer  # Run inside devcontainer (no tmux send-keys)

PROJECT_DIR="${PROJECT_DIR:-$(pwd)}"
SESSION_NAME="dev"
USE_DEVCONTAINER=false

# Parse arguments
if [ "$1" = "--devcontainer" ]; then
    USE_DEVCONTAINER=true
fi

# Kill existing session if it exists
tmux kill-session -t $SESSION_NAME 2>/dev/null

# Ensure shared directory exists
mkdir -p "$PROJECT_DIR/shared"
echo "" > "$PROJECT_DIR/shared/task_instruction.txt"
echo "" > "$PROJECT_DIR/shared/task_complete.txt"

# Create new tmux session
tmux new-session -d -s $SESSION_NAME -c "$PROJECT_DIR"

# Split window horizontally (left = Instructor, right = Worker)
tmux split-window -h -t $SESSION_NAME -c "$PROJECT_DIR"

# Layout:
#   0.0 = Left  (Instructor)
#   0.1 = Right (Worker)

# Configure pane titles
tmux select-pane -t $SESSION_NAME:0.0 -T "INSTRUCTOR"
tmux select-pane -t $SESSION_NAME:0.1 -T "WORKER"

# Enable pane border status to show titles
tmux set -t $SESSION_NAME pane-border-status top
tmux set -t $SESSION_NAME pane-border-format " #{pane_title} "

if [ "$USE_DEVCONTAINER" = true ]; then
    # Start devcontainer shells in both panes
    tmux send-keys -t $SESSION_NAME:0.0 "devcontainer exec --workspace-folder . bash" Enter
    tmux send-keys -t $SESSION_NAME:0.1 "devcontainer exec --workspace-folder . bash" Enter
    sleep 3
fi

# Instructor prompt: tells Claude to use tmux send-keys for direct communication
INSTRUCTOR_PROMPT='You are the TASK INSTRUCTOR. Read instructor_prompt.md for your full role description.

CRITICAL: You can send instructions directly to the Worker by running this Bash command:
  tmux send-keys -t dev:0.1 "YOUR_MESSAGE" Enter

Workflow:
1. Read task_progress.json to find the next pending task
2. Write full instruction to shared/task_instruction.txt
3. Send notification to Worker: tmux send-keys -t dev:0.1 "New task assigned. Read shared/task_instruction.txt and execute it." Enter
4. Wait for Worker completion (poll shared/task_complete.txt or use: tmux capture-pane -t dev:0.1 -p | tail -20)
5. Update task_progress.json and repeat'

# Worker prompt: tells Claude to respond to tmux-sent messages and file-based instructions
WORKER_PROMPT='You are the WORKER. Read worker_prompt.md for your full role description.

CRITICAL: You will receive task instructions as messages from the Instructor via tmux send-keys.
When you receive a message telling you to check shared/task_instruction.txt, read it and execute the task.

After completing a task:
1. Write completion report to shared/task_complete.txt
2. Notify Instructor: tmux send-keys -t dev:0.0 "Task completed. Check shared/task_complete.txt" Enter'

# Start Claude in Instructor pane (left)
tmux send-keys -t $SESSION_NAME:0.0 "claude --dangerously-skip-permissions --append-system-prompt '$(echo "$INSTRUCTOR_PROMPT" | tr '\n' ' ')'" Enter

# Start Claude in Worker pane (right)
tmux send-keys -t $SESSION_NAME:0.1 "claude --dangerously-skip-permissions --append-system-prompt '$(echo "$WORKER_PROMPT" | tr '\n' ' ')'" Enter

# Select Instructor pane as default
tmux select-pane -t $SESSION_NAME:0.0

# Attach to the session
tmux attach -t $SESSION_NAME

自動化を進める 5

バージョン管理をしてください。
アウトプットをtmux_backupにコピーするスクリプトを作成してください。tmux_backupは../にあります。

Please manage version control.
Please create a script that copies the output to tmux_backup. tmux_backup is located in ../.

backup.sh

#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
BACKUP_DIR="$SCRIPT_DIR/../tmux_backup"
VERSION_FILE="$SCRIPT_DIR/.version"

# Read or initialize version
if [ -f "$VERSION_FILE" ]; then
    VERSION=$(cat "$VERSION_FILE")
else
    VERSION="0.0.0"
fi

# Bump patch version
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
PATCH=$((PATCH + 1))
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
echo "$NEW_VERSION" > "$VERSION_FILE"

TIMESTAMP="$(date +%Y%m%d-%H%M%S)"
DEST="$BACKUP_DIR/v${NEW_VERSION}_${TIMESTAMP}"

mkdir -p "$DEST"
cp -r "$SCRIPT_DIR"/*.sh "$DEST/" 2>/dev/null
cp -r "$SCRIPT_DIR"/*.bat "$DEST/" 2>/dev/null
cp -r "$SCRIPT_DIR"/*.ps1 "$DEST/" 2>/dev/null
cp -r "$SCRIPT_DIR"/*.md "$DEST/" 2>/dev/null
cp -r "$SCRIPT_DIR"/.gitignore "$DEST/" 2>/dev/null
cp -r "$SCRIPT_DIR"/.claude "$DEST/" 2>/dev/null
cp -r "$SCRIPT_DIR"/instructor "$DEST/" 2>/dev/null
cp -r "$SCRIPT_DIR"/shared "$DEST/" 2>/dev/null

echo "Backed up to: $DEST"

一旦、保留の自動化

・全画面にしてください。

minttyを使おうとして混乱が始まるので全画面にするクリックくらいは自分でやろうかと。

この環境の問題

作業者側の様子がわかりません。
なので、作業指示者に下記の依頼をします。

右のペインで仕事をしている様子を見えるようにしてください。
workerのペインでworkerの作業内容を表示するようにしてください。

Please make the right pane visible while working.
Please display the worker’s work content in the worker pane.

意図通りの動作にならない場合は/clearを繰り返したら、意図通りになると思います。

この環境の利点

作業指示者が気が利くときがあります。roleは重要。

Opus 4.6では、勝手に12のsubagentを使うこともあるので、作業指示者の完了待ちもなくなり、12倍以上の速度で進むことがあります。

広告

さくらのレンタルサーバ
ムームードメイン
Oisix(おいしっくす)
らでぃっしゅぼーや
珈琲きゃろっと
エプソムソルト
【FRONTIER】
AdGuard Ad Blocker
AdGuard VPN
AdGuard DNS




«