remote-access
ttyd + Tailscale for mobile terminal access
What this skill does
# Infra Remote Access
> Access Claude Code from your phone via ttyd + Tailscale
## When to use
- "I want to use my phone"
- "remote access"
- "mobile access"
- Setting up a new device
## Components
| Tool | Purpose |
|------|---------|
| **ttyd** | Web terminal (browser access to shell) |
| **Tailscale** | Private VPN network (secure connection) |
## Installation
```bash
# Mac
brew install ttyd tailscale
```
On phone:
- iOS: App Store → Tailscale
- Android: Google Play → Tailscale
---
## IMPORTANT: Tailscale on Mac
Tailscale via brew **requires sudo** for VPN tunnel. There are two options:
### Option 1: Mac App Store (recommended)
Download Tailscale from Mac App Store -- it has all permissions and persists the session.
```bash
# Check status
tailscale status
tailscale ip -4
```
### Option 2: Userspace mode (without sudo)
If using brew version and no sudo:
```bash
# Stop brew service
brew services stop tailscale
# Start in userspace mode
/usr/local/opt/tailscale/bin/tailscaled --tun=userspace-networking --state=/tmp/tailscale.state --socket=/tmp/tailscaled.sock &
# Connect (NOTE: different socket!)
tailscale --socket=/tmp/tailscaled.sock up
# Check status
tailscale --socket=/tmp/tailscaled.sock status
tailscale --socket=/tmp/tailscaled.sock ip -4
```
**Downsides of userspace mode:**
- New session = requires browser authorization
- Must specify `--socket=/tmp/tailscaled.sock` in every command
- Does not work as a full VPN (Tailscale traffic only)
---
## Setup
### Step 1: Tailscale
```bash
# If Mac App Store version:
tailscale up
tailscale ip -4
# Example: 100.x.x.x
# If userspace mode:
tailscale --socket=/tmp/tailscaled.sock up
# Open the authorization URL in browser
tailscale --socket=/tmp/tailscaled.sock ip -4
```
On phone:
1. Install Tailscale from App Store / Play Store
2. Log in with the same account
3. Ensure both devices are online in `tailscale status`
### Step 2: ttyd
```bash
# Stop if already running
pkill ttyd
# Basic launch
ttyd -W -p 7681 bash
# For Claude Code directly
ttyd -W -p 7681 claude
# With authorization (recommended for security)
ttyd -c user:password -W -p 7681 claude
```
**Parameters:**
- `-W` -- allow write (input) -- REQUIRED
- `-p 7681` -- port
- `-c user:pass` -- Basic Auth
### Step 3: Access from phone
On phone, open in browser:
```
http://<tailscale-ip>:7681
```
Example:
```
http://100.x.x.x:7681
```
---
## Quick Start (copy-paste)
```bash
# 1. Check/start Tailscale
tailscale status || tailscale up
TSIP=$(tailscale ip -4)
echo "Tailscale IP: $TSIP"
# 2. Start ttyd
pkill ttyd 2>/dev/null
ttyd -W -p 7681 bash &
# 3. Done!
echo "Open on phone: http://$TSIP:7681"
```
---
## Auto-start ttyd
```bash
mkdir -p ~/Library/LaunchAgents
cat > ~/Library/LaunchAgents/com.ttyd.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.ttyd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/ttyd</string>
<string>-W</string>
<string>-p</string>
<string>7681</string>
<string>bash</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
EOF
launchctl load ~/Library/LaunchAgents/com.ttyd.plist
```
---
## Status check
```bash
# Tailscale
tailscale status
# or for userspace:
tailscale --socket=/tmp/tailscaled.sock status
# ttyd process
pgrep -l ttyd
# Port
lsof -i :7681
```
---
## Troubleshooting
| Problem | Solution |
|---------|----------|
| `tailscaled requires root` | Use userspace mode or Mac App Store version |
| `failed to connect to local tailscaled` | Restart: `brew services restart tailscale` or start userspace mode |
| Phone cannot see Mac | Check `tailscale status` -- both must be online |
| ttyd not connecting | Check `pgrep ttyd`, restart |
| Port occupied | `lsof -i :7681`, change port to `-p 7682` |
| No input in terminal | Add `-W` parameter |
| New Tailscale authorization | Open URL in browser, log in |
---
## Security
- Tailscale encrypts all traffic (WireGuard)
- ttyd is accessible only via Tailscale IP (not public)
- Additionally -- Basic Auth: `-c user:password`
- Do not use on public IP!
---
## Current configuration
```
Mac IP: 100.x.x.x
ttyd port: 7681
URL: http://100.x.x.x:7681
```
---
## Related skills
- `google-auth` -- if you need Google API from phone
- `telegram-session` -- Telegram from phone
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.