Architecture
The Anyware CLI runs on your machine and spawns Claude Code as a child process. It captures all Claude Code events via hooks and streams them over a WebSocket connection to the Anyware API, which handles authentication and session management. The API maintains session state and broadcasts events to connected Web Dashboard clients. When you send input from the dashboard, messages flow back through the same WebSocket path to the CLI. For LLM requests, Claude Code calls the Anyware Proxy instead of Anthropic directly. The proxy authenticates requests, routes them to OpenRouter for model access, and tracks token usage for billing.Components
Anyware CLI
Anyware CLI
The command-line tool installed via npm. It:
- Spawns Claude Code locally on your machine
- Connects to the cloud via WebSocket
- Captures all session events via hooks
- Streams output to the cloud in real-time
- Handles mode switching (local/remote)
Anyware API
Anyware API
The backend API layer. It handles:
- User authentication
- Session management
- WebSocket connections
- Real-time message routing
LLM Proxy
LLM Proxy
The model gateway:
- Authenticates requests
- Routes to OpenRouter for model access
- Enables custom model support
- Tracks token usage
Web Dashboard
Web Dashboard
The React web app at anyware.run:
- Shows active sessions
- Streams terminal output
- Enables remote input and control
- Handles permission responses
Mode Switching
The CLI tracks whether input comes from the terminal or web. When you send a prompt from the dashboard, the CLI switches to remote mode and forwards web input to Claude Code. Press Enter, Esc, or q in the terminal to reclaim control and switch back to local mode. See Local vs Remote Mode for details.Security
| Aspect | Implementation |
|---|---|
| Authentication | OAuth, JWT tokens |
| Transport | HTTPS for API, WSS for WebSocket |
| Sessions | Authenticated, user-scoped |
| LLM requests | Token-authenticated proxy |