jakemor/kanna
A beautiful web-based UI for Claude Code & Codex
What is Kanna?
Kanna is a web-based interface (a page that opens in your browser) for two popular command-line AI coding tools: Claude Code and Codex. Normally you'd interact with these tools by typing commands in a terminal; Kanna gives you a visual, chat-like window instead.
It's built with Bun (a JavaScript runtime) and installed as a global package. Once installed, you run kanna from any project folder, and it opens at localhost:3210 in your browser.
What does it do?
Think of it as a control panel and chat window for AI coding agents. Instead of watching raw terminal output, you get:
- A chat interface where you can switch between AI providers — Claude, Codex (OpenAI), Cursor, Grok Build, and Pi — and pick models per provider.
- A sidebar that groups your chats by project, with live status indicators (idle, running, waiting, failed). You can drag-and-drop to reorder projects.
- Rich message rendering — tool calls are shown as expandable groups, plan-mode dialogs appear for approval, and interactive prompts display their full results.
- Plan mode — review and approve what the agent wants to do before it executes.
- Auto-generated chat titles (via Claude Haiku) and session resumption — you can pick up an agent session with full context.
- Local project discovery — it automatically finds projects from both Claude and Codex history.
How it works (architecture)
The system has three layers:
- Browser (React + Zustand) — the UI you see. It communicates with the server over WebSockets (a persistent two-way connection), so updates push to your screen in real time.
- Bun server — the middle layer. It routes commands, coordinates multiple AI providers, normalizes their differences, stores events, and derives view models for the UI.
- Local CLI agents — the actual AI tools (Claude Agent SDK, Codex App Server, cursor-agent, grok CLI) running as local processes. The server talks to them over stdio (standard input/output).
Key design patterns (explained simply):
- Event sourcing — every state change is recorded as an event in an append-only log. Nothing is overwritten; the log is the source of truth.
- CQRS — writes go to the event log; reads come from derived snapshots. Separate paths for writing and reading.
- Reactive broadcasting — whenever state changes, subscribers get pushed a fresh snapshot automatically.
- Provider-agnostic rendering — transcripts from different providers are normalized into a unified format so the UI renders them consistently.
Requirements
- Bun v1.3.5+ (the runtime)
- A working Claude Code environment
- Codex CLI (optional, only if you want Codex provider support)
- Embedded terminal support works on macOS/Linux (uses Bun's native PTY APIs)
Usage options
Basic:
kanna # start with defaults (localhost only)
kanna --port 4000 # custom port
kanna --no-open # don't auto-open the browser
Security / sharing:
kanna --password <secret> # require a password before the app loads
kanna --share # create a temporary public trycloudflare.com URL + QR code
kanna --cloudflared <token> # run a named Cloudflare tunnel
Network access:
- By default, Kanna binds to
127.0.0.1(localhost only). --remotebinds all interfaces (accessible on your LAN).--host <hostname-or-IP>binds to a specific interface (e.g., a Tailscale IP).--allow-host <name>lets you whitelist specific DNS names (e.g., a reverse proxy hostname).
Where data lives
All state is stored locally at ~/.kanna/data/ as append-only JSONL files (one per event type: projects, chats, messages, turns) plus a compacted snapshot.json for fast startup. On startup, Kanna replays the log tail after the last snapshot and compacts if logs exceed 2 MB.
Development
You can clone the repo and run bun run dev (client + server together), or run them separately (dev:client on port 5174, dev:server on port 5175). The same --remote, --host, --share, and --port flags work in dev mode. There's also a Playwright smoke test suite (bun run test:e2e).
License
MIT.
Related
- Project
- Project
- Project
- Project
- Project