draht logo draht   /dʁaːt/
· built in Dortmund · MIT N° 001 / MONOREPO · 15 PACKAGES HANDGEFERTIGT — OSKAR FREYE, MMXXVI
Dynamic routing for coding agents — handgefertigt in Dortmund

draht.

Use the right model. Test before code. Read the domain. Orchestrate when it saves time.

Draht is German for wire. It routes coding-agent work. It picks the cheapest model for each step. It writes tests before code. It reads your domain model. It logs each call for audit or billing.
License
MIT
Packages
15
Providers
17
Telemetry
0
A.
Claude Code plugin
You have Claude Max or Pro. Keep it.
$ npx draht-claude install

Add routing, TDD, orchestration, and audit logs to Claude Code.

B.
Standalone CLI
Use API keys, OAuth, or your own models.
$ bun add -g @draht/coding-agent

Run the full agent across 17 providers. Claude is not required.

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

Use the right model.

The router scores each task by reasoning, context, and latency. It sends simple work to cheap models. It saves Opus for hard architecture. You stop paying Opus rates for boilerplate.

II. Test

Test first. Use the domain.

The agent writes a failing test before code. It reads bounded contexts, aggregates, and your team names. It edits in that language. Red tests block commits.

III. Ship

Run, watch, prove.

The orchestrator runs independent work in parallel. CI blocks broken merges. The log records every model call, cost, and source. Use it for GDPR audits or invoice review.

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

Routing you can read.

Policies are TypeScript. Match file glob, task type, context size, or budget. Route to Haiku, Sonnet, Opus, GPT, Gemini, or your own model. Override per repo, branch, or session.

F/02

Sessions that branch.

Every run writes a tree to one JSONL file. Jump back. Fork a branch. Swap the routing profile. Return later. Token costs stay on disk.

F/03

Sub-agents that finish.

Seven specialists handle architecture, code, review, debug, verify, security, and git. You set the model for each one. Split work runs in parallel. Ordered work stays ordered. Commits use red:/green:/refactor: discipline.

F/04

Four ways to run.

Use the REPL, print mode, JSON events, or RPC over stdin/stdout. Run draht in CI, a cron job, or a Slack bot. Embed the SDK in your app.

§ 03
Das Sortiment — fifteen packages, one mono-repo
MIT licensed · pnpm workspace
№ 01
@draht/router the dispatcher
Scores tasks and routes them to the cheapest model that can do the work. One policy covers Haiku, Sonnet, Opus, GPT, Gemini, and 12 more providers.
CORE
№ 02
@draht/orchestrator the conductor
Runs sub-agents in parallel for split work. Merges output, resolves conflicts, and returns one diff.
CORE
№ 03
@draht/knowledge the domain
Keeps a DDD map of your codebase: contexts, aggregates, and team words. The agent reads it before it writes.
CORE
№ 04
@draht/tdd the red bar
Enforces red-green-refactor. Code cannot commit until a failing test exists. Works with vitest, bun test, jest, and pytest.
CORE
№ 05
@draht/ci the gate
Runs agent changes through your real pipeline before they land. Fails loud. Retries narrow. Never waves work through.
OPS
№ 06
@draht/deploy-guardian the sentinel
Handles canary rollout, SLO checks, and rollback. The agent can ship to prod. The guardian can pull the cord.
OPS
№ 07
@draht/invoice the ledger
Tracks cost by task and model. Exports invoices with token counts, time logs, and VAT fields.
BIZ
№ 08
@draht/compliance the notary
Logs for GDPR, routes by data region, and signs each model-call record. Ready when a client asks.
BIZ
№ 09
@draht/templates the patterns
Ships starters for SaaS, API, CLI, and freelance repos. Each includes router policy, tests, and domain scaffold.
LIBRARY
№ 10
draht-claude the bridge
Installs draht in Claude Code. Keep your subscription. Add routing, TDD, and orchestration with no config.
PLUGIN
№ 11
@draht/cli the standalone
Runs the full agent in your terminal. Use API keys or OAuth. Claude Code is not required.
CLI
№ 12
@draht/ai the primitives
Unifies OpenAI, Anthropic, Google, and 14 other providers. Streams text, tools, thinking levels, and cache control.
LIBRARY
№ 13
@draht/extensions the slots
Hosts skills, prompt packs, custom tools, and UI panels. Each extension is a TypeScript module.
LIBRARY
№ 14
@draht/tui the loom
Renders the terminal UI with diff-based updates. The standalone CLI uses it.
LIBRARY
№ 15
@draht/pods the foundry
Manages vLLM deployments on GPU pods. Start, rotate, and retire self-hosted models from the command line.
OPS
§ 04
Philosophie — six principles, non-negotiable
How draht decides for you.
i.
— Cheapest model that works —
Route, don't default.

No model fits every task. The router scores the work and picks the cheapest model that can do it. You pay for Opus when the job needs Opus.

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

The failing test is the spec. The agent must create a test, watch it fail, and make it pass before it commits code. If you skip TDD, skip draht.

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

Bounded contexts, aggregates, and your team's words guide edits. The agent reads that model first. Guessing costs money.

iv.
— Parallel by default —
Split work. Don't queue it.

Run independent work in parallel sub-agents. The orchestrator merges the output. One long task becomes three short tasks.

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

Log every model call, cost, and billable step. The receipt sits on disk for clients, auditors, tax, or your own memory.

vi.
— Boring ships —
No hidden magic.

Policies are files. State lives on disk. The harness is TypeScript. You can read it in an afternoon. If something surprises you, open the file.

§ 05
Preise — one tool, three ways to adopt it
Self-serve · guided · implemented
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
  • Bring your own API keys
Clone the repo →
Tier III
Team Rollout
Implemented · custom scope
€12,000from
plus VAT · typical engagement 4–8 weeks
  • Pilot repository & rollout plan
  • Custom router policies & extensions
  • Governance and audit baseline
  • Team workshop & technical handover
  • On-prem / air-gapped work scoped separately
Scope the rollout →
© MMXXVI Oskar Freye · MIT licensed · set in Instrument Serif & Geist Mono · Dortmund · Gemeinnützig im Geist