Claude Code UI

September 18, 2025 ยท View on GitHub

A modern web interface for Claude CLI with real-time streaming support, built with AI Elements and shadcn/ui components.

๐ŸŒŸ Features

๐ŸŽฏ Modern Chat Interface

  • ChatGPT-style design with clean, focused layout
  • Real-time streaming - Watch Claude think and respond live
  • Session persistence - Conversations continue across interactions
  • Working directory support - Set project context for Claude CLI

๐Ÿ› ๏ธ Advanced Tool Visualization

  • Live tool streaming - Watch Claude construct file operations in real-time
  • Think โ†’ Act โ†’ Think flow - See Claude's thought process interwoven with tool usage
  • Tool result display - Bash, Read, Write, Search tools with proper formatting
  • Code highlighting - Syntax highlighting for all code blocks

๐Ÿ“Ž Multimodal Input

  • Voice recording - Record voice messages (speech-to-text ready)
  • File attachments - Upload images, PDFs, code files, and documents
  • Rich text input - Auto-resizing textarea with keyboard shortcuts

๐ŸŽจ Beautiful Components

  • AI Elements integration - Showcases all AI Elements components
  • shadcn/ui styling - Professional, accessible design system
  • Responsive layout - Works on desktop, tablet, and mobile
  • Dark mode support - Seamless theme switching

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 16+
  • Claude CLI installed and configured
  • Git

1. Backend Setup

# Clone the repository
git clone https://github.com/suhail-ak-2/claude-code-ui.git
cd claude-code-ui

# Install backend dependencies
npm install

# Build the project
npm run build

# Start the API server
npm run dev

The API server will run on http://localhost:3000

2. Frontend Setup

# Open a new terminal and navigate to frontend
cd frontend

# Install frontend dependencies
npm install

# Start the development server
npm run dev

The web interface will be available at http://localhost:3001

3. Start Using

  1. Open http://localhost:3001 in your browser
  2. Set your working directory in the sidebar
  3. Start chatting with Claude CLI through the beautiful interface!

๐Ÿ“ก API Endpoints

Streaming Endpoint

POST http://localhost:3000/claude/stream
Content-Type: application/json

{
  "prompt": "What files are in the current directory?",
  "sessionId": "uuid-from-previous-response", // optional
  "workingDirectory": "/path/to/project" // optional
}

Execute Endpoint

POST http://localhost:3000/claude/execute
Content-Type: application/json

{
  "prompt": "Help me understand this code",
  "sessionId": "session-uuid", // optional
  "options": {
    "model": "sonnet",
    "dangerouslySkipPermissions": true
  }
}

๐ŸŽจ UI Components Showcase

The frontend demonstrates all AI Elements components:

  • Conversation - Chat layout and message flow
  • Message - User and assistant message cards
  • Response - Formatted AI responses with streaming
  • Tool - Interactive tool usage display with real-time input streaming
  • CodeBlock - Syntax-highlighted code with copy functionality
  • PromptInput - Advanced input with attachments and voice
  • Loader - Elegant loading states
  • Actions - Quick action buttons
  • Suggestion - Pre-filled prompt suggestions

๐Ÿ”ง Features in Detail

Real-time Tool Streaming

Watch Claude construct tool calls character by character:

๐Ÿ”ง tool-Write | Input Streaming...
{"file_path": "/path/to/file.js", "content": "import React|

Session Management

  • Automatic session creation and persistence
  • Conversation history in sidebar
  • Working directory context maintained

Advanced Input

  • Voice Recording: Click microphone to record voice messages
  • File Attachments: Drag & drop or click to attach files
  • Multiline Support: Auto-resizing textarea
  • Keyboard Shortcuts: Enter to send, Shift+Enter for new line

Developer Tools

  • TypeScript throughout - Full type safety
  • Comprehensive logging - Debug and monitor API usage
  • Error handling - Graceful error states
  • Performance optimized - Efficient streaming and rendering

๐Ÿ“ Project Structure

claude-code-ui/
โ”œโ”€โ”€ src/                    # Backend API source
โ”‚   โ”œโ”€โ”€ server.ts          # Express server with streaming endpoints
โ”‚   โ”œโ”€โ”€ claudeWrapper.ts   # Claude CLI process management
โ”‚   โ”œโ”€โ”€ types.ts           # TypeScript definitions
โ”‚   โ””โ”€โ”€ logging/           # Logging and telemetry
โ”œโ”€โ”€ frontend/              # Next.js frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ app/page.tsx   # Main chat interface
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ai-elements/  # AI Elements components
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ui/           # shadcn/ui components
โ”‚   โ””โ”€โ”€ package.json
โ”œโ”€โ”€ examples/              # Example clients
โ””โ”€โ”€ README.md

๐Ÿš€ Deployment

Local Development

  1. Start backend: npm run dev (port 3000)
  2. Start frontend: cd frontend && npm run dev (port 3001)

Production

  1. Build backend: npm run build
  2. Build frontend: cd frontend && npm run build
  3. Start backend: npm start
  4. Serve frontend: cd frontend && npm start

๐Ÿค Contributing

This project showcases the power of Claude CLI with a modern web interface. Contributions welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

๐Ÿ“„ License

ISC License - feel free to use this project as a foundation for your own Claude CLI interfaces!

๐Ÿ™ Acknowledgments


Perfect for Claude Code users who want a beautiful, modern interface for their CLI interactions! ๐ŸŽ‰