Open source · Apache-2.0 · v0.0.1

Give your coding agent
a memory, a budget and
a definition of done.

Ktesio Build adds project memory, context packs, model routing and verification to the agent you already use. It isn't an agent itself: your host still runs the conversation. It ships as one Rust binary, ktb.

$ brew install ktesio/tap/ktb
$ cd your-repo
$ ktb init     # sets up every host it finds
$ ktb doctor   # what each host can do here

Runs inside Claude Code, Codex, GitHub Copilot CLI and ZCode.

  • $5.53Ktesio Build
  • $5.93plain Claude Code
  • $13.81SpecKit
  • $17.94BMAD

Cost of two chained features in a 177k-line repo. All four passed the same hidden tests. Benchmarks

> /kb-build add per-key rate limits to the public API

plan

4 tasks · 3 groups · a tier for each

1limiter trait and configbalanced

2token bucket per keypublic-apideep

3429 with Retry-Afterbalanced

4docs: rate limitsfast

guard

4 calls · 1 question for you

settledcounters live in Redisdec-06c2yb · last feature

assumerefill 10 req/s per keyleash 2

probemiddleware orderread the code

askburst limit on the free tier?a) 20 b) 50 c) none

run

verify each task · one commit per pass

1balanced✓ check ✓ tests ✓ rules3e1f9a2

2deep✓ check ✓ tests ✓ rules8b04c7d

3balanced✗ tests failed · retry ✓c51d0e6

4fast✓ check ✓ tests ✓ rulesf7a2b19

commit

c51d0e6 Return 429 with Retry-After

Ktesio-Task: tsk-1m7qe2

Ktesio-Intent: int-4k2m9p

Ktesio-Assumption: asm-7q1x0d

done

4 commits · 1 assumption to settle

A shortened kb-build run. Task names and ids are examples.

Benchmarks

Same features, same prompt, hidden tests.

Each flow builds the same features from the same prompt in a fresh copy of the repo. A run passes only on acceptance tests the agent never sees. Cost is what Claude Code reports.

Two chained features in a 177k-line Rust workspace

cost for both steps · lower is better · all passed 2/2

  • Ktesio Build$5.53
  • plain Claude Code1.1x$5.93
  • SpecKit2.5x$13.81
  • BMAD3.2x$17.94

The second feature cost less than half of the first.

Ktesio Build spent $4.00 on step 1 and $1.53 on step 2. The router had learned from step 1 and sent the main task straight to the deep tier. The plan reused step 1's decision through recall, without being told.

Three small fixtures

a greenfield CLI, a feature in an existing repo, a refactor · all four flows passed 3/3

Cost lower is better

  • plain Claude Code$1.02
  • Ktesio Build$2.42
  • SpecKit$4.79
  • BMAD$5.27

Wall time lower is better

  • plain Claude Code167 s
  • Ktesio Build408 s
  • BMAD960 s
  • SpecKit970 s

On small repos, plain Claude Code is cheaper. Planning and verifying cost more than they save there. Against SpecKit and BMAD, Ktesio Build is about 2.4x faster at about half the cost.

One sample per flow, so expect run-to-run variance. The Ktesio Build figure on the real repo is a re-run at commit a57d7a6; the other three flows are from the round before it.

Method, caveats and every run

What it adds

Four things. Your agent still does the work.

Ktesio Build doesn't replace your agent or its models. It decides what each task should know, which tier should run it, and when it is done.

01

Project memory

Decisions, intents, contracts and assumptions are small files in .ktesio/, reviewed in PRs like code. The next feature reuses the last one's choices.

.ktesio/decisions/dec-06c2yb.mdkind = "decision"
title = "Hand-rolled synchronous MCP server, not rmcp"
subject = "mcp-server"
paths = ["crates/ktesio-mcp/**"]

A record from this project's own repo.

02

Context packs

Each task gets only the code and records it needs, cut to a token budget. A pack builds in about 15 ms on a 100k-line repo.

fast4,000balanced12,000deep30,000

Default pack budget per tier, in tokens. Set your own in ktesio.toml.

03

Routing

Each task runs on the cheapest tier, fast, balanced or deep, that reliably passes that kind of task. The router learns that from your own outcomes.

docs taskfastpassed first try · $0.015main featuredeeppassed first try · $0.50

Step 2 of the real-repo benchmark, after the router learned from step 1.

