Skip to main content

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

Verify installation:

Using Remote Access

Analytics Dashboard

Launch analytics with remote access:
Output:
Share the trycloudflare.com URL to access from:
  • Mobile devices
  • Remote machines
  • Team members (temporary access)

Chat Interface

Mobile-optimized chat viewer with tunnel:
Output:
The remote URL opens automatically in your default browser.

2025 Year in Review

Share your usage statistics:

How It Works

Tunnel Architecture

Cloudflare Tunnel creates a secure connection:
Key features:
  • No port forwarding required
  • No firewall changes needed
  • Automatic HTTPS with valid certificates
  • WebSocket support for real-time updates

Implementation

The tunnel launcher (from src/analytics.js and src/chats-mobile.js):

URL Format

Tunnel URLs follow the pattern:
Examples:
  • https://abc-def-ghi.trycloudflare.com
  • https://xyz-123-abc.trycloudflare.com
  • https://quick-fire-light.trycloudflare.com
Tunnel URLs are randomly generated each time. Don’t bookmark them - they won’t work after the tunnel closes.

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 --qr flag)
  • Type URL directly in mobile browser

Mobile Optimization

The chat interface is optimized for mobile:
Mobile features:
  • 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)
However, anyone with the URL can access the dashboard while the tunnel is active.

Best Practices

DO:
  • βœ… Use tunnels for temporary access
  • βœ… Share URLs through private channels (Slack DM, encrypted email)
  • βœ… Close tunnel when done (Ctrl+C in terminal)
  • βœ… Use local access (localhost) when possible
DON’T:
  • ❌ 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:
Modify the launcher in src/analytics.js to add custom flags:

Persistent Named Tunnels

For longer-term access, create a named tunnel:
Benefits:
  • 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

Solutions:
  1. Install cloudflared (see Setup section)
  2. Add to PATH:
  3. Use full path in scripts

No Tunnel URL Displayed

Debugging:

Tunnel Disconnects Frequently

Causes:
  • Network instability
  • Firewall blocking WebSocket connections
  • ISP restrictions
Solutions:

WebSocket Errors

Cloudflare Tunnel supports WebSocket by default, but check:

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
For higher traffic, consider named tunnels with load balancing.

Next Steps

Creating Components

Build custom agents, commands, and MCPs

Sandbox Execution

Run Claude Code in isolated environments