██╗ ██╗██╗ ██╗ █████╗ ███████╗██╗ ██████╗ ██████╗
██║ ██╔╝██║ ██║██╔══██╗██╔════╝██║ ██╔═══██╗██╔══██╗
█████╔╝ ███████║███████║█████╗ ██║ ██║ ██║██████╔╝
██╔═██╗ ██╔══██║██╔══██║██╔══╝ ██║ ██║ ██║██╔══██╗
██║ ██╗██║ ██║██║ ██║███████╗███████╗╚██████╔╝██║ ██║
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝The autonomous engineer whose every decision you can replay, fork, and diff.
Website · Docs · Cookbook · The daemon · Architecture
KHAELOR is not another coding-agent clone. It designs before it implements, verifies before it claims done, and writes every action — even the ones at 3 AM — into an append-only log you can audit. Autonomy without auditability is scary. KHAELOR ships auditable autonomy.
Understand first. Design second. Implement third. Verify always — even at 3 AM.⚡ Install
curl -fsSL https://www.khaelor.sh/install.sh | sh # hosted installer
# or
npm install -g khaelorexport ANTHROPIC_API_KEY=sk-ant-...
cd your-project
khaelor🔥 What a session looks like
KHAELOR ▸ my-project · main
❯ fix the memory leak in the renderer
├─ symbols "RenderBuffer" · 3 hits · 12ms
├─ refs appendLine · callers · 14 sites
╰─ read src/tui/render.ts · 240 lines
◑ design submitted · 2 files · replace growing buffer with a ring
✓ design auto-approved · 2 files
├─ edit src/tui/render.ts +31 −12
╰─ edit src/tui/buffer.ts +8 −3
⟳ verify typecheck ✓ 1.2s · tests ✓ 4.1s · lint ✓
✓ verified 4.1s
● IMPLEMENT ─ main │ sonnet │ ▰▰▰▱▱▱▱▱ 38% │ in 45k · out 3.2k🏛️ Six things no other CLI agent does together
| Feature | The point | |
|---|---|---|
| ◐◑● | Phase gates | "Understand → design → implement" is a runtime mechanism. Write tools stay locked until a design artifact is approved. --gate strict|auto|off |
| ⟳ | Native verification | After each edit batch KHAELOR runs your typecheck/tests/lint itself and repairs failures in a bounded loop — before handing back |
| ⑂ | Fork · replay · sdiff | /fork any checkpoint. /replay a run with another model in a throwaway worktree. /sdiff the two runs. Run it twice, diff the runs |
| ◈ | Semantic index | symbols finds definitions with signatures; refs maps callers/callees/importers before an edit. Skeletons instead of whole files |
| ✎ | Memory with provenance | The agent maintains .khaelor/MEMORY.md itself — every entry anchored to the exact session + event that produced it |
| ⇄ | Parallel worktrees | /spawn subtasks in isolated git worktrees with attenuated capabilities. Supervised --no-ff merges. Your working copy is never touched |
🌙 khaelord — the engineer that lives
A persistent daemon with structured, event-sourced goals — not a prose checklist:
khaelord goal add "keep npm deps fresh without breaking changes" \
--type maintain --schedule "0 6 * * 1" --budget 5 --escalation draft-pr
khaelord start 03:12 ● goal deps-fresh check failed → run r7f2 in worktree khaelor/goal-r7f2
03:14 ◑ design recorded · 3 files · in the log, replayable
03:17 ✓ verified · typecheck ✓ tests ✓ · branch left for review
03:17 spent today: $1.84 / $20 · runs 1/8Every run: throwaway worktree → phase gates (even at night) → mandatory verification → hard budget ceilings → async approval queue (a suspended run costs zero). Every decision: one line in an event log you can replay the next morning. → The daemon
🧾 The honesty contract
| Costs & tokens | summed from real API usage metadata — never estimated, never invented |
| Test results | your own commands, real exit codes, errors-first truncation |
| History | append-only JSONL, torn-write recovery, byte-exact replay |
| Permissions | capability-based, deny > ask > allow — silence is never consent |
| 3 AM decisions | one event log per goal run — Enter replays exactly what happened |
🎛️ Inside the TUI
/phase /verify /fork /replay /sdiff /memory /spawn /tasks /merge /goals ← v2
/model /config /permissions /context /sessions /resume /new /compact
/cost /status /diff /processes /help /quitCtrl+Kuniversal palette ·@fuzzy file mentions ·!cmdshell mode ·Escinterrupt- Type while it works — steering messages queue and inject at a safe seam
- Theme khaelis (obsidian + magma), OKLCH gradients, truecolor → 256 → 16 → mono ladder
khaelor --doctor-tuiprints detected capabilities with reasons ·--splashfor the opening moment
🏗️ Architecture — a deliberately small kernel
KHAELOR TUI ──── khaelord (daemon)
│ │
▼ ▼
Session Engine (JSONL event log)
│
▼
Agent Kernel ← deriveNext(state) — a pure fold
┌───────────────┼───────────────────┐
▼ ▼ ▼
Context Engine Tool Runtime Model Runtime
(tiers, cache, (permissions, (Anthropic SDK,
compaction) phase gate, streaming)
│ verify loop)
▼ ▼
RepoGraph Workspace ── the ONLY fs/process seam
Memory │
Phases Files · Processes · Git worktrees- 40 durable event types — everything is a fold over the log: the conversation, the costs, the diffs, the phases, even "what should happen next"
- 11 tools — read · write · edit (9-strategy replacer) · grep · glob · bash · process · design · remember · symbols · refs
- Custom ANSI renderer — print-once scrollback, bounded live region, 16 ms coalesced frames, sub-millisecond input latency
- Design docs in
docs/· v2 notes indocs/V2_IMPLEMENTATION.md
🧪 Development
npm install
npm run check # typecheck + eslint + 698 tests + mandatory header check
npm run dev # run from source
npx tsx src/tui/demo.ts # TUI demo with mocked model events
node website/server.mjs # the docs site, locallyV1/V2 are Anthropic-only by design. The model layer is isolated behind a single ModelClient
interface — clean architecture, not a provider framework.
www.khaelor.sh — run it twice, diff the runs.
Simon-Pierre Boucher · contact@spboucher.ai