Summary

A step-by-step guide to running Claude Code on a phone in under five minutes by remixing a preconfigured Replit template, setting the CLAUDE_CONFIG_DIR secret, authenticating Claude via copy-pasted URL, and then opening the same cloud sandbox from the Replit mobile app. Because the environment runs on a remote server, the desktop and mobile sessions stay in sync (“multiplayer”), and credentials persist in a git-ignored .claude-user directory.

一份在五分鐘內讓 Claude Code 跑在手機上的教學:在 Replit 上 remix 預先配置好的模板,設定 CLAUDE_CONFIG_DIR 密鑰,透過複製貼上網址完成 Claude 授權,再用 Replit 手機 App 開啟同一個雲端沙盒。由於環境跑在遠端伺服器,桌面與手機共享同一即時環境,憑證則持久化在被 git 忽略的 .claude-user 目錄中。

Key Points

  • Prerequisites: an Anthropic subscription/API key and a Replit account; start setup on a laptop.
  • Set the secret CLAUDE_CONFIG_DIR to /home/runner/workspace/.claude-user so credentials persist across environment restarts.
  • Authorize by copy-pasting the URL from the terminal rather than clicking the authorize link directly.
  • The Replit sandbox is a cloud container; the same environment renders in real time on multiple devices (“multiplayer”).
  • Skills, plugins, MCP servers, and Hooks can be installed as normal once Claude Code is running.
  • Security caveat: never make the app public without deleting the .claude-user directory holding credentials.

Insights

The trick here is not Claude Code itself but using Replit’s persistent cloud sandbox as a remote host — the phone is just a thin client viewing a shared container. This sidesteps the lack of a native mobile terminal and means any Replit app with Claude Code installed becomes a phone-accessible agent. The credential persistence detail (config dir as a Replit secret) is the load-bearing piece that makes restarts survivable.

Connections

Raw Excerpt

Opening Replit on your phone loaded the same virtual environment as the one running on your laptop. That’s because the environment is running on a remote server in the cloud.