Skip to content

fihaaade/claudex-gui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Claudex GUI

A modern web interface for Claude AI code assistant

npm version License: MIT

Features β€’ Quick Start β€’ Screenshots β€’ Architecture


Screenshots

Home Page

Claudex GUI Home

Chat Interface

Claudex GUI Chat


Overview

Claudex GUI is a web-based interface for interacting with Claude AI as a code assistant. Built with Next.js and integrated with the Claude Agent SDK, it provides a seamless experience for AI-powered code development, analysis, and collaboration.

Features

πŸ€– AI-Powered Code Assistant

  • Real-time streaming responses from Claude AI
  • Support for multiple Claude models (Opus, Sonnet, Haiku)
  • Agent and Plan modes for different workflows
  • Extended thinking mode for complex problems

πŸ’¬ Intelligent Chat Interface

  • Markdown rendering with syntax highlighting
  • Code block theme adaptation (light/dark)
  • Tool execution visualization (Bash, file operations)
  • Clickable local file references
  • Sticky user messages for easy context tracking

πŸ“ Project Management

  • Local project folder integration
  • Multi-project support with history
  • Git information display (branch, commit hash)
  • Session persistence and resumption

🎨 Modern UI/UX

  • Clean, minimalist design inspired by 1Code
  • Light and dark theme support
  • Responsive layout with custom scrollbars
  • Smooth animations and transitions
  • Keyboard shortcuts (Enter to send, Shift+Enter for newline)

πŸ”§ Developer Features

  • Token usage tracking and cost estimation
  • Slash commands for quick actions
  • Model selector with thinking toggle
  • Message history management
  • Context indicator

Quick Start

Prerequisites

  • Node.js 18+ or Bun
  • Claude API key (or compatible API endpoint)
  • @anthropic-ai/claude-code package (required for Claude Agent SDK)

Installation

# Install Claude Code globally (required)
npm install -g @anthropic-ai/claude-code

# Install Claudex GUI
npm install -g claudex-gui

# Run the application
claudex-gui

On first run, you'll be prompted to enter your ANTHROPIC_API_KEY (or ANTHROPIC_AUTH_TOKEN).

The application will:

  1. Check for required dependencies
  2. Build the Next.js application (first run only)
  3. Find an available port (starting from 3000)
  4. Start the server at http://localhost:PORT

Environment Variables

You can set these in your shell profile or in ~/.claudex-gui/.env.local:

ANTHROPIC_API_KEY=your_api_key_here
# or
ANTHROPIC_AUTH_TOKEN=your_auth_token_here

# Optional: specify port
PORT=3000

First Steps

  1. Select a Project: Enter a local project path or browse for a folder
  2. Start Chatting: Ask Claude about your code, request changes, or get explanations
  3. Review Changes: View tool execution results and file modifications in real-time
  4. Track Progress: Monitor token usage and session information in the header

CLI Options

claudex-gui              # Start the web server
claudex-gui --setup      # Reconfigure API key
claudex-gui --help       # Show help message

Architecture

Tech Stack

  • Framework: Next.js 15 (App Router) + React 19
  • Language: TypeScript
  • Styling: Tailwind CSS v4
  • Database: SQLite + Drizzle ORM
  • API: tRPC for type-safe client-server communication
  • AI: Claude Agent SDK (@anthropic-ai/claude-agent-sdk)
  • UI Components: Radix UI primitives
  • Animations: Framer Motion

Project Structure

claudex-gui/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ trpc/[trpc]/          # tRPC endpoints
β”‚   β”‚   └── claude/stream/        # Claude SSE streaming
β”‚   β”œβ”€β”€ chat/[projectPath]/       # Chat interface
β”‚   └── page.tsx                  # Home page
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ chat/                     # Chat UI components
β”‚   β”‚   β”œβ”€β”€ chat-header.tsx       # Project info header
β”‚   β”‚   β”œβ”€β”€ chat-input.tsx        # Message input
β”‚   β”‚   β”œβ”€β”€ messages-list.tsx     # Message display
β”‚   β”‚   └── chat-markdown-renderer.tsx
β”‚   └── ui/                       # Reusable UI components
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ db/                       # Database schema & utils
β”‚   β”œβ”€β”€ trpc/                     # tRPC routers
β”‚   β”‚   └── routers/
β”‚   β”‚       β”œβ”€β”€ projects-simple.ts
β”‚   β”‚       β”œβ”€β”€ chats-simple.ts
β”‚   β”‚       β”œβ”€β”€ claude-simple.ts
β”‚   β”‚       β”œβ”€β”€ git.ts
β”‚   β”‚       └── external.ts
β”‚   └── claude/
β”‚       β”œβ”€β”€ env.ts                # Claude environment config
β”‚       β”œβ”€β”€ transform.ts          # Message transformers
β”‚       └── use-claude-stream.ts  # React streaming hook
└── drizzle/                      # Database migrations

Data Flow

  1. User Input β†’ ChatInput component
  2. Message Cleaning β†’ Remove excessive newlines
  3. Stream Request β†’ /api/claude/stream (SSE)
  4. Claude SDK β†’ Process with tools and context
  5. Transform β†’ Convert SDK events to UI chunks
  6. Render β†’ Display in MessagesList with markdown

Database Schema

// Projects: Local folder references
projects {
  id, name, path, gitRemoteUrl, gitProvider, gitOwner, gitRepo
}

// Chats: Conversation sessions
chats {
  id, name, projectId, worktreePath, branch, prUrl
}

// Sub-chats: Individual message threads
subChats {
  id, name, chatId, sessionId, mode, messages (JSON)
}

Development

Available Scripts

# Development
bun run dev              # Start dev server with hot reload

# Database
bun run db:generate      # Generate migrations from schema
bun run db:push          # Push schema changes (dev only)
bun run db:studio        # Open Drizzle Studio

# Build
bun run build            # Build for production
bun run start            # Start production server

# Linting
bun run lint             # Run ESLint

Environment Variables

# Required
ANTHROPIC_API_KEY=your_api_key_here

# Optional
DATABASE_PATH=~/.claudex/data/agents.db  # Custom database location

Adding New Features

  1. New tRPC Router: Add to lib/trpc/routers/ and register in router.ts
  2. New UI Component: Add to components/ with TypeScript types
  3. Database Changes: Update lib/db/schema/index.ts and run bun run db:generate
  4. Claude Tools: Extend in lib/claude/env.ts tool definitions

Configuration

Model Selection

Users can switch between Claude models in the chat interface:

  • Opus 4.6: Most capable, best for complex tasks
  • Sonnet 4.6: Balanced performance and speed
  • Haiku 4.5: Fastest, best for simple queries

Modes

  • Agent Mode: Full autonomy with tool execution
  • Plan Mode: Read-only analysis and planning

Thinking Toggle

Enable extended thinking for complex reasoning tasks (increases token usage).

Troubleshooting

Common Issues

"No ANTHROPIC_API_KEY found"

  • Set the environment variable in .env.local
  • Restart the development server

"Failed to open file"

  • Ensure the project path is absolute and exists
  • Check file permissions

Database errors

  • Delete ~/.claudex/data/agents.db to reset
  • Run bun run db:push to recreate schema

Streaming not working

  • Check browser console for errors
  • Verify API key is valid
  • Ensure network connection is stable

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License

Acknowledgments


Made with ❀️ for developers who love AI-assisted coding

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors