A modern web interface for Claude CLI with real-time streaming support, built with AI Elements and shadcn/ui components.
- 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
- 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
- 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
- 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
- Node.js 16+
- Claude CLI installed and configured
- Git
# 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 devThe API server will run on http://localhost:3000
# Open a new terminal and navigate to frontend
cd frontend
# Install frontend dependencies
npm install
# Start the development server
npm run devThe web interface will be available at http://localhost:3001
- Open
http://localhost:3001in your browser - Set your working directory in the sidebar
- Start chatting with Claude CLI through the beautiful interface!
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
}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
}
}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
Watch Claude construct tool calls character by character:
🔧 tool-Write | Input Streaming...
{"file_path": "/path/to/file.js", "content": "import React|
- Automatic session creation and persistence
- Conversation history in sidebar
- Working directory context maintained
- 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
- TypeScript throughout - Full type safety
- Comprehensive logging - Debug and monitor API usage
- Error handling - Graceful error states
- Performance optimized - Efficient streaming and rendering
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
- Start backend:
npm run dev(port 3000) - Start frontend:
cd frontend && npm run dev(port 3001)
- Build backend:
npm run build - Build frontend:
cd frontend && npm run build - Start backend:
npm start - Serve frontend:
cd frontend && npm start
This project showcases the power of Claude CLI with a modern web interface. Contributions welcome!
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
ISC License - feel free to use this project as a foundation for your own Claude CLI interfaces!
- Built with Claude CLI
- UI powered by AI Elements
- Styled with shadcn/ui
- Icons from Lucide React
Perfect for Claude Code users who want a beautiful, modern interface for their CLI interactions! 🎉