Muxile is a tmux plugin that provides mobile web access to your running tmux sessions. It creates a secure WebSocket tunnel through Cloudflare Workers, allowing you to monitor and control your terminal from any device with a web browser.
When running long-duration Claude Code tasks (multi-step refactoring, data processing, batch operations), you can:
- Monitor progress from your phone without interrupting
- Send follow-up commands or ask clarifying questions remotely
- Share links with teammates to collaboratively debug issues
- Receive actionable Discord notifications with direct session links
- Keep working if your SSH connection drops
The .claude/hooks/discord-notify.sh script automatically:
- Detects when Claude Code is running in a tmux session
- Generates a Muxile shareable link:
muxile://open?session=<session-name> - Embeds the link in Discord notifications with a "Resume Session" button
- Allows team members to jump directly into your session from Slack/Discord
Example notification:
đź”” Claude Code Stopped
Description: Task completed successfully
Project: cloud
Resume Session: [claude-work] (clickable link)
# macOS
brew install tmux
# Linux
sudo apt install tmux# macOS
brew install qrencode jq
cargo install websocat
# Ubuntu/Debian
sudo apt install qrencode jq
# websocat may need cargo installOption A: Using TPM (Recommended)
Add to ~/.tmux.conf:
set -g @plugin 'bjesus/muxile'
run '~/.tmux/tpm/tpm'Then press Ctrl+b then I to install.
Option B: Manual
git clone https://github.com/bjesus/muxile.git ~/.tmux/plugins/muxile
echo "run '~/.tmux/plugins/muxile/muxile.tmux'" >> ~/.tmux.confAdd to ~/.tmux.conf:
set -g @muxile-port 8888 # Custom port (default: random)
set -g @muxile-host localhost # Set hostname# Create named tmux session
tmux new-session -s claude-work
# Navigate to project
cd /path/to/cloud
# Start Claude Code
claude
# Start a task...# In the tmux session, press:
# prefix + Shift+T (typically: Ctrl+b then Shift+T)
# A QR code and shareable link will appear:
# muxile://open?session=claude-work
# https://muxile.github.io/#<token>- Scan the QR code with your phone camera
- Open the link in your browser
- See your tmux pane content
- Type commands in the input field
- Commands execute in real-time
# Press Ctrl+C to exit QR code view
# Press prefix + Shift+T again to disable sharingThe hook automatically detects your tmux session and includes the Muxile link. No manual configuration needed!
To verify the hook is active:
ls -la .claude/hooks/
# Should see: discord-notify.sh# 1. Start long task in tmux
tmux new-session -s work
cd ~/project
claude
# 2. Start a refactoring task
# "Refactor the authentication system"
# 3. Get to a good checkpoint, then detach
# Press: Ctrl+b then d
# 4. From your phone, view progress via Muxile QR code
# (ask Claude Code to pause if needed)
# 5. Later, reattach from any device
tmux attach-session -t work# Window 1: Claude Code task
tmux new-window -t work
cd ~/project && claude
# Window 2: Build logs
tmux new-window -t work
tail -f build.log
# Window 3: Tests
tmux new-window -t work
go test -v ./...
# Share the main Muxile session, cycle through windows on mobileFor full remote access from anywhere:
# On remote device
tailscale up
ssh user@<your-tailscale-ip>
# Attach to your session
tmux attach-session -t workCheck if qrencode is installed:
which qrencode
# If missing:
brew install qrencode # macOS
sudo apt install qrencode # LinuxVerify tmux session exists:
tmux ls
# Create if missing:
tmux new-session -s claudeUse mosh instead for unstable networks:
brew install mosh
mosh user@hostnameMuxile uses Cloudflare Workers with a 5-minute timeout. For longer sessions:
- Use SSH + tmux attach for unlimited time
- Reconnect to Muxile QR code periodically
- Name your sessions clearly:
tmux new-session -s claude-alerts-feature - Use meaningful tmux windows: Separate Claude Code, logs, and tests
- Share carefully: Muxile links expose your terminal—use with trusted teammates only
- Monitor Discord hooks: Check that notifications are reaching your team channel
- Detach cleanly: Use
Ctrl+bthendrather than killing terminals