``` ██╗ ██╗██╗ ██╗ █████╗ ███████╗██╗ ██████╗ ██████╗ ██║ ██╔╝██║ ██║██╔══██╗██╔════╝██║ ██╔═══██╗██╔══██╗ █████╔╝ ███████║███████║█████╗ ██║ ██║ ██║██████╔╝ ██╔═██╗ ██╔══██║██╔══██║██╔══╝ ██║ ██║ ██║██╔══██╗ ██║ ██╗██║ ██║██║ ██║███████╗███████╗╚██████╔╝██║ ██║ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ``` ### The autonomous engineer whose every decision you can replay, fork, and diff. [![version](https://img.shields.io/badge/version-0.2.0-FF6B35?style=for-the-badge&labelColor=0B0E14)](https://www.khaelor.sh) [![tests](https://img.shields.io/badge/tests-698%20passing-7EE787?style=for-the-badge&labelColor=0B0E14)](#development) [![node](https://img.shields.io/badge/node-%E2%89%A5%2022-2DD4BF?style=for-the-badge&labelColor=0B0E14)](package.json) [![powered by](https://img.shields.io/badge/powered%20by-Anthropic-FFB86B?style=for-the-badge&labelColor=0B0E14)](https://www.anthropic.com) [![terminal-native](https://img.shields.io/badge/terminal-native-C9D1E3?labelColor=0B0E14)](https://www.khaelor.sh/docs/theming.html) [![event-sourced](https://img.shields.io/badge/sessions-event--sourced-C9D1E3?labelColor=0B0E14)](https://www.khaelor.sh/docs/events.html) [![phase gates](https://img.shields.io/badge/workflow-understand%20%E2%86%92%20design%20%E2%86%92%20implement-FF6B35?labelColor=0B0E14)](https://www.khaelor.sh/docs/phases.html) [![verify always](https://img.shields.io/badge/verify-always%2C%20even%20at%203AM-F0B429?labelColor=0B0E14)](https://www.khaelor.sh/docs/verification.html) [![no invented numbers](https://img.shields.io/badge/invented%20numbers-0-7EE787?labelColor=0B0E14)](#the-honesty-contract) **[Website](https://www.khaelor.sh)** · **[Docs](https://www.khaelor.sh/docs/getting-started.html)** · **[Cookbook](https://www.khaelor.sh/docs/cookbook.html)** · **[The daemon](https://www.khaelor.sh/docs/daemon.html)** · **[Architecture](https://www.khaelor.sh/docs/architecture.html)**
--- 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 ```sh curl -fsSL https://www.khaelor.sh/install.sh | sh # hosted installer # or npm install -g khaelor ``` ```sh export 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](https://www.khaelor.sh/docs/phases.html)** | "Understand → design → implement" is a *runtime mechanism*. Write tools stay locked until a design artifact is approved. `--gate strict\|auto\|off` | | ⟳ | **[Native verification](https://www.khaelor.sh/docs/verification.html)** | After each edit batch KHAELOR runs *your* typecheck/tests/lint itself and repairs failures in a bounded loop — before handing back | | ⑂ | **[Fork · replay · sdiff](https://www.khaelor.sh/docs/fork-replay.html)** | `/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](https://www.khaelor.sh/docs/repograph.html)** | `symbols` finds definitions with signatures; `refs` maps callers/callees/importers before an edit. Skeletons instead of whole files | | ✎ | **[Memory with provenance](https://www.khaelor.sh/docs/memory.html)** | The agent maintains `.khaelor/MEMORY.md` itself — every entry anchored to the exact session + event that produced it | | ⇄ | **[Parallel worktrees](https://www.khaelor.sh/docs/worktrees.html)** | `/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: ```sh 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/8 ``` Every 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](https://www.khaelor.sh/docs/daemon.html)** ## 🧾 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 /quit ``` - `Ctrl+K` universal palette · `@` fuzzy file mentions · `!cmd` shell mode · `Esc` interrupt - **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-tui` prints detected capabilities *with reasons* · `--splash` for 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/`](docs/) · v2 notes in [`docs/V2_IMPLEMENTATION.md`](docs/V2_IMPLEMENTATION.md)
🧪 Development ```sh 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, locally ``` V1/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](https://www.khaelor.sh)** — *run it twice, diff the runs.* Simon-Pierre Boucher · [contact@spboucher.ai](mailto:contact@spboucher.ai)