A multi-role AI development framework that splits the software engineering loop into four specialized phases — each driven by a dedicated AI agent.
Single-agent coding is fast but fragile. 4x splits the loop so each role has a focused job, limited scope, and no access to the others' reasoning.
The Coder never judges its own work. The Reviewer is adversarial by design. No self-review bias.
Everything lives in .4x/ files. Session dies, machine reboots — run picks up exactly where it stopped.
Switch between Claude, Gemini, Codex, or mix them per role. File-based protocol, no vendor lock-in.
Dependency-aware scheduling. Queue dozens of features overnight, review them in the morning.
Workspace can span multiple independent git repos plus shared hub repos. Every feature runs in its own isolated git worktree — concurrent features never step on each other's files.
Declare each repo's path and mark shared ones as hub — 4x scopes every feature to only the repos it's allowed to touch.
Each feature gets its own linked worktree. No branch switching, no stashing, no collision between features running in parallel.
Guardrail checks reject any diff that touches a repo outside the feature's declared scope — before it ever reaches review.
$ 4x check my-feature ✗ scope violation: repo "payment" not in feature repos feature declares: ["core", "gateway", "web"] diff touches: payment/internal/ledger.go
Acceptance criteria aren't just checked off — each one must carry evidence in verify.json, and a round the guardrail says is unproven can't be accepted.
Every acceptance criterion in verify.json needs a passed flag and an evidence trail. 4x check blocks the round if evidence is missing.
Deep review picks angles based on which files the diff actually touches, instead of running all review angles on every small change.
Tester's verify.json results are cross-checked against actual command exit codes — a claimed PASS with contradicting evidence gets caught automatically.
{
"passed": true,
"commands": [
{ "command": "make test", "exitCode": 0, "summary": "142 passed" }
],
"ac_results": [
{ "id": "AC1", "passed": true,
"evidence": ["go test ./internal/guard/... -run TestScopeViolation -v"] },
{ "id": "AC2", "passed": true,
"evidence": ["make lint: 0 errors"] }
]
}
The dashboard breaks down token usage and duration per phase, so you see exactly where the budget goes before it surprises you.
Tokens, cost, and duration for designing, coding, reviewing, testing — tracked separately, not just a total.
Mix opus for design with sonnet for review and test — the dashboard shows the cost impact of each choice.
Runaway rounds show up immediately in the per-phase view instead of hiding in a single end-of-run total.
Per-step model, duration, and cost — no more end-of-run surprises
Cost tracking currently works with the Claude Code runner only (stream-json output) — other runners don't report per-round cost yet.
Spec & acceptance criteria
Implement from spec
Adversarial inspection
Verify against criteria
go install github.com/ggwhite/4x/cmd/4x@latest
curl -sSfL .../install.sh | sh
Monorepo or multi-repo. Per-role models and instructions. Inject your coding standards, architecture docs, and project rules.
{
"project": {
"name": "my-project",
"language": "go",
"build": ["make build"],
"test": ["make test"],
"lint": ["make lint"],
"docs": ["docs/architecture/overview.md"],
"rules": ["always use structured logging"],
"includes": ["docs/coding-standards.md"]
},
"runners": {
"claude": { "command": "claude", "model": "opus" }
},
"default_runner": "claude"
}
Initialize, create a feature, and start the AI development loop — all from the terminal.
macOS native (Swift) + Windows / Linux (Tauri). Real-time SSE monitoring, dependency graph, screenshot gallery, 6-language i18n, system notifications.
Per-step model, duration, and cost
Auto-captured screenshot gallery per round
Pick a profile and see the full phase pipeline before running
Use any AI coding tool. Mix and match per role.
4x learns from its own runs and continuously improves — mining failures, enriching discoveries, gating by value, and iterating itself. When active learnings pass 30, it automatically uses AI to detect semantic duplicates and consolidate them, keeping prompts lean.
Extract improvement signals from failed runs, escalations, and recurring FAIL patterns.
ROI evaluation with anti-hack mechanism prevents backlog bloat and low-value work.
One command to start the continuous self-improvement loop: mine → evaluate → implement → verify → deploy.