agentleFS
vultukvultuk/claude-code-web/CLAUDE.md

claude-code-web

CLAUDE.md97 starsChanged 13 months agoMITView on GitHub

Claude Code Web is a web-based interface for the Claude Code CLI that enables browser-based access with multi-session support and real-time streaming capabilities. The application provides a terminal emulator interface through xterm.js with WebSocket communication for real-time interaction. Server Layer (src/server.js) - Express server handling REST API and WebSocket connections - Session persistence via SessionStore (saves to ~/.claude-code-web/sessions.json) - Authentication middleware with rate limiting - Folder mode for working directory selection - Auto-save sessions every 30 seconds Claude Bridge (src/claude-bridge.js)…

  • Installs packages
  • In this repositoryOne other file it gives its agents.

The file

Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Claude Code Web is a web-based interface for the Claude Code CLI that enables browser-based access with multi-session support and real-time streaming capabilities. The application provides a terminal emulator interface through xterm.js with WebSocket communication for real-time interaction.

Common Commands

# Install dependencies
npm install

# Start development server (with extra logging)
npm run dev

# Start production server  
npm start

# Start with custom port
npm start -- --port 8080

# Start with authentication
npm start -- --auth your-token

# Start with HTTPS
npm start -- --https --cert cert.pem --key key.pem

Architecture

Core Components

Server Layer (src/server.js)

  • Express server handling REST API and WebSocket connections
  • Session persistence via SessionStore (saves to ~/.claude-code-web/sessions.json)
  • Authentication middleware with rate limiting
  • Folder mode for working directory selection
  • Auto-save sessions every 30 seconds

Claude Bridge (src/claude-bridge.js)

  • Manages Claude CLI process spawning using node-pty
  • Handles multiple concurrent Claude sessions
  • Process lifecycle management (start, stop, resize)
  • Output buffering for reconnection support
  • Searches for Claude CLI in multiple standard locations

Session Management

  • Persistent sessions survive server restarts
  • Multi-browser support - same session accessible from different devices
  • Session data includes: ID, name, working directory, output buffer, creation time
  • Sessions auto-save and can be manually deleted

Client Architecture (src/public/)

  • app.js: Main interface controller, terminal setup, WebSocket management
  • session-manager.js: Session tab UI, notifications, multi-session handling
  • plan-detector.js: Detects Claude plan mode and provides approval UI
  • auth.js: Client-side authentication handling
  • service-worker.js: PWA support for offline capabilities

WebSocket Protocol

The application uses WebSocket for real-time bidirectional communication:

  • create_session: Initialize new Claude session
  • join_session: Connect to existing session
  • leave_session: Disconnect without stopping Claude
  • start_claude: Launch Claude CLI in session
  • input: Send user input to Claude
  • resize: Adjust terminal dimensions
  • stop: Terminate Claude process

Security Features

  • Optional token-based authentication (Bearer token or query parameter)
  • Rate limiting (100 requests/minute per IP by default)
  • Path validation to prevent directory traversal
  • HTTPS support with SSL certificates

Key Implementation Details

  • Claude CLI discovery attempts multiple paths including ~/.claude/local/claude
  • Sessions persist to disk at ~/.claude-code-web/sessions.json
  • Output buffer maintains last 1000 lines for reconnection
  • Terminal uses xterm-256color with full ANSI color support
  • Folder browser restricts access to base directory and subdirectories only
  • Mobile-responsive design with touch-optimized controls

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.