KHAELOR
The autonomous engineer whose every decision you can replay
KHAELOR understands first, designs second, implements third, and verifies always — writing every action, even the ones at 3 AM, into an append-only log you can fork, replay, and diff.
698
Tests passing
40
Durable event types
11
Tools in the runtime
16 ms
Coalesced render frames
6
Capabilities no other CLI agent combines
0
Invented numbers — real API metadata only
Overview
KHAELOR is not another coding-agent clone. It is a terminal-native autonomous engineering agent built on a deliberate discipline — understand first, design second, implement third, verify always — enforced at runtime, not just in a prompt. Write tools stay locked behind phase gates until a design artifact is approved.
Every session is event-sourced: an append-only JSONL log with torn-write recovery and byte-exact replay, where the conversation, costs, diffs, and phases are all pure folds over the same history. That makes runs auditable by construction — you can /fork any checkpoint, /replay a run with another model in a throwaway worktree, and /sdiff the two runs.
Beyond the interactive TUI, khaelord is a persistent daemon that pursues structured, event-sourced goals on a schedule: throwaway worktrees, phase gates even at night, mandatory verification, hard budget ceilings, and an async approval queue where a suspended run costs zero. Every overnight decision is one line in a log you replay the next morning.
Key Features
Phase gates
Understand → design → implement is a runtime mechanism — write tools stay locked until a design artifact is approved, with strict, auto, or off modes.
Native verification
After each edit batch KHAELOR runs your own typecheck, tests, and lint, repairing failures in a bounded loop before handing back.
Fork, replay, sdiff
Fork any checkpoint, replay a run with another model in a throwaway worktree, then diff the two runs side by side.
Semantic repo index
The symbols and refs tools find definitions with signatures and map callers, callees, and importers before an edit — skeletons instead of whole files.
Memory with provenance
The agent maintains its own MEMORY.md, with every entry anchored to the exact session and event that produced it.
Parallel worktrees
Spawn subtasks in isolated git worktrees with attenuated capabilities and supervised no-fast-forward merges — your working copy is never touched.
khaelord daemon
A persistent daemon runs structured, scheduled goals overnight with hard budget ceilings, mandatory verification, and an approval queue where a suspended run costs zero.
The honesty contract
Costs come from real API usage metadata, test results from real exit codes, and permissions are capability-based where silence is never consent.
Custom ANSI renderer
Print-once scrollback, a bounded live region, 16 ms coalesced frames, and sub-millisecond input latency keep the TUI instantaneous while the model thinks.
How It Works
Understand
The context engine builds tiered context from the semantic RepoGraph — symbols with signatures and reference maps of callers, callees, and importers — feeding the model skeletons instead of whole files.
Design
Phase gates keep all write tools locked until the agent submits a design artifact and it is approved, so implementation never starts before a plan exists.
Implement
The tool runtime executes 11 tools — including a 9-strategy edit replacer — through the Workspace, the single filesystem and process seam, under capability-based deny > ask > allow permissions.
Verify
After each edit batch KHAELOR runs the project's own typecheck, tests, and lint with real exit codes, repairing failures in a bounded loop before claiming anything is done.
Record and replay
Every step appends to a JSONL event log with torn-write recovery; the session state is a pure fold over 40 durable event types, enabling byte-exact replay, forking, and run-vs-run diffing.
Tech Stack
Core
AI Runtime
Terminal
Quality & Tooling
Highlights
- Six capabilities no other CLI agent ships together: phase gates, native verification, fork/replay/sdiff, semantic index, memory with provenance, parallel worktrees
- Byte-exact session replay from an append-only JSONL log with torn-write recovery
- 698 passing tests behind a single npm run check with typecheck, lint, and header enforcement
- khaelord runs autonomous overnight goals under hard budget ceilings — a suspended run costs exactly zero
- Custom ANSI renderer delivers sub-millisecond input latency with 16 ms coalesced frames
- Zero invented numbers: every cost, token count, and test result comes from real API metadata and real exit codes
Explore KHAELOR
The autonomous engineer you can replay — the full source is on GitHub.