{"id":44975950,"url":"https://github.com/k-l-lambda/claude-web","last_synced_at":"2026-02-18T17:04:46.750Z","repository":{"id":328161298,"uuid":"1112994392","full_name":"k-l-lambda/claude-web","owner":"k-l-lambda","description":"A web-based interface for Claude Code, providing both web UI and APIs wrapper for Claude code.","archived":false,"fork":false,"pushed_at":"2025-12-11T11:42:37.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-12T12:53:59.648Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/k-l-lambda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-09T11:32:00.000Z","updated_at":"2025-12-11T11:42:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/k-l-lambda/claude-web","commit_stats":null,"previous_names":["k-l-lambda/claude-web"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/k-l-lambda/claude-web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-l-lambda%2Fclaude-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-l-lambda%2Fclaude-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-l-lambda%2Fclaude-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-l-lambda%2Fclaude-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k-l-lambda","download_url":"https://codeload.github.com/k-l-lambda/claude-web/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-l-lambda%2Fclaude-web/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29587066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T16:55:40.614Z","status":"ssl_error","status_checked_at":"2026-02-18T16:55:37.558Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-18T17:04:40.121Z","updated_at":"2026-02-18T17:04:46.741Z","avatar_url":"https://github.com/k-l-lambda.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Claude Code Web\n\nA web-based interface for Claude Code, providing browser-accessible AI-assisted software development with real-time streaming.\n\n## Features\n\n- **Web UI**: Access Claude Code from any browser\n- **Real-time Streaming**: WebSocket-based bidirectional communication\n- **Session Management**: Create, resume, and manage multiple coding sessions\n- **Dual Backend Support**:\n  - **SDK Backend**: Direct Anthropic API calls with dual-agent orchestration\n  - **CLI Pipe Backend**: Wraps official Claude CLI with full feature support (MCP, hooks, etc.)\n- **Tool Execution**: File operations, git commands, bash execution with permission controls\n- **JSONL Persistence**: All sessions persisted for resumption\n\n## Quick Start\n\n1. **Configure environment**:\n   ```bash\n   cd backend\n   cp .env.example .env\n   # Edit .env: set ANTHROPIC_API_KEY, AUTH_PASSWORD\n   # Optionally create .env.local to override values\n   ```\n\n2. **Build and start**:\n   ```bash\n   # Build frontend\n   cd frontend \u0026\u0026 npm install \u0026\u0026 npm run build \u0026\u0026 cd ..\n\n   # Build and run backend\n   cd backend \u0026\u0026 npm install \u0026\u0026 npm run build \u0026\u0026 node dist/server.js\n   ```\n\n3. **Access**: Open http://localhost:3000 (or your configured PORT)\n\n## Configuration\n\nEnvironment variables in `backend/.env` or `.env.local`:\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `PORT` | Server port | 3000 |\n| `AUTH_PASSWORD` | Login password | (required) |\n| `ANTHROPIC_API_KEY` | Anthropic API key | (required for SDK backend) |\n| `CLAUDE_MODEL` | Claude model | claude-sonnet-4-5-20250929 |\n| `BACKEND_TYPE` | `sdk` or `cli-pipe` | sdk |\n| `CLAUDE_PATH` | Path to claude CLI | claude |\n| `ENABLE_THINKING` | Extended thinking | false |\n| `WORK_DIR` | Default working directory | (cwd) |\n| `SESSION_STORAGE_DIR` | Session storage | .claude-web/sessions |\n| `LOG_LEVEL` | Log level | info |\n\n### Backend Types\n\n**SDK Backend** (`BACKEND_TYPE=sdk`):\n- Direct API calls via @anthropic-ai/sdk\n- Custom dual-agent pattern (Instructor + Worker)\n- Custom tool implementations\n- Requires `ANTHROPIC_API_KEY`\n\n**CLI Pipe Backend** (`BACKEND_TYPE=cli-pipe`):\n- Wraps official `claude` CLI via `--print --input-format stream-json --output-format stream-json`\n- Full CLI features (MCP servers, hooks, all tools)\n- Uses CLI's built-in orchestration\n- Uses CLI's existing authentication\n\n## Architecture\n\n```\nclaude-web/\n├── backend/\n│   ├── src/\n│   │   ├── server.ts              # Express + WebSocket server\n│   │   ├── config.ts              # Environment configuration\n│   │   ├── websocket/\n│   │   │   ├── handler.ts         # Message routing, auth\n│   │   │   └── client-manager.ts  # WebSocket client state\n│   │   ├── session/\n│   │   │   ├── manager.ts         # Session lifecycle\n│   │   │   └── storage.ts         # JSONL persistence\n│   │   ├── orchestrator/\n│   │   │   ├── index.ts           # SDK dual-agent orchestrator\n│   │   │   └── cli-pipe.ts        # CLI pipe orchestrator\n│   │   ├── claude/\n│   │   │   ├── client.ts          # Anthropic SDK wrapper\n│   │   │   └── cli-pipe-client.ts # CLI subprocess wrapper\n│   │   └── tools/                 # Tool implementations\n│   └── dist/                      # Compiled output\n├── frontend/\n│   ├── src/\n│   │   ├── views/                 # Login, Sessions, Chat views\n│   │   ├── components/            # Terminal, InputBox, StatusBadge\n│   │   ├── stores/                # Pinia state (auth, session)\n│   │   └── composables/           # useWebSocket\n│   └── dist/                      # Built frontend (served by backend)\n└── README.md\n```\n\n## WebSocket Protocol\n\n### Client to Server\n\n| Message | Description |\n|---------|-------------|\n| `auth` | `{ type: 'auth', password: string }` |\n| `create_session` | `{ type: 'create_session', workDir: string, instruction?: string }` |\n| `resume_session` | `{ type: 'resume_session', sessionId: string }` |\n| `send_input` | `{ type: 'send_input', sessionId: string, content: string }` |\n| `interrupt` | `{ type: 'interrupt', sessionId: string }` |\n| `list_sessions` | `{ type: 'list_sessions' }` |\n| `end_session` | `{ type: 'end_session', sessionId: string }` |\n\n### Server to Client\n\n| Message | Description |\n|---------|-------------|\n| `auth_success` | Authentication successful |\n| `auth_failed` | Authentication failed |\n| `session_created` | New session created |\n| `session_resumed` | Session resumed with history |\n| `thinking` | Extended thinking content (streaming) |\n| `instructor_message` | Instructor agent response |\n| `worker_message` | Worker agent response |\n| `tool_use` | Tool being executed |\n| `tool_result` | Tool execution result |\n| `status_update` | Session status change |\n| `waiting_input` | Waiting for user input |\n| `done` | Task completed |\n| `error` | Error message |\n\n## HTTP REST API\n\nAll endpoints (except `/api/health` and `/api/config`) require `X-API-Key` header.\n\n### Session Management\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `/api/sessions` | Create new session |\n| `GET` | `/api/sessions` | List all sessions |\n| `GET` | `/api/sessions/:id` | Get session details with history |\n| `DELETE` | `/api/sessions/:id` | End/delete session |\n\n### Chat\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `/api/sessions/:id/messages` | Send message (sync, wait for completion) |\n| `GET` | `/api/sessions/:id/messages/stream` | SSE streaming (query param: `content`) |\n| `POST` | `/api/sessions/:id/messages/stream` | SSE streaming (body: `{content}`) |\n\n### Examples\n\n**Create Session**:\n```bash\ncurl -X POST -H \"X-API-Key: \u003cpassword\u003e\" -H \"Content-Type: application/json\" \\\n  -d '{\"workDir\": \"/path/to/project\"}' \\\n  http://localhost:3000/api/sessions\n```\n\n**Send Message (Sync)**:\n```bash\ncurl -X POST -H \"X-API-Key: \u003cpassword\u003e\" -H \"Content-Type: application/json\" \\\n  -d '{\"content\": \"Read the README.md file\"}' \\\n  http://localhost:3000/api/sessions/\u003csession-id\u003e/messages\n```\n\n**Stream Response (SSE)**:\n```bash\ncurl -N -H \"X-API-Key: \u003cpassword\u003e\" \\\n  \"http://localhost:3000/api/sessions/\u003csession-id\u003e/messages/stream?content=Hello\"\n```\n\n**SSE Event Types**:\n- `connected` - Connection established\n- `status` - Status update (thinking, executing, waiting)\n- `thinking` - Extended thinking content\n- `instructor_message` - Instructor agent response\n- `worker_message` - Worker agent response\n- `tool_use` - Tool being executed\n- `tool_result` - Tool execution result\n- `round_complete` - Round completed\n- `done` - Task completed\n- `error` - Error occurred\n\n## Development\n\n### Backend\n```bash\ncd backend\nnpm install\nnpm run build   # Compile TypeScript\nnpm run dev     # Watch mode (if configured)\n```\n\n### Frontend\n```bash\ncd frontend\nnpm install\nnpm run dev     # Vite dev server with HMR (port 5173)\nnpm run build   # Production build\n```\n\n## CLI Pipe Mode Details\n\nThe CLI pipe backend uses Claude CLI's stream-json format:\n\n**Input**:\n```json\n{\"type\":\"user\",\"message\":{\"role\":\"user\",\"content\":\"Your prompt\"}}\n```\n\n**Output** (NDJSON):\n```json\n{\"type\":\"system\",\"subtype\":\"init\",\"session_id\":\"...\",\"tools\":[...],\"model\":\"...\"}\n{\"type\":\"assistant\",\"message\":{\"content\":[{\"type\":\"text\",\"text\":\"Response\"}]}}\n{\"type\":\"result\",\"subtype\":\"success\",\"result\":\"Final text\",\"session_id\":\"...\"}\n```\n\n## Tech Stack\n\n- **Backend**: Node.js, Express 5, WebSocket (ws), TypeScript\n- **Frontend**: Vue 3, Vite, Pinia, Vue Router\n- **API**: @anthropic-ai/sdk or Claude CLI\n- **Storage**: JSONL event sourcing\n- **ASR**: sherpa-onnx WebAssembly (voice input)\n\n## Third-Party Dependencies\n\n### sherpa-onnx WASM (Voice Input)\n\nThe voice input feature uses [sherpa-onnx](https://github.com/k2-fsa/sherpa-onnx) WebAssembly files for browser-based speech recognition.\n\n- **Source**: https://huggingface.co/spaces/k2-fsa/web-assembly-asr-sherpa-onnx-zh-en\n- **Model**: Zipformer (Chinese + English, ~200MB)\n- **License**: Apache 2.0\n- **Files**: Downloaded automatically via `npm install` (postinstall script)\n\nTo manually download:\n```bash\ncd frontend\nnpm run download:asr\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk-l-lambda%2Fclaude-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk-l-lambda%2Fclaude-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk-l-lambda%2Fclaude-web/lists"}