A fully functional, feature-complete local clone of Claude.ai that runs entirely on your machine.
- β Real-time streaming responses with Server-Sent Events (SSE)
- β All Claude 4 models (Sonnet 4.5, Opus 4.1, Opus 4, Sonnet 4) + Claude 3.5 & 3
- β Prompt caching for 90% cost reduction on repeated context
- β Markdown rendering with GitHub Flavored Markdown support
- β Syntax highlighting for 15+ programming languages
- β Code copy buttons with one-click copying
- β Auto-scrolling message list
- β Projects with custom instructions and knowledge base
- β Conversation management (create, rename, archive, delete)
- β Search & filter conversations
- β Date grouping (Today, Yesterday, Last 7 days, Older)
- β Project filtering to organize chats
- β PDF viewer with zoom and page navigation
- β Image preview with zoom and lightbox mode
- β Markdown preview with live rendering
- β Code file syntax highlighting
- β File attachments (coming soon)
- β Dark/light theme toggle
- β Responsive design (desktop and mobile)
- β Collapsible sidebar with persistent state
- β Toast notifications for user feedback
- β Loading states and error handling
| Category | Technology |
|---|---|
| Framework | Next.js 15 (App Router) |
| Language | TypeScript 5.7 |
| Styling | Tailwind CSS 3.4 |
| Database | SQLite with Prisma ORM |
| AI | Anthropic SDK + Claude API |
| UI Components | Shadcn UI (Radix UI primitives) |
| State Management | React Hooks |
| Markdown | react-markdown + remark-gfm |
| Code Highlighting | Prism.js |
| PDF Rendering | pdfjs-dist |
- Node.js 18.0 or higher
- npm (comes with Node.js)
- Anthropic API Key (Get one here)
# 1. Navigate to the project
cd /Users/mini/Documents/projects/ClaudeLocal
# 2. Install dependencies (already done if coming from setup)
npm install
# 3. Create your secrets file
cp secrets_template.json secrets.json
# 4. Edit secrets.json and add your API key
# {
# "anthropic_api_key": "sk-ant-api03-YOUR-KEY-HERE"
# }
# 5. Initialize database (already done if coming from setup)
npx prisma db push
# 6. Start the development server
npm run dev
# 7. Open http://localhost:3000π For detailed setup instructions, see SETUP.md
ClaudeLocal automatically implements Anthropic's Prompt Caching to save you up to 90% on API costs:
- π Conversation history cached automatically
- π Project instructions cached across all project conversations
- β±οΈ 5-minute cache TTL - perfect for active conversations
- π΅ Huge savings - 20-message conversation costs ~80% less
- π§ Zero configuration - works automatically out of the box
Example: A 10-message conversation that would normally cost $0.15 now costs ~$0.03!
See PROMPT_CACHING.md for technical details.
ClaudeLocal/
βββ app/ # Next.js App Router
β βββ api/ # API Routes
β β βββ chat/ # Streaming chat endpoint
β β βββ conversations/ # Conversation CRUD
β β βββ models/ # Model listing
β β βββ projects/ # Project management
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
β βββ globals.css # Global styles
βββ components/ # React Components
β βββ chat/ # Chat UI (MessageList, MessageInput, MessageBubble)
β βββ sidebar/ # Sidebar (ConversationList, ProjectSelector)
β βββ preview/ # File previews (PDF, Image, Markdown, Code)
β βββ model/ # Model picker
β βββ ui/ # Shadcn UI base components
βββ lib/ # Utilities
β βββ db.ts # Prisma client singleton
β βββ secrets.ts # API key management
β βββ utils.ts # Helper functions (cn, etc.)
βββ prisma/ # Database
β βββ schema.prisma # Database schema
β βββ dev.db # SQLite database file
βββ types/ # TypeScript Types
β βββ index.ts # Shared type definitions
βββ public/uploads/ # File uploads storage
βββ secrets.json # API keys (create from template)
βββ secrets_template.json # Template for secrets
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run db:push # Sync database with schema
npm run db:studio # Open Prisma Studio (database GUI)
npm run db:migrate # Create database migration
npm run db:generate # Generate Prisma Client- Open http://localhost:3000
- Click "New Chat" button in the sidebar
- Select a Claude model from the dropdown
- Type your message and press Enter to send
- Rename: Hover over a conversation β Click β― β Rename
- Archive: Hover over a conversation β Click β― β Archive
- Delete: Hover over a conversation β Click β― β Delete
- Search: Use the search box in the sidebar to filter conversations
- Create a new project (Projects feature in sidebar)
- Add custom instructions for the project
- Upload knowledge base files (PDF, markdown, code)
- Start conversations within the project context
- Enter - Send message
- Shift+Enter - New line in message
- Ctrl/Cmd+K - Focus search (coming soon)
- Ctrl/Cmd+N - New chat (coming soon)
Edit the CLAUDE_MODELS array in types/index.ts to add/remove models.
- Edit
prisma/schema.prisma - Run
npx prisma db pushto apply changes - Run
npx prisma generateto update the client
Edit the CSS variables in app/globals.css under :root and .dark selectors.
See SETUP.md for common issues and solutions.
- β
API keys stored in
secrets.json(gitignored) - β All sensitive operations server-side only
- β SQLite database local to your machine
- β No data leaves your system except API calls to Anthropic
- β
File uploads stored locally in
public/uploads/
This is a personal project template. Feel free to fork and customize for your own use!
MIT
Built with Claude Code by Anthropic π€