Overview
Start coding sessions on your computer and monitor/control them from your phone. Switch between local terminal mode and remote control as your workflow requires.Local Mode
Full terminal experience with instant response. Best for focused, uninterrupted coding.
Remote Mode
Control via Web/PWA/Telegram. Approve permissions and monitor progress on the go.
Session Modes
Local Mode
When working in local mode, you have the full terminal experience — it is native Claude Code, Codex, or OpenCode:- Direct keyboard input with instant response
- Full terminal UI with syntax highlighting
- Best for focused work - uninterrupted coding sessions
- All processing local - AI runs on your machine
Remote Mode
Switch to remote mode when you need to step away:- Control from anywhere - Web/PWA/Telegram from any device
- Approve permissions on the go
- Monitor progress while away from your desk
- Session continues running on your local machine
Switching Between Modes
HAPI makes it trivial to switch control between your terminal and remote devices.Local → Remote
Your session automatically switches to remote mode when:- You receive a message from phone/web
- Terminal shows “Remote mode - waiting for input”
- Control transfers to your remote device
Remote → Local
To regain local control from your terminal:- Press spacebar twice (double-space) in the terminal
- Terminal instantly switches back to local mode
- Continue typing as if you never left
The session state is preserved across mode switches — your conversation history, context, and agent state remain intact.
Real-Time Updates
When in remote mode, all changes sync in real-time:- Message streaming - See agent responses as they’re generated
- Permission requests - Get notified instantly on your phone
- Status changes - Active/inactive session state
- Tool usage - Watch as the agent uses tools
Communication Flow
Session Control Features
From Web/PWA
When controlling remotely, you have access to:Send Messages
Type instructions and questions to your AI agent
Permission Control
Approve or deny file edits, bash commands, and tool usage
Mode Switching
Change permission modes (default, acceptEdits, YOLO, plan)
Session Management
Abort sessions, switch machines, or spawn new sessions
Session Actions
Available actions in the web interface:| Action | Description |
|---|---|
| Send Message | Give instructions to the AI agent |
| Approve/Deny | Handle permission requests |
| Change Mode | Switch permission mode (YOLO, safe, plan) |
| Abort Session | Stop the current session |
| Switch to Remote | Force session into remote mode |
| Resume Session | Restart an inactive session |
Use Cases
Remote Control While Away
Start a session at your desk, continue from your phone:- Morning: Start coding session on desktop
- Commute: Check progress on phone, approve file edits
- Coffee break: Send new instructions via Telegram
- Back at desk: Double-space to regain local control
Permission Approval
Approve permissions without returning to your desk:- AI requests file access
- Get notification on phone (push or Telegram)
- Review the permission request
- Approve with one tap
- Session continues automatically
Multi-Device Collaboration
View session progress on multiple devices:- Desktop terminal: Primary development interface
- Phone/tablet: Monitor progress and approve permissions
- Another computer: Access via web browser
Architecture
The seamless handoff is powered by HAPI’s architecture:- CLI wraps the AI agent and maintains local state
- Hub coordinates communication via Socket.IO and SSE
- Web app provides remote interface with real-time updates
- SQLite persists session history and messages
Best Practices
When to Use Local Mode
When to Use Local Mode
- Writing code with frequent iterations
- Reading long agent responses
- Need immediate keyboard response
- Working with sensitive information
When to Use Remote Mode
When to Use Remote Mode
- Away from your desk
- Need to approve permissions
- Monitoring long-running tasks
- Want notifications on your phone
Switching Tips
Switching Tips
- Switch freely — there’s no penalty
- Use remote mode for approval workflows
- Return to local mode for intensive coding
- Keep the terminal open to maintain session
Related Features
PWA
Install HAPI as a native-like app
Telegram
Get notifications via Telegram
Permissions
Control agent access to tools