Server mode
Phù hợp khi muốn server dùng lại với URL và QR code.
claude remote-control Cả hai path có chung logic local-first: thiết bị remote đã đăng nhập đi qua relay, còn session thật vẫn chạy trên host được connect. Khác nhau là host process, identity system, và có thêm model routing hay không.
Chỉ gửi control event và nhận session update.
Relay chỉ chuyển prompt, yêu cầu duyệt và trạng thái. File/workspace vẫn ở host.
Host chạy phiên Claude/Codex thật. File, tool, credential và quyền duyệt ở lại host.
Dùng command tích hợp của Claude Code. Remote Control cần login subscription claude.ai; auth bằng API key hoặc Console không tạo được remote session.
Dùng Codex app-server làm host process. ChatGPT identity lo remote relay; CLIProxyAPI/CCS chỉ đổi route của model call.
Check phần này trước khi debug QR code hoặc session không hiện.
Chọn một cách. Đây là các lựa chọn thay thế, không phải các bước chạy cùng nhau.
Phù hợp khi muốn server dùng lại với URL và QR code.
claude remote-control Mở Claude Code session mới kèm remote ngay.
claude --remote-control "My Project" Gõ trong màn hình Claude Code đang mở.
/remote-control
# or:
/rc Mở /config trong Claude Code, rồi bật remote control cho session sau.
/config
# Set: remoteControl: true Codex app-server là tiến trình chạy ở máy local để các client kết nối vào, đảm nhiệm xác thực, trạng thái hội thoại, phê duyệt và luồng sự kiện từ agent. Remote Control khởi chạy tiến trình host này, rồi thiết bị từ xa điều khiển nó qua ChatGPT identity.
Standalone binary khởi chạy daemon. Toàn bộ file local, shell, tools, plugins và credentials đều lấy từ host này.
OAuth của ChatGPT/OpenAI cấp quyền cho thiết bị từ xa và workspace, tách biệt với provider routing.
-c model_provider chỉ đổi model call đi đâu sau khi app-server đã chạy. CLIProxyAPI/CCS nằm ở tầng này.
Cài standalone Codex một lần, rồi chọn flow khởi chạy: OAuth mặc định, hoặc đi qua CLIProxyAPI/CCS khi cần shared routing và quản lý account pool.
Chạy installer của ChatGPT một lần. Cả hai case bên dưới đều dùng chung binary tại ~/.codex/packages/standalone/current/codex.
curl -fsSL https://chatgpt.com/codex/install.sh | sh Remote Control cần session ChatGPT/OpenAI OAuth trước. CLIProxyAPI chỉ đổi route model; nó không thay thế ChatGPT identity dùng để authorize điện thoại và host.
~/.codex/packages/standalone/current/codex login Dùng cùng ChatGPT account và workspace, rồi mở tab Codex. Nếu chưa thấy tab Codex, update app ChatGPT trước.
Khi ChatGPT hỏi có cho điện thoại này truy cập Codex trên máy tính không, bấm nút ủy quyền. Đây là bước handoff thiết bị như prompt trên mobile.
Sau khi ủy quyền, ChatGPT có thể hiện spinner thiết lập an toàn. Chờ tới khi host/session Codex xuất hiện rồi mới gửi prompt từ xa.
Giữ host awake và online. File, tools, credentials, sandboxing và approvals vẫn lấy từ host đã connect; điện thoại chỉ gửi prompt và nhận session update.
Chỉ chạy một trong hai case bên dưới.
Chọn case này khi đã login ChatGPT/OpenAI OAuth và không cần CCS model routing.
~/.codex/packages/standalone/current/codex remote-control start --json Chọn case này khi CCS/CLIProxyAPI đang healthy, muốn có account rotation, quota visibility hoặc failover phía sau remote session.
~/.codex/packages/standalone/current/codex remote-control start \
-c 'model_provider="cliproxy"' \
-c 'model="gpt-5.5"' \
--json Các lỗi hay gặp khi chạy remote-control start , kèm bước kiểm tra binary có expose đúng command không.
Trước khi dùng bất kỳ case nào, confirm standalone binary expose remote-control start / remote-control stop , output --json, và -c config override.
remote-control start quản lý app-server daemon. -c override được parse như TOML, nên có thể truyền model_provider và model theo từng lần start. Nếu remote-control start báo Remote control is enabled on <device> but the connection is errored , nghĩa là phía cloud vẫn nhớ enrollment cho máy này nhưng WebSocket lần trước của app-server đã chết (mạng chập, daemon bị kill, socket cũ kẹt). Stop daemon local để clear state trước, rồi start lại. Nếu vẫn lỗi, vào ChatGPT → Remote Control settings tắt thiết bị rồi thử lại.
~/.codex/packages/standalone/current/codex remote-control stop
~/.codex/packages/standalone/current/codex remote-control start --json Nếu start fail với app server did not become ready ở app-server-control.sock , nghĩa là managed daemon chưa tạo control socket kịp, hoặc state daemon cũ bị kẹt. Check version/status của daemon, stop nó, rồi chạy lại đúng start command đã chọn ở trên.
~/.codex/packages/standalone/current/codex app-server daemon version
~/.codex/packages/standalone/current/codex app-server daemon stop
# Then rerun the same remote-control start command you picked above. Last resort — chỉ dùng khi standalone Codex báo token_revoked hoặc refresh_token_reused . Reset OAuth rồi chạy lại remote-control start .
~/.codex/packages/standalone/current/codex logout
~/.codex/packages/standalone/current/codex login Phần Claude và Codex ở trên đã tóm tắt các điểm cần chú ý. Muốn đọc kỹ hơn thì xem thêm official docs bên dưới.