Overview
HAPI wraps the Claude Code CLI to provide remote control capabilities through web and Telegram. Start sessions from your terminal and monitor/control them from anywhere.Requirements
- Claude Code CLI installed and logged in (
claudeon PATH) - HAPI CLI installed (
hapicommand available) - Authenticated with HAPI hub (
hapi auth login)
Starting a Session
Basic Usage
With Options
HAPI supports ALL Claude Code CLI flags! Use any
claude flag with hapi as you would normally.Available Flags
HAPI-Specific Flags
| Flag | Description |
|---|---|
--hapi-starting-mode | Set initial mode: local or remote |
--yolo | Bypass permissions (alias for --dangerously-skip-permissions) |
--started-by | Internal flag for runner management |
Claude Code Flags
All standard Claude Code flags are supported:--resume- Resume the most recent session--model <model>- Specify model (sonnet, opus, etc.)--dangerously-skip-permissions- Bypass all permission prompts- And all other
claudeflags
hapi --help to see the full list.
Permission Modes
Claude Code supports these permission modes:Default
Standard Claude behavior with permission prompts
Accept Edits
Automatically accept edit operations
Plan Mode
Design approach before implementing changes
Yolo
Bypass all permissions (use with caution)
shared/src/modes.ts:1 for mode definitions.
Session Modes
Local Mode
Start from terminal with full interactive experience:- Full terminal interaction with Claude
- Messages from web/phone are queued
- Switch to remote mode anytime from the UI
Remote Mode
Control entirely from web/phone:- Session waits for messages from hub UI/Telegram
- No terminal interaction
- Switch to local mode anytime from the UI
Resume Functionality
Claude Code has built-in session resume:- View session history in web UI
- Continue conversations from any device
- Track all interactions
Examples
Start Standard Session
Resume Previous Session
Start with Auto-Accept Edits
Start with Specific Model
Start in Remote Mode
Integration
Once running, your Claude Code session appears in:- HAPI web app
- Telegram Mini App
- Monitor session activity in real-time
- Approve permissions from your phone
- Send messages (queued in local mode)
- Switch between local and remote modes
- Change permission modes on the fly
Related Commands
Source Reference
- Command implementation:
cli/src/commands/claude.ts - Session runner:
cli/src/claude/runClaude.ts - Permission modes:
shared/src/modes.ts:1-4