Remote Access
Monitor Claude Code sessions from anywhere using secure Cloudflare Tunnels.Overview
Cloudflare Tunnel creates secure, temporary public URLs for local Claude Code dashboards:- Analytics Dashboard - Real-time session monitoring
- Chat Interface - Mobile-optimized conversation viewer
- 2025 Year in Review - Usage statistics dashboard
Tunnels are temporary and private - they expire when you close the dashboard and require the full URL to access.
Setup
Install Cloudflared
- macOS
- Windows
- Linux
Using Remote Access
Analytics Dashboard
Launch analytics with remote access:trycloudflare.com URL to access from:
- Mobile devices
- Remote machines
- Team members (temporary access)
Chat Interface
Mobile-optimized chat viewer with tunnel:2025 Year in Review
Share your usage statistics:How It Works
Tunnel Architecture
Cloudflare Tunnel creates a secure connection:- No port forwarding required
- No firewall changes needed
- Automatic HTTPS with valid certificates
- WebSocket support for real-time updates
Implementation
The tunnel launcher (fromsrc/analytics.js and src/chats-mobile.js):
URL Format
Tunnel URLs follow the pattern:https://abc-def-ghi.trycloudflare.comhttps://xyz-123-abc.trycloudflare.comhttps://quick-fire-light.trycloudflare.com
Mobile Access
Access dashboards from your phone or tablet:1
Start Dashboard with Tunnel
2
Copy Tunnel URL
3
Open on Mobile
- Send URL to yourself (Slack, email, SMS)
- Scan QR code (if using
--qrflag) - Type URL directly in mobile browser
Mobile Optimization
The chat interface is optimized for mobile:- Responsive layouts
- Touch-optimized controls
- Swipe gestures
- Auto-scrolling conversations
Security
Tunnel Privacy
Free Cloudflare Tunnels are:
- Private (require full random URL)
- Temporary (expire when you close the tunnel)
- Not indexed by search engines
- Not guessable (URLs have high entropy)
Best Practices
DO:- β Use tunnels for temporary access
- β Share URLs through private channels (Slack DM, encrypted email)
- β
Close tunnel when done (
Ctrl+Cin terminal) - β
Use local access (
localhost) when possible
- β Share tunnel URLs publicly
- β Post tunnel URLs on social media
- β Leave tunnels running indefinitely
- β Use tunnels for sensitive production data
Protecting Sensitive Data
If dashboards show sensitive information:Advanced Usage
Custom Tunnel Configuration
Cloudflared supports additional options:src/analytics.js to add custom flags:
Persistent Named Tunnels
For longer-term access, create a named tunnel:- Consistent URL
- Custom domain
- Access control
- Load balancing
Named tunnels require a Cloudflare account and domain. Free tier is sufficient for personal use.
Tunnel Monitoring
Monitor tunnel status:Troubleshooting
Tunnel Not Starting
- Install cloudflared (see Setup section)
- Add to PATH:
- Use full path in scripts
No Tunnel URL Displayed
Tunnel Disconnects Frequently
Causes:- Network instability
- Firewall blocking WebSocket connections
- ISP restrictions
WebSocket Errors
Alternatives to Tunnels
SSH Port Forwarding
For secure remote access without Cloudflare:VPN Access
Access via VPN:ngrok Alternative
Similar tunnel service:Examples
Monitor from Mobile While Coding
Share Demo with Team
Remote Debugging
Performance Considerations
Latency
Cloudflare Tunnel adds minimal latency:- Local: Less than 1ms
- Tunnel: 10-50ms (depending on location)
- WebSocket: Real-time updates still feel instant
Bandwidth
Analytics dashboard bandwidth usage:- Initial load: ~500KB (HTML, CSS, JS)
- WebSocket updates: ~1-5KB per message
- Polling: ~10KB per refresh
Scaling
Free tunnels support:- Unlimited bandwidth
- 100+ concurrent connections
- WebSocket connections
Next Steps
Creating Components
Build custom agents, commands, and MCPs
Sandbox Execution
Run Claude Code in isolated environments