04

Verification instead of document gates

A task is done when its check, the repo's tests and your rules pass. Then it gets one commit, with trailers that trace it to its intent and assumptions.

✓the task's own check
✓the repo's tests, type checks and lint
✓your rules for the paths it touched
→ one commit · Ktesio-Task · Ktesio-Intent · Ktesio-Assumption

What ktb verify --commit runs for every task.

How it works

Plan, guard, run, settle.

The kb-build skill walks your agent through four steps. Each step is also a command and an MCP tool, so you can drive it yourself.

  1. Plan

    Your agent lists the tasks and the calls it would make without asking. Ktesio Build picks a tier for each task and groups the ones that can run together.

    ktb plan
  2. Guard

    Each call is assumed, probed or asked, by what it costs to get wrong. At most 3 questions reach you, as one card.

    assumeprobeask
  3. Run and verify

    Each task runs on its tier and is checked. A failure retries, then escalates one tier, then stops only that branch.

    ktb runktb verify
  4. Settle

    Accept or reject the assumptions it made. One screen shows what was built and what it cost; a check finds records that drifted from the code.

    ktb digestktb check

Read how each step works

One binary

An MCP server and a CLI in one file.

ktb is an MCP server with nine tools and a CLI with the same commands, written in Rust. Speed is a budget here, checked in CI.

statusrecallrecordsyncpackplanverifycheckdigest
<20ms
cold start budget, enforced in CI
~15ms
to build a context pack on a 100k-line repo
9
MCP tools, each one also a command
1
binary to install, Apache-2.0

Comparison

Where it wins, and where it doesn't.

All four flows passed every hidden test. They differ in what it took to get there.

Ktesio Buildplain Claude CodeSpecKitBMAD
Real repo · two chained features · 177k lines of Rust
Hidden tests passed2/22/22/22/2
Cost$5.53$5.93$13.81$17.94
Three small fixtures
Hidden tests passed3/33/33/33/3
Cost$2.42$1.02$4.79$5.27
Wall time408 s167 s970 s960 s
In these runs
Model for each taskthe cheapest tier that passes, learned from outcomesthe flow's defaultthe flow's defaultthe flow's default

● best in the row. One sample per flow. Versions and method are on the benchmark pages.

Use Ktesio Build when

features build on each other in a real codebase. On the 177k-line repo it was the cheapest flow, and it carried a decision from the first feature into the second.

Stay with a plain agent when

the repo is small and the work is one-off. On the small fixtures, plain Claude Code finished in 167 s for $1.02. Ktesio Build took 408 s and $2.42.

Coming from SpecKit or BMAD

ktb import brings an existing BMAD or SpecKit repo over. The kb-migrate skill walks your agent through it.

Hosts

Works inside the agent you already use.

ktb init detects your hosts and writes the skills, tier agents and MCP entry each one needs. ktb doctor shows what each host can do in this repo.

Claude Code

Tier routing
.claude/agents/kb-*.md
MCP entry
.mcp.json

Codex

Tier routing
codex exec --profile kb-fast
MCP entry
.codex/config.toml

GitHub Copilot CLI

Tier routing
.github/agents/kb-*.agent.md
MCP entry
.mcp.json

ZCode

Tier routing
.zcode/agents/kb-*.md
MCP entry
.agents/mcp.json

T3 Code drives Claude Code or Codex underneath, so a repo set up for those works in T3 Code as is.

Get started

Try it on a repo you know.

Three steps. Running ktb init again is safe: it rewrites only files whose content changed, and it keeps your edits to ktesio.toml.

  1. Install ktb

    Homebrew · macOS and Linux

    brew install ktesio/tap/ktb

    Cargo · builds from source

    cargo install ktesio-build

    Or download an archive from GitHub Releases and put ktb on your PATH.

    Linux x86_64Linux arm64macOS arm64macOS x86_64Windows x86_64
  2. Set up your repo

    init detects your hosts and writes ktesio.toml, the skills, the tier agents and the MCP entries. doctor shows what each host can do here.

    cd your-repo
    ktb init
    ktb doctor
  3. Build something

    In your agent, start any change with the kb-build skill: /kb-build in Claude Code, $kb-build in Codex.

    /kb-build add rate limits to the API
    kb-buildkb-shapekb-digestkb-checkkb-synckb-migratekb-learnkb-help