Prerequisites
You need at least one AI agent CLI installed:Don’t have an AI agent CLI? Install Claude Code with:
Installation
Install HAPI
Choose your preferred installation method:
Tip: Use the official npm registry for global install. Some mirrors may not sync platform packages in time.
Start the Hub
Run the hub with the public relay for instant remote access:You’ll see output like this:
The
--relay flag enables end-to-end encrypted remote access via WireGuard + TLS. Your data is encrypted from your device to your machine—the relay only forwards packets it cannot read.Start a Session
Open a new terminal and start your first coding session:This starts a Claude Code session wrapped with HAPI. You’ll see the familiar Claude Code interface:Your session is now active and visible in the web UI.
Access from Your Phone
Three ways to access:Option 1: Scan QR CodeUse your phone’s camera to scan the QR code displayed in the hub terminal.Option 2: Open URLVisit the remote URL shown in the hub output (e.g.,
Login: Enter the access token when prompted. It’s saved in
https://abc123.relay.hapi.run).Option 3: Copy to PhoneSend the URL to yourself via text/email/Slack and open it.Login: Enter the access token when prompted. It’s saved in
~/.hapi/settings.json if you need to retrieve it:Control Remotely
Once logged in, you’ll see your active session. Try these features:Send a MessageType a message to your AI agent directly from your phone:Approve PermissionsWhen the AI requests file access, you’ll get a notification. Tap to approve or deny.View FilesTap the “Files” tab to browse your project, view git status, and see diffs.Switch Modes
- Local → Remote: Send a message from your phone
- Remote → Local: Press space twice in your terminal
What You Just Built
Congratulations! You now have:Local AI Agent
Claude Code running in your terminal with full functionality
Remote Control
Web/PWA access from any device via encrypted relay
Session Persistence
All messages and state saved in SQLite (
~/.hapi/hapi.db)Real-Time Sync
Instant updates between terminal and phone via Socket.IO + SSE
Try Different Agents
HAPI supports multiple AI agents. Try switching:Common First-Time Tasks
Enable Notifications
When prompted in the web app, click “Allow” to enable push notifications. You’ll get notified when:- AI requests permissions
- Sessions complete
- Errors occur
Install as PWA
On mobile:- Tap the share button in your browser
- Select “Add to Home Screen”
- HAPI appears as a native app icon
- Click the install icon in the address bar
- Click “Install”
Check Status
Run diagnostics to verify everything is working:Troubleshooting
Next Steps
Now that you have HAPI running, explore more features:Installation Guide
Complete setup with Telegram, voice assistant, and background services
How It Works
Understand the architecture and data flow
Self-Hosting
Use Cloudflare Tunnel or Tailscale instead of the public relay
Runner Setup
Enable remote session spawning from your phone