- The OpenClaw core requires an API Key, which is expensive.
- Use OAuth? Claude refuses to provide OAuth access to third-party software.
- The official Claude Code App is only available to Max subscription users.
TFClaw is a “terminal-oriented remote desktop” MVP, with a companion mobile app service that allows users to start a command line session anytime from their phone to complete coding tasks.
- The core does not provide Agent services and requires no token. You can directly start your own agent inside the terminal and reuse mature CLI context management.
- Claude Code doesn’t let you use Claw? Just remotely launch the official Claude Code inside your own terminal.
- Open-source mobile app (currently Android only) connects to a remote terminal, enabling anyone to use Claude Code from their phone.
server– Handles forwarding and state caching (sessions organized by token).terminal-agent– Runs on the user’s PC/server, manages multiple terminals, and reports output. Controlled via tmux.gateway(located atapps/feishu-gateway, currently Feishu only) – Manages Chat Apps and maps messages to terminal commands.mobile(Android first) – Displays terminal list/output and sends commands (including control keys like Ctrl+D).
- Associate mobile/Feishu clients with
terminal-agentviatoken.
- Create new terminal
- Close terminal
- Write input (supports
__CTRL_C__,__CTRL_D__,__ENTER__) - Real-time stdout/stderr streaming
- Screenshot source listing (screen + Windows windows)
- Screenshot by
sourceId(returns base64 image)
- Agent/client role authentication (query token)
- Terminal state and output snapshot caching
- Command forwarding and basic ACK
/tmux help– View all supported commands/tmux status|sessions|panes|new|target|close|socket|lines|wait|stream|capture|key|send/tmux fileget <path>and/tfileget <path>– Download a file from agent and send it back to Feishu/t<subcommand>alias (e.g.,/tkey,/ttarget,/tcapture)/passthrough on|off|statusand/pt on|off|status- Passthrough mode: normal messages continuously sent to tmux until
/pt off /capturereturns screen/window ID list; reply with number to receive image- Streaming output auto-pushes progress updates and recalls previous progress message upon new Feishu message (prevents stacking)
- Adds reaction (default
OnIt) to user message before processing - Supports Feishu file message upload to agent (chunked transfer)
- For Feishu file upload and
/tmux filegetrelative paths, gateway binds to currenttmux targetpane path; falls back totfclaw-filesroot if target path is unavailable - For Feishu file message and
/tmux filegetcommand, reaction is sent first before processing
Supports most /tmux and /passthrough commands via buttons:
- Connect to relay
- View and switch terminal list
- View output, send commands, use shortcut keys
- Create/close terminal
- Trigger screenshot and display latest image (Windows agent only) (use
/capturecommand and choose the window id)
These commands are consistent across Feishu, mobile, and local terminal test flows:
/tmux help
/tmux status
/tmux sessions
/tmux panes [session]
/tmux new [session]
/tmux target <session:window.pane|id>
/tmux close <id|session:window.pane>
/tmux socket <path|default>
/tmux lines <20-5000>
/tmux wait <0-5000>
/tmux stream <auto|on|off>
/tmux capture [lines]
/tmux key <key...>
/tmux send <literal command>
/passthrough on|off|status
/pt on|off|status
/t<subcommand> Alias for /tmux subcommands (e.g., /tkey /ttarget /tcapture)
-
/tmux helpDisplays overview of tmux control commands. -
/tmux statusShows current control state:passthrough,target,socket,capture_lines,wait_ms,stream_mode. -
/tmux sessionsLists visible sessions in current tmux server. -
/tmux panes [session]Lists panes and returns IDs ([1] [2] ...). Optional[session]filters by session. Each pane includestarget/window/cmd/activity. -
/tmux new [session]Creates new tmux session (defaulttfclaw). Automatically sets target to${session}:0.0. -
/tmux target <session:window.pane|id>Switches target pane (by full target or ID). Returns latest capture after switching. -
/tmux close <id|session:window.pane>Closes pane/window. Clears current target if it was closed. -
/tmux socket <path|default>Switches tmux socket.defaultrestores default socket. -
/tmux lines <20-5000>Sets capture line limit (range enforced). -
/tmux wait <0-5000>Sets delay (ms) before capturing output after sending command. -
/tmux stream <auto|on|off>auto: auto-enable streaming for long taskson: force streamingoff: disable streaming
-
/tmux capture [lines]Captures current screen content. -
/tmux key <key...>Sends key sequence (e.g.,Enter,Esc,Ctrl+C,^C). -
/tmux send <literal command>Sends literal command and executes with Enter.
/passthrough onenables continuous passthrough to tmux.- If no target is set, defaults to
tfclaw:0.0. - Control commands remain locally parsed.
- To force-send a slash command to tmux, prefix with
//(e.g.,//tmux list-sessions).
apps/
server/
terminal-agent/
mobile/
feishu-gateway/
packages/
protocol/
From project root:
npm installnpm run build- Create an app in Feishu Open Platform and enable Bot.
- Add permission:
im:message - (Optional) Add message recall permission for dynamic output simulation.
- Copy
config.example.json→config.jsonand fill in credentials. - Start full stack (build + server + agent + gateway):
Default: ws://0.0.0.0:8787
npm run start:stackDev mode:
npm run dev:stack- Enable Long Connection in Feishu event subscription.
- Add event
im.message.receive_v1. - Send message to bot.
See: https://github.com/yxzwang/TFClaw/blob/main/dockerdeployReadMe.md
./scripts/deploy-docker-public.sh startLog will show:
TFCLAW_TOKEN=xxxxxxxxx
TFCLAW_RELAY_URL=wss://xxxxxxxxxx.com
Use these to log in on mobile app.
登录界面如下,最上面的A 50%可以点击切换比例,右边可以手动输入比例。
登陆后连接状态指示灯变绿,点击最上面ignore可以将terminal显示全屏:
./scripts/deploy-docker-public.sh status./scripts/deploy-docker-public.sh stopNote:
- First startup generates random token.
- Subsequent restarts reuse token.
- URL is regenerated each time.
See apps/mobile/README.md.
Use EAS to build preview APK.
Release demo is published; you can build yourself if preferred.
apps/server/.env.exampleapps/terminal-agent/.env.exampleapps/mobile/.env.exampleapps/feishu-gateway/.env.exampleconfig.example.json
Gateway additional:
TFCLAW_CONFIG_PATH=/path/to/config.json
gateway
TFCLAW_COMMAND_RESULT_TIMEOUT_MS(default 24h)TFCLAW_PROGRESS_RECALL_DELAY_MS(default 350ms)TFCLAW_FEISHU_ACK_REACTION_ENABLED(default 1)TFCLAW_FEISHU_ACK_REACTION(defaultOnIt)
terminal-agent
TFCLAW_TMUX_SUBMIT_DELAY_MS(default 60ms)TFCLAW_TMUX_STREAM_POLL_MS(default 350ms)TFCLAW_TMUX_STREAM_IDLE_MS(default 3000ms)TFCLAW_TMUX_STREAM_INITIAL_SILENCE_MS(default 12000ms)TFCLAW_TMUX_STREAM_WINDOW_MS(default 24h)
Recommended architecture:
- Expose only
443 - Use reverse proxy (Nginx/Caddy/Traefik/Cloudflare Tunnel)
- Proxy to local
server(e.g.,127.0.0.1:8787)
-
Enable TLS (
wss://only). -
Use strong token (32+ random chars), rotate regularly.
-
Enable restrictions in
apps/server:RELAY_ENFORCE_STRONG_TOKEN=trueRELAY_ALLOWED_TOKENS=<comma-separated tokens>RELAY_ALLOWED_ORIGINS=<comma-separated origins>
-
Firewall: allow only reverse proxy to access relay port.
-
Use process manager (systemd/pm2/docker restart policy) with logging and monitoring.
- Feishu dynamic window tracking does not maintain expected 24h persistence (cause unknown). Use
/tcapturemanually if needed. - Window enumeration/screenshot only supported on Windows agent; Linux/macOS support screen capture only.
- Mobile app requires public server exposure — pay attention to security.

