All docs
How the Loop Works
The loop is an open source service on your machine. A manager hands in work, and each work moves through fixed steps until CI is green.
On this page
The loop is a service that runs on your machine. It is open source (Code-My-Spec/workflow, Apache-2.0) and it serves on 127.0.0.1:4010. It takes what you ask for, turns it into works, and moves each work through fixed steps until the change is on your branch and CI is green.
The loop knows nothing about your language or framework. It runs three commands in your repository and reads the exit code. Everything it knows about a stack comes from plugins.
The manager#
One agent outlives every work: the project manager. Your chat reaches it through the ask_manager tool.
The manager writes up what you asked for and hands it in. It can also look at a work, tell a running work something, stop a work, and send your chat a message when a person must decide. It never writes code and never reads the repository. A work’s own agents do that.
Works#
A work is one piece of change. You will meet three kinds most:
- Issue. A fault to fix.
- Story. Something new, with two to four criteria a test can show.
- Journey. A path through the app, stage by stage, that ends with a demo you approve.
Each work gets its own git worktree, cut from your repository. Nothing touches your checkout until the work passes.
The steps#
A workflow names its steps in order and who acts in each.
A story runs:
specify: QA writes one failing test for the next criterion and commits it.run: the loop runs your tests and checks the new one fails.work: a coder makes the failing tests pass and commits.certify: the loop runs your checks.review: a reviewer reads the diff and passes it or sends it back with a note.promote: the loop merges the work into your checkout and pushes.ci: the work waits for CI to report on that commit.
An issue is shorter: fix, certify, review, promote, ci.
A journey adds two steps before promote. demo walks the journey in a real browser and keeps a screenshot of each stage. approve waits for you to approve or reject it on the journeys page.
A step that fails sends the work back, and the agent that did it picks up its own conversation where it left off. A work stops and asks for a person when the same step comes back unchanged three times.
Where work lands#
A passing work lands in your repository’s primary checkout, on whatever branch it has checked out. The manager names that folder and branch before the first work it hands in.
After it lands, the loop pushes the branch. The default is origin and dev, and "push" in the config file changes it.
CI closes the work#
The last step waits for a CI verdict on the commit that landed.
- Green. The work is done.
- Flaky. The work is done, and one issue is handed in per flaky test.
- Red. The work goes back to its coder with the failing tests.
How much runs at once#
The loop caps the works in flight. The default is three, and the cap is shared across every project on the machine.
Several projects#
One service runs many projects. workflow projects lists them, and one workflow sign-in covers every project on the same server.
Files and settings#
The loop keeps its own files in ~/.workflow/. workflow init writes ~/.workflow/config.json and refuses to overwrite one.
{
"manager": {
"agent": {"provider": "claude-code"},
"repo": "/path/to/repo",
"cap": 3
}
}Next#
Stuck, or is this page wrong? Write to contact@codemyspec.com and a person answers.