draht logo draht   /dʁaːt/
· built in Dortmund · MIT N° 001 / MONOREPO · 15 PACKAGES HANDGEFERTIGT — OSKAR FREYE, MMXXVI
Dynamic Routing for Agent & Task Handling — handgefertigt in Dortmund

draht. The right model for every task. Test before code, domain before edits, orchestration where it pays for itself.

Draht is German for wire. It's a GSD workflow engine for coding agents: picks the cheapest model that can actually do the step, writes the test before the code, checks your domain model before editing anything, and logs every call so you can hand an auditor a PDF.
MIT · 15 packages · 17 providers · no telemetry
A.
Claude Code plugin
You have a Claude Max or Pro subscription. Keep it.
$ npx draht-claude install

Routing, TDD, orchestration, and audit logs slot into the Claude Code session you already use.

B.
Standalone CLI
Everyone else. API keys, OAuth, self-hosted — your call.
$ bun add -g @draht/coding-agent

Full agent, seventeen providers. Works with or without a Claude subscription.

§ 01
Wie es funktioniert — how it works
Three wires, one circuit
I. Route

The right model, every time.

The Model Router grades each task on reasoning depth, context size, and latency budget, then hands it to the cheapest model that can actually do it. Haiku for scaffolds, Sonnet for refactors, Opus when the architecture is genuinely hard. You stop paying Opus prices for boilerplate.

II. Test

TDD-first, DDD-native.

The agent writes a failing test before it writes any implementation. It reads your domain model first — bounded contexts, aggregates, the names you actually use — and edits through that vocabulary. It can't commit past a red bar.

III. Ship

Parallel, observable, audit-ready.

The Orchestrator runs independent work across sub-agents in parallel. The CI guardian blocks broken merges before they land. The compliance layer logs every model call with enough provenance to pass a GDPR audit or an invoice review — whichever comes first.

§ 02
Die Werkbank — the workbench
17 providers · 1 router · 0 lock-in
~/projects/atelier · draht
F/01

Routing you can read.

Policies are plain TypeScript. Match on file glob, task type, context size, or budget, then route to Haiku, Sonnet, Opus, GPT, Gemini, or something self-hosted. Override per repo, per branch, per session.

F/02

Sessions that branch.

Every run is a tree in a single JSONL file. Jump back, fork a branch, swap the routing profile, come back. Nothing is thrown away, and every token you spent is still on disk if you need to prove it.

F/03

Sub-agents that finish.

The orchestrator splits work that doesn't depend on itself, runs the pieces in parallel, and merges the diffs back. Each sub-agent runs on Haiku where Haiku can handle it, and every step lands in the log.

F/04

Four modes of operation.

Interactive REPL, print mode, JSON event stream, or RPC over stdin/stdout. Drop draht into CI, a cron job, or a Slack bot. Embed the SDK if you'd rather wire it into your own app.

§ 03
Das Sortiment — fifteen packages, one mono-repo
MIT licensed · pnpm workspace
№ 01
@draht/router the dispatcher
Grades tasks by complexity and routes to the cheapest capable model. Haiku, Sonnet, Opus, GPT, Gemini — one policy, seventeen providers.
CORE
№ 02
@draht/orchestrator the conductor
Runs sub-agents in parallel across independent work. Merges their output, resolves conflicts, hands back a single diff.
CORE
№ 03
@draht/knowledge the domain
Living DDD model of your codebase — bounded contexts, aggregates, ubiquitous language. The agent reads it before it writes.
CORE
№ 04
@draht/tdd the red bar
Enforces red-green-refactor. No implementation commits until a failing test exists. Works with vitest, bun test, jest, pytest.
CORE
№ 05
@draht/ci the gate
Runs the agent's changes through your real pipeline before they land. Fails loud, retries narrow, never waves things through.
OPS
№ 06
@draht/deploy-guardian the sentinel
Canary rollouts, SLO watching, one-click rollback. The agent can ship to prod; the guardian decides when to pull the cord.
OPS
№ 07
@draht/invoice the ledger
Per-task, per-model cost tracking. Export freelancer-ready invoices with token breakdowns and time logs. VAT-aware.
BIZ
№ 08
@draht/compliance the notary
GDPR-aware logging, data-residency routing, signed audit trail of every model call. For when your client's lawyer asks.
BIZ
№ 09
@draht/templates the patterns
Opinionated starters — SaaS, API, CLI, freelance repo. Pre-wired with router policies, test harness, domain scaffolds.
LIBRARY
№ 10
draht-claude the bridge
Installs draht as a Claude Code plugin — keep your subscription, gain routing, TDD, orchestration. Zero config.
PLUGIN
№ 11
@draht/cli the standalone
Terminal-native agent with everything wired in. API keys or OAuth; works without Claude Code.
CLI
№ 12
@draht/ai the primitives
Unified API for OpenAI, Anthropic, Google & fourteen others. Streaming, tools, thinking levels, cache control.
LIBRARY
№ 13
@draht/extensions the slots
Extension host — skills, prompt packs, custom tools, UI panels. Everything bendable is a TypeScript module.
LIBRARY
№ 14
@draht/tui the loom
Terminal UI library with differential rendering. What the standalone CLI is woven from.
LIBRARY
№ 15
@draht/pods the foundry
CLI for managing vLLM deployments on GPU pods. Spin up, rotate, retire self-hosted models from the command line.
OPS
§ 04
Philosophie — six principles, non-negotiable
How draht decides, so you don't have to.
i.
— Cheapest capable model —
Route, don't default.

No single model is right for every task. The router grades the work and assigns accordingly. You pay for Opus only when Opus is what the job requires.

ii.
— Red before green —
Test first, always.

The failing test is the specification. The agent can't commit any implementation until a test exists, fails, and then passes. If you don't want TDD, draht is the wrong tool.

iii.
— Language of the domain —
DDD is not optional.

Bounded contexts, aggregates, the words your team actually uses. The agent reads your domain model first and edits through that vocabulary. Otherwise it's guessing, and guessing gets expensive.

iv.
— Parallel by default —
Orchestrate, don't serialise.

Independent work runs in parallel sub-agents. The orchestrator merges results. One long task becomes three short ones.

v.
— Receipts for everything —
Audit is a feature.

Every model call is logged, costed, and invoiceable. Whether it's your client's auditor asking, the Finanzamt, or you trying to remember what happened last quarter, the receipt is on disk.

vi.
— Boring ships —
No hidden magic.

Policies are files. State lives on disk. The harness is TypeScript you can read through in an afternoon. If something surprises you, it's because you haven't opened the file yet.

§ 05
Preise — two ways to pay, one way to use
Open source forever · paid setup optional
Tier I
Open Source
MIT · self-serve
€0forever
No account · no telemetry
  • All 15 packages, full source
  • Router, orchestrator, TDD, DDD
  • Claude Code plugin & standalone CLI
  • Community Discord, GitHub issues
  • You bring your own API keys
Clone the repo →
Tier III
Team & Audit
Custom · on request
let's talk
Typical engagement 4–12 weeks
  • On-prem / air-gapped deployment
  • Custom router policies & extensions
  • Compliance review: GDPR, AI Act, ISO
  • Training sessions for the whole team
  • Dedicated Signal channel
Write Oskar →
© MMXXVI Oskar Freye · MIT licensed · set in Instrument Serif & Geist Mono · Dortmund · Gemeinnützig im Geist