Five roles, no fixed model · Claude, Codex and local models as workers · 15,399 lines of TypeScript · zero runtime dependencies · 19 decision records
The brain stays put. The models are swappable workers.
Krang owns the context, memory, permissions and state, and hands the actual work to whichever model is configured: a hosted agent, a second hosted agent or a model on my own hardware.
Overview
Krang is the harness I run my own agents through. It decides what needs doing and holds the context and the record of what happened. The work itself goes to a model. Which model is configuration, not architecture.
Most agent tooling ties the system to whichever model it was built around. Change provider and you rebuild the prompts, the memory and the workflow. Krang inverts that. The roles, the state and the rules are Krang’s, and Claude, Codex and local models are interchangeable workers underneath.
It runs on one machine, keeps its state on disk and needs no cloud service. The engine has zero runtime dependencies: the CLI runs TypeScript directly through Node’s type stripping, so a fresh machine needs a checkout and Node 22.
The problem
I work across my own company, my own products and an employer, on one laptop. Each needs agents. None of them may see the others’ material.
Hosted agent products solve a narrower problem. They give you one model, one company’s servers and one place your prompts and transcripts live. I wanted the opposite set of guarantees: the model replaceable at any time, the state on my own disk and a hard wall between contexts that a commit can’t cross by accident.
What I built
Five roles, no fixed model
| Role | Remit |
|---|---|
| KRANG | Holds context, decides what needs doing, delegates, tracks what’s open |
| SPLINTER | Business and strategy: why, what it costs, what it risks |
| ROCKSTEADY | Engineering: code, git, PRs, tests, deployment |
| BEBOP | Research: evidence, comparisons, sources. Cheap tier by default |
| SHREDDER | Red team: assumes the others are wrong and tries to prove it |
SHREDDER is the one most systems don’t have. Every other role is cooperative, so nothing is tasked with assuming the output is wrong. The adversary is structural rather than a mood the others are asked to adopt. It runs on the strongest model available and only when invoked on purpose, because an adversarial pass on everything trains you to skim it.
A provider chain resolved late
The working order is claude → codex → local, resolved at the moment of use. When one provider’s allowance runs out, the next picks up the work.
The constraint behind it: you can’t ask a hosted agent whether you have credit without spending some. So availability is never a question to the vendor. It is assembled from three cheap local facts: is the command installed, has it recently failed in a way that means “not now”, and has a human said not to use it.
State is files
A board card’s state is the directory it sits in. Claiming a card is a single rename, which the filesystem makes atomic, and it held 100 out of 100 under concurrency on APFS. Everything else is append-only JSONL folded on read, so two machines can append at once and merge without one edit overwriting the other.
A boundary enforced, not documented
core/ is the engine and never names an instance. instances/ holds the private material, and its state lives outside git. A pre-commit check scans tracked content for client names, product names, home paths and credential shapes. The patterns it hunts for are supplied at runtime and never committed, because a list of the words you’re hiding leaks the same thing as the words.
Where it is
The CLI, boards, supervisor, provider chain, worktree workspaces, handoffs between sessions and a 15-card benchmark harness are built and tested: 30 test files under Node’s own runner. 19 decision records carry the reasoning, including the ones that turned out wrong.
It is licensed Apache-2.0 and in a pre-release audit. Once it’s clean it goes open source, with krang.ie as its home, and the benchmark becomes the tool I use to compare models on my own work rather than on someone else’s leaderboard.
Outcome
One machine, no cloud service, no runtime dependencies. A provider chain that falls back from one hosted agent to another to a local model, a board where a card's state is its directory, and a benchmark of 15 machine-checked cards that now doubles as a way to compare models.
Tech
- TypeScript
- Node.js type stripping
- node:test
- Git worktrees
- Append-only JSONL
- Ollama
- Claude Code
- Codex
- launchd
- ESLint
- GitHub Actions