
Moshi Best Practices
Prepare or verify any Linux/macOS host so Moshi remote coding works—Easy Pair, Mosh/SSH PATH, tmux sessions, and moshi-hook for Claude Code or Codex.
Overview
Moshi Best Practices is an agent skill most often used in Build (also Operate infra, Ship launch prep) that prepares and verifies hosts for Moshi remote coding with tmux, hooks, and Easy Pair.
Install
npx skills add https://github.com/rjyo/moshi-skill --skill moshi-best-practicesWhat is this skill?
- Inspect-before-edit workflow with verified outcomes after every config change
- Easy Pair via `moshi-hook host setup` and QR scan—preferred over manual SSH wiring
- tmux project sessions rooted at a directory using packaged `moshi DIR` launcher
- `MOSHI_CLIENT` env signal for adapting shell/tmux behavior per client
- Explicit rule: do not install legacy `moshi` shell helper—`moshi` symlinks to `moshi-hook`
Adoption & trust: 1.7k installs on skills.sh; 20 GitHub stars; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want to drive Claude Code or Codex on a remote box from Moshi but PATH, tmux, SSH/Mosh, or hooks are half-configured and sessions break silently.
Who is it for?
Indie devs standardizing one or two personal servers for Moshi + tmux + agent CLI workflows.
Skip if: Teams on pure local-only IDEs with no remote shell, or hosts where you cannot edit shell/tmux config.
When should I use this skill?
Preparing or verifying a host for Moshi—Easy Pair, SSH/Mosh, tmux, `moshi DIR`, `MOSHI_CLIENT`, or moshi-hook for Claude Code/Codex.
What do I get? / Deliverables
The host passes Moshi readiness checks with a tmux project session, working hooks, and verified shell behavior so phone-side pairing and agent runs stay reliable.
- Verified host readiness checklist outcome
- tmux project session with Moshi launcher at chosen directory
- Installed and tested agent hooks for Claude Code or Codex CLI
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Remote agent coding hosts are first stood up during Build when you wire your editor and CLI agents to real project directories. Agent-tooling is the canonical shelf for Moshi-specific tmux launchers, hooks, and client env signals—not generic dotfile trivia.
Where it fits
Spin up a tmux session at repo root with `moshi DIR` before your first Claude Code task from a phone.
Re-audit PATH and tmux defaults after a distro upgrade breaks Moshi non-interactive shells.
Verify hooks and Mosh readiness right before a time-sensitive release fix from mobile.
How it compares
Operational host checklist for Moshi—not generic SSH hardening or a cloud PaaS deploy skill.
Common Questions / FAQ
Who is moshi-best-practices for?
Solo builders using Moshi to remote-control Claude Code or Codex on a dedicated dev machine or VPS.
When should I use moshi-best-practices?
At first Moshi install on a new host, when verifying an existing Easy Pair setup, before a launch push from mobile, or when fixing tmux/PATH issues during daily Operate sessions.
Is moshi-best-practices safe to install?
It instructs shell and tmux changes—review the Security Audits panel on this page and diff config edits before applying on production servers.
SKILL.md
READMESKILL.md - Moshi Best Practices
interface: display_name: "Moshi Best Practices" short_description: "Prepare or verify a host for Moshi." default_prompt: "Use $moshi-best-practices to prepare or verify a host for Moshi, configure tmux, create a tmux project session with the packaged `moshi DIR` launcher, and set up moshi-hook." --- name: moshi-best-practices description: Use when preparing or verifying a host for Moshi remote coding. Trigger this for Easy Pair host setup, SSH or preferably Mosh readiness, non-interactive shell PATH issues, tmux defaults, creating a tmux project session rooted at a chosen directory, adapting shell or tmux behavior with the `MOSHI_CLIENT` env signal, installing Moshi agent hooks for Claude Code or Codex CLI, or using the packaged `moshi DIR` tmux launcher. metadata: updatedAt: "2026-05-13" --- # Moshi Best Practices Use this skill to make any host feel easy to use from Moshi. Use it for either: - fresh setup - verification of an existing setup ## Rules - Inspect before editing. - Prefer direct config edits over platform-specific setup scripts. - Verify every outcome after changing it. - Do not install the old `moshi` shell helper or alias. Current installs provide `moshi` as a symlink to `moshi-hook`. ## 1. Host Readiness For a fresh Moshi SSH/Mosh setup, prefer **Easy Pair** when `moshi-hook` is available: ```bash moshi-hook host setup ``` Tell the user to scan the Easy Pair QR from Moshi. This creates the saved host connection, generates the phone-side private key, and installs Moshi's public key on the host. Call out the security boundary: anyone who scans the QR before it expires can claim SSH access to the host, so they should not share the screen or setup link. Do not confuse Easy Pair with `moshi-hook pair --token`; token pairing is only for agent hooks, inbox, Live Activities, and Apple Watch events. Target outcome: - preferred transport is Mosh plus tmux; fallback is SSH plus tmux - the host has a working SSH entry point - `tmux` is installed - `mosh-server` is installed when the user wants Mosh, otherwise SSH plus tmux is acceptable - both resolve in the current shell and in the login shell's non-interactive mode - at least one tmux session exists so the Moshi selector can appear. Inspect with a small set of real checks. Keep OS-specific mechanics minimal, but do not skip verification. Useful checks: ```bash command -v tmux || true command -v mosh-server || true tmux list-sessions 2>/dev/null || true LOGIN_SHELL="${SHELL:-/bin/sh}" "$LOGIN_SHELL" -c 'command -v tmux' "$LOGIN_SHELL" -c 'command -v mosh-server' ``` Useful macOS-specific checks when relevant: ```bash dscl . -read "/Users/$USER" UserShell systemsetup -getremotelogin || true ``` Verify after changes: ```bash command -v tmux tmux list-sessions "$LOGIN_SHELL" -c 'command -v tmux' "$LOGIN_SHELL" -c 'command -v mosh-server' || true ``` Then ask the user to reconnect from Moshi. Expected result: the tmux selector appears, and the transport can use Mosh instead of plain SSH when configured. ## 2. tmux Environment Use these defaults unless the user wants something different: ```tmux set -g history-limit 100000 set -g mouse on set -g set-titles on set -g set-titles-string "#I: #W" set -g base-index 1 setw -g pane-base-index 1 set -g renumber-windows on ``` Workflow: - inspect the existing tmux config - update overlapping settings instead of appending duplicates - reload tmux after editing ## 3. MOSHI_CLIENT Signal `MOSHI_CLIENT=1` is an opt-in environment variable the Moshi iOS client exports into the remote shell so rc files, prompts, and tmux configs can detect a Moshi-launched session and adapt. The user enables it in the app under **Settings → Integrations → Export ENV** (off by default). When on, it is set identically on both the Mosh path (via `mosh-server -l MOSHI_CLIENT=1`) and the SSH fallback (via an injected `export` at shell start). The main use case is protecting Moshi's swipe-to-change-window gesture, which reli