A continuous engineering loop for Claude Code.
Triage every request, run small tasks through a test-driven harness, and drive large tasks to a
measurable goal with an orchestrator, parallel subagents, and a deterministic judge.
forge takes the ratchet idea from karpathy/autoresearch
(one change, one commit, one measurement, keep it or reset it) and wraps it in the process a real
team follows: a written spec, a mapped scope, clarifying questions, tests beyond the happy path, and
a human sign-off before anything runs unattended.
The worker is always Claude. Jev, TypeSafe's decision model, only makes cheap,
fast judgements: triage, model routing, finding pre-sorting, failure labelling, and context
compaction. Pass or fail always comes from test exit codes, a baseline, and a metric.
Triage
Each engineering prompt is classified as a question, a vague request, a small task, or a
large task, and routed to the matching flow.
|
Orchestrated goal loop
Parallel subagents in their own worktrees, an orchestrator that rules on findings by citing
the spec, and a judge that keeps or resets each iteration.
|
Self-learning
Repo-scoped instincts distilled from run evidence and owner corrections, fed back into the
next task.
|
Contents
How it works
Small tasks
Plan with happy, unhappy, and edge cases, clarify open decisions up front, then build. When Claude
ends a turn, a Stop hook runs the cases and the test command: red keeps the session working with the
failing cases attached, green is done, and three red revisions escalate to you. A plan that grows past
a few files is proposed for promotion to a large task.
Large tasks
Every stage has a gate, and forge check tells you what is missing.
| Stage | Output |
|---|
| Intake | frozen copy of the source (Jira, Google Doc, PDF, Markdown, PRD, Figma) and the report target |
| Goal and spec | goal.json (test and regression commands, metric, target, budget, locked files) and spec.md, with a source for every acceptance criterion |
| Scope | scope.json: in scope, impacted, out of scope, and conflicts, each with file:line evidence |
| Worklist and matrix | vertical slices with owned files; happy, unhappy, and edge cases per criterion plus a regression case per impacted path |
| Lanes | subagent count computed from file collisions, dependencies, free RAM, and quota; shared files belong to the orchestrator |
| Baseline | matrix, suite, and metric measured twice at HEAD to catch flaky tests |
| Clarify | numbered questions A to J, each with a recommendation, including the subagent count |
| Spec lock | explicit approval; artifacts and evaluator files are hashed, and edits to them are denied |
Then the loop runs in the background. Each iteration:
- every lane is a fresh
claude -p in its own git worktree and may only write the files it owns;
- findings go to the orchestrator, which must cite a real line of the spec, goal, clarify answers, or
scope. Anything it cannot ground becomes BLOCKED, and the loop continues with the other items;
- the judge keeps the iteration only if nothing regressed, acceptance did not drop, the pre-existing
suite is green, and acceptance or the metric improved. Otherwise it runs
git reset.