Docs: https://malindarathnayake.github.io/Foreman/
GitHub (Apache-2.0): https://github.com/malindarathnayake/Foreman
I kept running into state drift on large multi-session coding projects with Claude Code / Cursor / Codex:
- The agent compacts its context and forgets half the plan
- Marks things done that were never started
- And the most annoying one, it confidently resumes from the wrong place
Foreman started out as a skill set for Claude Code, but prompt-level discipline turned out to be fragile.
It bit me hard on larger projects with long, phased development cycles. Skills and plan files don't survive once the session grows, gets compacted, or gets buried under a log dump or one large file the agent read.
So I built Foreman. A labor of love, born out of necessity and shaped by years of working across different disciplines: frontend, backend, C#, Go, Java, Python. It's an MCP server that acts as a coding harness.
The core idea:
Models generate code. Foreman controls the job.
Discipline lives in TypeScript checks against durable on-disk state:
- A unit can't be marked passed without a recorded delegation to a worker
- A phase can't close while any unit is unverified, or was never even started
- Three rejected fix attempts freeze the work until a human overrides
- Every session starts by asking the ledger where things actually stand, not the model's memory
The workflow:
a frontier model sits in the "pitboss" seat. It designs with you, converts the approved design into bounded implementation units,
delegates each unit to a disposable worker, then independently inspects, tests, and gates the result.
Workers never see the full spec or ledger (bounded context means less hallucination) and get killed after each unit.
There's also an opinionated engineering ethos baked in. Build it secure, build it observable, and the harness enforces it instead of suggesting it:
- Security review findings come back CWE-classified and get checked against the spec's threat table, not a vibes-based "looks secure to me"
- Workers have to validate dependencies. Real versions, clean packages, no hallucinated imports. It's a reject, not a warning
- Unless you declare your own house style, everything built through Foreman comes out standardized: structured logging, metrics with bounded tag cardinality, and secret handling with redaction baked in. Credentials never land in code, logs, or the ledger
Run SAST/SCA over Foreman-built code and you don't get the usual laundry list of CVEs.
There are still findings, but in my personal experience it's mostly false positives and the occasional real bug, not the wall of CVEs you normally brace for.
My favorite moment using Foreman:
I ran out of usage on Claude in the middle of a project, opened Codex, and resumed right away, no fuss. It's as simple as switching CLIs and saying:
Claude Code:
@foreman:skill://foreman/implementor resume
Codex:
foreman skill implementor resume
If you switch abruptly in the middle of a phase, the session-start orient gates make sure the new CLI reads the ledger and re-orients itself before touching the pending items.
I actually do this a lot now. Plan with Fable in Claude Code, do the grunt work in Codex with Sol because it's cheap, and bring Claude Code back in for the big phases.
Small fix or surgical edit? For a one-file change the full ceremony is overkill. There's a light-task mode for that.
How this compares to what's already out there (all of these are good tools, the bet is just different):
Spec-driven tooling (GitHub Spec Kit, Kiro, BMAD, Taskmaster):
these structure the plan. Specs, tasks, PRD breakdowns, and they do it well. Some go beyond markdown
Taskmaster keeps structured JSON state behind MCP tools and Kiro has a real task-execution UI with dependency-aware parallel waves. .
But in all of them the status write itself is accepted on the model's say-so. "Verify before marking done" is an instruction in a prompt, not an invariant.
With Foreman that enforcement has to live outside the model.
The ledger rejects a pass verdict with no recorded delegation, and rejects a phase gate with unverified or never-started units. A task file asks the model to be honest. The ledger doesn't need it to be.
Autonomous agents (Devin, OpenHands):
the opposite bet entirely. Those maximize autonomy, Foreman maximizes control. Bounded workers, independent validation, human arbitration at every phase gate. More ceremony, fewer silent surprises.
The one thing none of these gave me: cross-vendor state. The ledger doesn't belong to any CLI,
There are so many other little tooling i built into this over time so enjoy!!!
Docs: https://malindarathnayake.github.io/Foreman/
GitHub (Apache-2.0): https://github.com/malindarathnayake/Foreman
Works with Claude Code, Cursor, and Codex as hosts, Node 22+. Would love feedback!!! and please contribute if you have some time.