You may be running inside thop, a terminal session manager that lets you seamlessly work across local and remote SSH servers.
echo $THOP_SESSIONIf this outputs a session name (like local, prod, dev), you're in thop.
- Execute commands on local machine
- Connect to remote SSH servers
- Switch between sessions instantly
- Copy files between local and remote
- Each session keeps its own directory and environment
/statusShows all sessions, which is active (marked with *), and their connection status.
/connect prod # Connect to prod server
/switch dev # Switch to dev server
/local # Switch to local/copy local:file.txt prod:/app/ # Local to remote
/copy prod:/etc/nginx/nginx.conf local:/ # Remote to local/read /path/to/file # Read file from current session
/env VAR=value # Set environment variable (persists)
/bg npm run build # Run command in background
/jobs # List background jobs
/shell vim config.yaml # Interactive command (vim, top, etc.)User asks: "Deploy the latest code to production"
# Check what's available
/status
# Connect to production
/connect prod
# Deploy
cd /var/www/app
git pull origin main
npm install
npm run build
sudo systemctl restart app
# Verify
curl http://localhost:8080/health
# Return to local
/local| Task | Command |
|---|---|
| See sessions | /status |
| Connect to server | /connect prod |
| Switch session | /switch dev |
| Back to local | /local |
| Copy file | /copy local:file remote:/path/ |
| Set env var | /env NODE_ENV=prod |
| Background job | /bg long-command |
| Interactive cmd | /shell vim file |
- Always check
/statusfirst - Know what's available - Return to
/localwhen done - Clean workflow - Use
/copynotscp- Simpler and uses existing connection - Use
/envnotexport- Persists in session state - Verify before destructive commands - Check
$THOP_SESSIONbeforerm -rf - Tell the user what you're doing - Announce session switches
If connection fails:
/connect prod
# Error: AUTH_KEY_FAILED → User needs to run: /auth prod
/connect newserver
# Error: HOST_KEY_UNKNOWN → User needs to run: /trust newserver/status
/connect prod
tail -100 /var/log/app/error.log
# ... investigate ...
/local/copy dev:/etc/app/config.yaml local:/tmp/dev-config
/copy prod:/etc/app/config.yaml local:/tmp/prod-config
/local
diff /tmp/dev-config /tmp/prod-config/connect staging
cd /app && git pull && npm run build && sudo systemctl restart app
/switch prod
cd /app && git pull && npm run build && sudo systemctl restart app
/localRemember: thop keeps track of directories and environment per session. When you /switch, you're instantly in that server's context. This is your superpower for multi-server workflows.