Files
hakorune/tools/codex-tmux-driver/claude-tmux-setup.md
Moe Charm 4e1b595796 AI協調開発研究ドキュメントの完成と Phase 10.9-β 進捗
【AI協調開発研究】
- AI二重化モデルの学術論文draft完成(workshop_paper_draft.md)
- 「隠れた危機」分析とbirthの原則哲学化
- TyEnv「唯一の真実」協調会話を保存・研究資料に統合
- papers管理構造の整備(wip/under-review/published分離)

【Phase 10.9-β HostCall進捗】
- JitConfigBox: relax_numeric フラグ追加(i64→f64コアーション制御)
- HostcallRegistryBox: 署名検証・白黒リスト・コアーション対応
- JitHostcallRegistryBox: Nyash側レジストリ操作API
- Lower統合: env直読 → jit::config::current() 参照に統一
- 数値緩和設定: NYASH_JIT_HOSTCALL_RELAX_NUMERIC/Config.set_flag

【検証サンプル拡充】
- math.sin/cos/abs/min/max 関数スタイル(examples/jit_math_function_style_*.nyash)
- 境界ケース: 署名不一致・コアーション許可・mutating拒否サンプル
- E2E実証: String.length→allow, Array.push→fallback, math関数の署名一致観測

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 12:09:09 +09:00

143 lines
3.7 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 🚀 Claude Code × tmux セットアップ完全ガイド
## 📋 概要
Claude Codeもtmuxで動かすことで、Codexとの完璧な双方向通信を実現します
## 🎯 手順1から
### 1⃣ 現在のClaude Codeを終了
```bash
# 現在のセッションを保存して終了
exit
```
### 2⃣ tmuxセッションでClaude Codeを起動
```bash
# 新しいtmuxセッションを作成名前: claude-8771
tmux new-session -d -s claude-8771
# Claude Codeをtmuxセッションで起動
tmux send-keys -t claude-8771 "cd /mnt/c/git/nyash-project/nyash" Enter
tmux send-keys -t claude-8771 "claude" Enter
# セッションにアタッチして作業
tmux attach -t claude-8771
```
### 3⃣ hook-serverを起動別ターミナル
```bash
# 新しいターミナルを開いて
cd /mnt/c/git/nyash-project/nyash/tools/codex-tmux-driver
HOOK_SERVER_PORT=8770 node hook-server.js
```
### 4⃣ Codexをtmuxで起動さらに別ターミナル
```bash
# 既存のスクリプトを使用
cd /mnt/c/git/nyash-project/nyash/tools/codex-tmux-driver
./tmux-launch-only.sh
```
### 5⃣ 双方向ブリッジを起動(さらに別ターミナル)
```bash
cd /mnt/c/git/nyash-project/nyash/tools/codex-tmux-driver
node claude-codex-unified-bridge.js
```
## 🔄 完成図
```
┌─────────────────┐
│ Terminal 1 │
│ tmux: claude │ ←──┐
└─────────────────┘ │
┌─────────────────┐ │ ┌──────────────┐
│ Terminal 2 │ ├────┤ hook-server │
│ hook-server │ │ │ port: 8770 │
└─────────────────┘ │ └──────────────┘
┌─────────────────┐ │
│ Terminal 3 │ │
│ tmux: codex │ ←──┘
└─────────────────┘
双方向自動通信!
```
## 💡 使い方
### Claude → Codex従来通り
```javascript
// Claude Code内で実行
const WebSocket = require('ws');
const ws = new WebSocket('ws://localhost:8770');
ws.send(JSON.stringify({
source: 'claude',
type: 'inject-input',
data: 'Hello Codex!'
}));
```
### Codex → Claude新機能
Codexが自動的にClaudeに返信しますunified-bridgeが処理
## 🎮 tmux基本操作
```bash
# セッション一覧
tmux ls
# セッションにアタッチ
tmux attach -t claude-8771
# デタッチ(セッションから抜ける)
Ctrl+B, D
# セッション削除
tmux kill-session -t claude-8771
# 画面分割(横)
Ctrl+B, "
# 画面分割(縦)
Ctrl+B, %
# ペーン間移動
Ctrl+B, 矢印キー
```
## ⚠️ 注意事項
1. **tmuxセッション名の重複**
- claude-8771, codex-safe は固定名なので重複注意
2. **ポート番号**
- 8770: hook-server固定
- 変更する場合は全ての設定を統一
3. **終了時の手順**
1. ブリッジを停止Ctrl+C
2. hook-serverを停止Ctrl+C
3. tmuxセッションを終了
## 🚨 トラブルシューティング
**Q: セッションが既に存在する**
```bash
tmux kill-session -t claude-8771
tmux kill-session -t codex-safe
```
**Q: hook-serverに接続できない**
```bash
# プロセスを確認
ps aux | grep "node.*hook-server"
# 強制終了
pkill -f "node.*hook-server"
```
**Q: メッセージが届かない**
- hook-serverのログを確認
- WebSocketの接続状態を確認
- tmuxセッション名が正しいか確認