Skip to content

About

A brutalist dark-mode web UI for Claude Code — terminal-style chat with session management, conversation history, and token usage tracking. Streams real claude CLI output over WebSocket. One-command Mac installer included.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

24 Commits

Folders and files

Repository files navigation

claude-web

A brutalist dark-mode web UI for Claude Code — run Claude directly from your browser with a terminal-style chat interface, multi-session management, conversation history replay, and live token usage tracking.

claude-web chat view: one prompt and Claude's streamed answer


Features

  • Terminal chat — stream Claude's responses in real time, with collapsible tool call blocks (Read, Edit, Write, Bash) color-coded by type
  • Session manager — start multiple concurrent Claude sessions in different working directories, kill them independently
  • History browser — all completed sessions are persisted; replay any past conversation with full tool call detail
  • Token usage — live input/output/cache token counts per session, with aggregate daily stats
  • Single-process production mode — backend serves the built frontend; one port, no separate Vite server
  • Auto-start at login — macOS LaunchAgent keeps the server running in the background
  • One-command installer — curl script handles everything for Mac users

How it works

Each time you send a prompt, the backend spawns a short-lived claude --print <text> subprocess. The session_id returned in claude's result event is captured and passed as --resume <session_id> on subsequent prompts, maintaining full conversation context across turns.

Output is streamed from the subprocess stdout as NDJSON, parsed into typed events (assistant, tool_use, tool_result, result), and forwarded to the browser over a WebSocket connection.

Browser  ──── WebSocket ────  Node.js/Express  ──── spawn ────  claude CLI
  │                                  │                               │
  │  { type: "prompt", text }  →     │   claude --print "text"  →   │
  │                            ←     │   ← NDJSON stream            │
  │  { type: "output", text }  ←     │                               │
  │  { type: "tool_call" }     ←     │                               │
  │  { type: "status","idle" } ←     │   (process exits)            │

Requirements

  • macOS (Windows support not included)
  • Node.js 18+
  • Claude Code CLI — must be installed and authenticated (claude --version should work)

Install

curl -fsSL https://raw.githubusercontent.com/chadalanlester/claude-web/main/install.sh | bash

The script will:

  1. Check for Node.js 18+, git, and the claude CLI
  2. Clone the repo to ~/claude-web
  3. Install dependencies and build the app
  4. Register a LaunchAgent (com.chadlester.claude-web) — starts at login, runs on port 3001
  5. Install the claude-web shell command

After install, open the app any time:

claude-web          # starts servers if needed, opens http://localhost:3001

Or go directly to http://localhost:3001


Service management

# Start / stop
launchctl start com.chadlester.claude-web
launchctl stop  com.chadlester.claude-web

# Check status
launchctl list | grep claude-web

# View logs
tail -f ~/Library/Logs/claude-web/stdout.log
tail -f ~/Library/Logs/claude-web/stderr.log

Update

cd ~/claude-web
git pull
npm run build
launchctl stop  com.chadlester.claude-web
launchctl start com.chadlester.claude-web

Architecture

claude-web/
├── backend/               Node.js + Express + ws (TypeScript)
│   └── src/
│       ├── server.ts      HTTP server, WebSocket upgrade handler, static serving
│       ├── config.ts      Port, history dir, claude path (lazy)
│       ├── sessions/
│       │   ├── manager.ts Create/kill sessions; bridge registry
│       │   ├── bridge.ts  Per-prompt subprocess spawn; NDJSON parser; WS relay
│       │   └── types.ts   Session, Message, WsInbound/Outbound types
│       ├── history/
│       │   └── store.ts   JSON persistence at ~/.claude-web/history/
│       └── routes/
│           ├── sessions.ts  POST /api/sessions, GET /api/sessions, DELETE /api/sessions/:id
│           ├── history.ts   GET /api/history, GET /api/history/:id
│           └── stats.ts     GET /api/stats (token totals + RTK savings)
│
└── frontend/              Vite + React (TypeScript)
    └── src/
        ├── views/
        │   ├── Sessions.tsx    Active session list + new session form
        │   ├── Chat.tsx        Terminal output + prompt input
        │   ├── History.tsx     Past session list
        │   └── HistoryDetail.tsx  Conversation replay
        ├── components/
        │   ├── TerminalOutput.tsx  Streaming output with tool call blocks
        │   ├── PromptInput.tsx     Textarea (Enter to send, Shift+Enter newline)
        │   ├── SessionCard.tsx     Session summary card
        │   └── NavBar.tsx          Nav + token usage display
        ├── hooks/
        │   ├── useSession.ts       WebSocket connection with auto-reconnect
        │   └── useSessionList.ts   Polling session list
        └── api/client.ts           Typed fetch wrappers

Ports:

Mode Frontend Backend
Dev :5173 (Vite) :3001 (Express)
Prod — :3001 (Express serves static files)

Dev mode

git clone https://github.com/chadalanlester/claude-web
cd claude-web
npm install
npm install --prefix backend
npm install --prefix frontend
npm run dev        # concurrently: backend :3001 + Vite :5173

Run tests:

npm test           # 19 backend tests via Vitest

Environment variables

Variable Default Description
CLAUDE_WEB_PORT 3001 Port the backend listens on
CLAUDE_WEB_HOST 127.0.0.1 Interface the backend binds. Read Security before changing it
CLAUDE_WEB_HISTORY_DIR ~/.claude-web/history Where session JSON files are stored
CLAUDE_PATH auto-detected via which claude Path to the claude CLI binary

Security

claude-web has no login. Anyone who can reach its port can start a claude process that runs as your user. That process has your files, your credentials and your shell, plus whatever permissions your Claude Code settings allow.

  • Loopback only, by default. The server binds 127.0.0.1 (since 8646250). Before that change it listened on every interface. That exposed an unauthenticated server to the whole LAN, and macOS raised a firewall prompt for every new node binary.
  • Remote access is opt-in. CLAUDE_WEB_HOST=0.0.0.0 binds every interface. Do that only behind something that authenticates, such as a reverse proxy with auth or a private network, and never on an untrusted network.
  • History is plain JSON. Sessions, including prompts and tool output, are written unencrypted to CLAUDE_WEB_HISTORY_DIR. Treat that folder like shell history.

License

MIT

About

A brutalist dark-mode web UI for Claude Code — terminal-style chat with session management, conversation history, and token usage tracking. Streams real claude CLI output over WebSocket. One-command Mac installer included.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages