Run Cursor agents in structured cycles from your terminal. Implement, verify, repeat.
Cyclopsctl is a Python CLI that sequences Cursor agent runs to execute tasks from a PRD end-to-end. You write a product requirements doc (prd.md), run cyclopsctl init, and let the orchestrator drive implement → update → verify cycles until the queue is empty.
Each cycle is one task. The orchestrator picks the task, routes the right model based on complexity, runs a two-phase workflow (implement + update in the same agent session), then verifies the handover file advanced before moving on. It fails closed: if the handover didn't change, the run stops rather than silently repeating the same task.
Who it's for: Solo developers and small teams building with Cursor who want to turn a solid PRD into working software with minimal manual chaining of agent runs. File-based continuity (current-handover-prompt.md, ai-context.md) keeps context intact across sessions.
The codebase is 100% AI-generated (Python, docs, and config), built with the same AI-assisted workflow used for Ferrite.
Write a detailed PRD. The quality of your output depends heavily on the quality of your prd.md. Vague requirements produce vague tasks; detailed requirements produce precise, actionable tasks. We recommend drafting your PRD with Opus before running cyclopsctl: use it interactively to think through features, edge cases, tech stack choices, and scope. The better the PRD, the better the parsed tasks, the better the results. See prd.example.md for a full annotated example showing what to include and why.
Build in phases, not all at once. Don't try to build a large application in a single PRD. Start with a focused v1 scope, build it, validate it, then write a second PRD for the next phase. Phase 2 PRDs are a great place to include bug fixes, refinements, and new features based on what you learned from phase 1. Cyclopsctl supports multi-phase builds natively with tags, so each phase gets its own task queue while keeping previous phase history intact. A second PRD is a new tag (cyclopsctl launch --prd prd-phase2.md).
Ask in the PRD when you want gates or a cloud check. A normal prd.md stays one local queue. Cyclopsctl prints PRD capabilities: phases off, cloud marking off and does not ask. Phase gates and cloud check tasks turn on when the PRD uses the shapes in prd.example.md and you answer yes. The default answer is no. --yes does not answer these questions. On init, bootstrap, and launch, pass --phases / --no-phases and --mark-cloud / --no-mark-cloud to decide without a prompt. A non-interactive parse stops and names the flag to pass.
Don't leave an overnight run inside the editor's terminal. If Cursor / VS Code crashes, reloads or updates while a run lives in its integrated terminal, nothing reads that terminal anymore and on Windows every process attached to it (the dashboard, the build being verified, even the kill attempts) freezes silently until the window is reopened. cyclopsctl launch detects an IDE terminal and opens the run in its own console window (--console auto, the default); cyclopsctl run warns instead. A standalone PowerShell / Windows Terminal window works too.
You start with a prd.md. cyclopsctl init parses it into a task queue, scores each task for complexity, and prepares the first handover file. cyclopsctl launch then drives the loop: for each task, a new Cursor agent implements it with targeted tests, cyclopsctl runs the project's full verification command once (capped, logged, failures handed back to the same agent), the same agent session handles the update (marks the task done and prepares the next handover), and the orchestrator verifies progress before continuing.
The handover file (current-handover-prompt.md) is the contract between cycles; it carries the task context forward. The orchestrator snapshots it before the update phase and checks that the Task ID and content actually changed. If they didn't, the run fails rather than silently looping.
A PRD can also name ordered phases, or a check the local agent cannot do from the checkout (a browser walk-through, a clean Ubuntu machine). Cyclopsctl asks before parse. Yes on phases writes gates between those phases. Yes on a cloud check marks that task for a Cursor cloud agent, which skips the local implement/update cycle, and sets [cloud] enabled = true so the run executes it. Set enabled = false to pause. Default gates have no command: when the phase's tasks are done, the gate passes and a replan agent may adjust the next phase. Add a mechanical command or "human": true in .cyclopsctl/tasks/phases.json when the gate should check or wait.
Requires Python 3.10+ and a CURSOR_API_KEY.
From GitHub (no clone needed):
pip install "cyclopsctl @ git+https://github.com/OlaProeis/Cyclopsctl.git@v0.1.12"To track master instead of a release tag, omit @v0.1.12.
Or use the install scripts (after cloning):
# Windows
.\install.ps1
# macOS / Linux
./install.shVerify the install:
cyclopsctl --versionCopy .env.example to .env in your project and set CURSOR_API_KEY. Cyclopsctl loads it automatically from the project root.
In your project repo, write a prd.md describing what you want to build (see prd.example.md for structure — init copies this annotated example into your project), then:
cyclopsctl init # parse PRD → task queue → first handover
cyclopsctl launch # start the implement → update cyclesinit scaffolds cyclopsctl.toml, workflow files, and prd.example.md, parses prd.md into the native task queue, runs complexity scoring, and writes the first handover. launch runs preflight checks, shows queue status, lets you confirm options, and starts the cycles.
cd /path/to/your-project
cyclopsctl init # idempotent, repairs and catches up as needed
cyclopsctl launchIf the project is already initialized and has pending tasks, launch alone is enough. If you've changed your prd.md, launch detects it and offers to re-parse into a new phase.
| The orchestrator does | The orchestrator does not |
|---|---|
| Run implement → update cycles with handover verification | Plan tasks or edit tasks.json during cycles |
init: scaffold, PRD parse, complexity scoring, handover sync |
Rewrite handover templates |
Interactive launch and direct run |
Choose the next task (the update agent does that) |
| Route models by complexity score | Manage nested task hierarchies |
Inject ai-context.md and project facts into implementation prompts |
Replace the update agent's handover or doc duties |
| Recover empty-detail run errors on the same agent before retrying | Run builds or tests during the agent's implementation (agents run targeted tests) |
| Run the project's full verification command once per task after implementation, capped and logged, and hand failures back to the agent | |
| Enforce per-phase time budgets and host-aware caps on build/test parallelism and memory | |
| Treat the task queue as the source of truth on resume; recover unclean exits and bridge crashes | |
Collect durable project facts automatically (.cyclopsctl/memory/facts.jsonl) |
|
| Ask before creating phase gates or cloud check tasks, and run accepted cloud tasks on a Cursor cloud agent | Create gates or cloud tasks from a plain PRD |
Preflight via doctor, Rich dashboard, resume history |
|
bootstrap: explicit PRD re-parse when needed |
Task planning and workflow rules live in your prompt files. The update agent marks tasks done, updates docs, and writes the next handover. If the update agent overruns its budget, cyclopsctl finishes that bookkeeping itself rather than re-implementing the task.
- Python 3.10+
CURSOR_API_KEY— set in your project's.envor as an environment variable (auto-loaded; pass--no-envto skip)cursor-sdk— installed automatically with this package- A project with
prd.md—cyclopsctl initcreates the required workflow files (current-handover-prompt.md,update-handover-prompt.md,ai-context.md) when they're missing
On Windows, cyclopsctl bootstraps the Cursor SDK bridge automatically (managed_sdk_bridge) for launch, run, init, bootstrap, models, and analyze-complexity. This avoids Python 3.11 crashes when cursor-sdk auto-launches its local bridge (os.get_blocking / pipe discovery).
Task state lives under .cyclopsctl/tasks/ (with a tasks.json.lock sidecar so the agent's set-status and the orchestrator never interleave writes) and per-tag complexity reports under .cyclopsctl/reports/<tag>/. Use cyclopsctl tasks to inspect and manage the queue.
| Command | Description |
|---|---|
cyclopsctl |
Windows (no args): open pipeline desk; elsewhere / with args: interactive launcher (launch) |
cyclopsctl launch |
Preflight + Rich menu, spawn run |
cyclopsctl init |
Scaffold cyclopsctl.toml, workflow stubs, .gitignore |
cyclopsctl bootstrap |
PRD → parse → analyze → sync handover |
cyclopsctl analyze-complexity |
Score pending tasks on the active tag (no PRD parse) |
cyclopsctl run |
Run N verified implement → update cycles |
cyclopsctl doctor / check |
Preflight diagnostics: API key, SDK bridge, queue/handover drift, stale workflow templates, missing [resources] on heavy build systems, oversized ai-context.md, cloud-queue notes |
cyclopsctl tasks |
Task queue CRUD: list, list pending / done, show, next, set-status, tags, use-tag (phase-aware when phases.json defines the tag) |
cyclopsctl phases |
Phase gates on phased tags: status, decide --id Gx --decision continue|stop, reopen --id Gx |
cyclopsctl memory |
Project facts: add --task-id N --text "…", list [--task N] [--tag T] |
cyclopsctl status |
Crash-recovery state (pid, phase, tag) and run history summary |
cyclopsctl models |
List Cursor models and routing preset availability |
Shared flags on most commands: --no-env, --config, --project-root (defaults to cwd), --plain. init, bootstrap, and launch also accept --phases / --no-phases and --mark-cloud / --no-mark-cloud (see Phase gates and cloud checks). run, launch, doctor and status load <project-root>/cyclopsctl.toml automatically when it exists; --config FILE points at a different file. The run log states which file was used (Using config file … or No cyclopsctl.toml found …). python -m cyclopsctl … is equivalent to cyclopsctl ….
With an initialized project and an interactive terminal, bare cyclopsctl (no subcommand) opens the pipeline desk TUI instead of the launch menu. Use it to queue multiple PRD/phase rows, start runs (s all queued, g selection), add/delete rows (a / d), stop the active phase (x), or quit (q). Navigate with arrow keys or j/k; Space toggles selection on restartable rows.
Interactive run / launch on Windows can register with the desk and auto-start it in the background when integration is enabled (see docs/runtime/pipeline-desk.md). Adding a row (a) for an empty tag asks the same phase-gate and cloud-marking questions as init, before routing, and stores the answer for the setup child.
Opt-out: set CYCLOPSCTL_NO_DESK=1, or [desk] auto_start = false in cyclopsctl.toml, or use non-interactive/CI invocations (no TTY), --dry-run, or non-Windows platforms — then behavior matches a plain run / launch with no .cyclopsctl/desk/ side effects.
| Flag | Description |
|---|---|
--console MODE |
Where the run's dashboard lives on Windows. auto (default): open a separate console window when launched from an IDE terminal (Cursor / VS Code) so an editor crash cannot freeze the run; new-window: always; inherit: never. The IDE terminal only waits and shows the run's pid; Ctrl+C there detaches, Ctrl+C in the run window stops the run. The run window pauses (Press Enter to close) after the summary. |
--resume / --fresh / --tag / --profile / routing flags |
Same meaning as on run; the menu lets you confirm them |
--from-prd PATH / --prd PATH / --skip-analyze |
Bootstrap options when no queue exists yet |
--phases / --no-phases |
Create phase gates for this parse, or parse without them. Omitted: ask when the PRD names a phase list; default no |
--mark-cloud / --no-mark-cloud |
Allow cloud check tasks in the parse and turn [cloud] enabled on, or forbid them. Omitted: ask when the PRD describes a cloud-shaped check; default no |
--fix |
Let doctor apply safe fixes before the menu |
--yes |
Skip interactive confirms. Does not answer the phase or cloud questions |
| Flag | Description |
|---|---|
--project-root PATH |
Target repository (default: cwd) |
--profile NAME |
Merge named profile defaults into seeded cyclopsctl.toml |
--skip-templates |
Write config only; skip workflow stubs |
--dry-run |
List paths that would be written |
--force PATH / --force-all |
Overwrite existing scaffold files |
--attach |
Attach to existing queue without PRD (brownfield) |
--phases / --no-phases |
Create phase gates for this parse, or parse without them |
--mark-cloud / --no-mark-cloud |
Allow cloud check tasks and turn [cloud] enabled on, or forbid cloud tasks |
--yes |
Skip interactive confirms. Does not answer the phase or cloud questions |
| Flag | Description |
|---|---|
--from-prd PATH |
PRD file (default: prd.md) |
--with-workflow |
Generate PRD-aware ai-context.md, handover template, docs/index.md |
--sync-handover-only |
Regenerate handover from existing tasks |
--skip-analyze |
Skip complexity analysis after parse-prd |
--append |
Append tasks when re-parsing PRD |
--phases / --no-phases |
Create phase gates for this parse, or parse without them |
--mark-cloud / --no-mark-cloud |
Allow cloud check tasks and turn [cloud] enabled on, or forbid cloud tasks |
Score pending tasks via Cursor SDK and write .cyclopsctl/reports/<tag>/complexity-report.json (mirrored to .cyclopsctl/reports/complexity-report.json), so a new phase never inherits the previous phase's scores through colliding ids. Does not parse a PRD — use after a new phase tag when tasks lack complexity, or when init refuses with PRD changed — run cyclopsctl launch.
cyclopsctl tasks use-tag phase-2 # if needed
cyclopsctl analyze-complexity| Flag | Description |
|---|---|
--project-root PATH |
Target repository (default: cwd) |
--tag NAME |
Tag to analyze (default: active tag) |
--analyze-model MODEL |
Override analyze model (default: auto) |
--skip-if-exists |
Skip when complexity report already exists |
By default this command re-runs analysis and replaces a stale report (e.g. from a prior phase). See docs/cli/analyze-complexity-cli.md.
| Flag | Description |
|---|---|
--config FILE |
Load a specific TOML file (default: <project-root>/cyclopsctl.toml when present) |
--cycles N |
Number of cycles to run |
--project-root PATH |
Target repository (default: cwd) |
--profile NAME |
Merge profile defaults (CLI overrides profile) |
--tag NAME |
Task tag context |
--task-source MODE |
handover (default) or sequential |
--task-id N |
Pin the next cycle to a specific pending task |
--strict-handover |
Fail when handover Task ID differs from selected task |
--resume |
Skip tasks from run history that the queue also says are done (see Recovery) |
--fresh |
Force first-prompt bootstrap; ignore ready handover |
--plain |
Disable Rich dashboard; plain text logs |
--retry-on off |
Disable default transient retry (SDK blips, same-agent continue, and fresh-agent retry on empty-detail run errors) |
--implementation-timeout-minutes N / --update-timeout-minutes N |
Wall-clock budget per phase (defaults 120 / 20; 0 disables) |
--idle-timeout-minutes N / --test-timeout-minutes N |
Idle budget (default 30) and advisory per-test-command budget rendered into the handover (default 15) |
--max-build-jobs N / --max-test-threads N |
Cap build parallelism (CARGO_BUILD_JOBS, MAKEFLAGS, GOFLAGS, …) and test threads for everything the agent runs |
--max-memory-gb GB |
Hard memory ceiling for the whole agent process tree (Windows Job Object; default 65 % of RAM) |
--verification-run-by WHO |
Who runs the full verification command once per cycle: orchestrator (default), agent, or off |
--verification-command CMD / --verification-timeout-minutes N |
Override the handover's ## Verification command and its wall-clock limit (default 30) |
--no-state / --no-history |
Disable state.json / run-history.json persistence |
--dry-run |
Resolve task and model without starting an agent |
See cyclopsctl.toml.example for full TOML options including [routing] rules, [profile.*] presets, [tasks] parse/analyze models, [budget], [resources], [verification], [memory], [phases] (gate/stuck replan limits on phased tags), and task_source.
Big projects have test suites and builds that run for 30–60 minutes. Cyclopsctl is built so that is survivable:
- Per-phase budgets (
[budget]): the implementation run gets 120 min and the update run 20 min by default. A watchdog cancels the agent on breach, leaves the task pending, records a runtime fact so the next attempt knows, and never retries that attempt. - Tool-aware idle detection: the idle budget (30 min) only counts time with no agent activity and no tool call in flight. A long
cargo testor VM build inside a tool call is not "idle"; only the wall-clock deadline bounds it. - Cyclopsctl runs the full suite, not the agent (
[verification]): agents are told to run only targeted tests for the files they touched. After the implementation phase cyclopsctl runs the project's verification command (## Verificationblock or[verification] command) once, as a low-priority process inside the memory cap and in its own hidden console, with output in.cyclopsctl/logs/verify-cycle-N.log(a retried cycle writesverify-cycle-N-r2.loginstead of overwriting the first attempt). The dashboard shows a Full verification (cyclopsctl) · running 4m 35s · verify-cycle-N.log step while it runs, so a long suite never looks like a hang;cycles.jsonlgetssuite_start/suite_resultevents. A red run goes back to the same agent as a bounded fix follow-up (max_fix_attempts, default 1); a suite that stays red is recorded as a runtime fact and the cycle continues (on_failure = "stop"to halt instead).run_by = "agent"restores the old behaviour. - Console isolation (Windows). The SDK bridge (and the agent, shells and builds under it), the verification command and
taskkillare spawned with their own hidden console (CREATE_NO_WINDOW), so a frozen or vanished terminal cannot stall them, andtaskkillis bounded to 30 s.cyclopsctl launchopens the run in a new console window when it detects an IDE terminal (see--console). - Update phase is bookkeeping only. Tests and builds never belong in the update phase. If the update agent overruns its budget anyway, cyclopsctl marks the task done and writes the next handover itself instead of failing the cycle.
launch,initanddoctordetect anupdate-handover-prompt.mdorai-context.mdfrom an older template (still telling the agent to run the suite, pick the "lowest numeric" task, or rewrite the handover) andlaunchrefreshes them automatically, keeping<file>.bakand preserving everything below the rules blocks ofai-context.md. - Bridge timeout follows the budget: on Windows the SDK bridge RPC timeout is raised to the longest phase deadline + 15 min automatically, so the transport never gives up before the budget does (explicit
CYCLOPSCTL_BRIDGE_TIMEOUT_SECONDSwins). - Host-aware resource caps (
[resources]): before the agent is spawned, cyclopsctl exportsCARGO_BUILD_JOBS,RUST_TEST_THREADS,MAKEFLAGS,CMAKE_BUILD_PARALLEL_LEVEL,GOFLAGS,PYTEST_XDIST_AUTO_NUM_WORKERSandNODE_OPTIONS. Defaults are derived from the machine: build jobs = min(half the CPUs, RAM / 3 GB) and never above the project's own.cargo/config.toml[build] jobs; 2 test threads; 4 GB Node heap. Operator-exported values win. On Windowsmax_memory_gbdefaults to 65 % of RAM (hosts with ≥ 8 GB) and adds a hard Job Object ceiling over bridge → agent → every child, plus a per-process cap of half that, so a runaway linker dies instead of the host swapping.doctorwarns when a Cargo/CMake/Make/Go project has no explicit[resources]section. - Bridge deaths are treated as host pressure, not network blips. When the local
cursor-sdk-bridgedies mid-run (ReadError/WinError 10054), cyclopsctl kills the orphaned agent/build tree it left behind (cargo, rustc, link.exe…), waits for free RAM to recover before relaunching, prefixes the retry prompt with a resume note when the previous attempt already left edits on disk, and stops with a clear message after the second death in one cycle instead of starting a third build on the same box. - Durable logs under
.cyclopsctl/logs/:cycles.jsonl(defaultcycle_log),cyclopsctl.log(orchestrator INFO+),bridge.log(bridge stderr / exit codes) and the per-cycle verification logs, so an overnight failure is diagnosable after the dashboard scrollback is gone.
The effective host, budgets, caps and verification owner are logged at run start and rendered into the handover's Test & Resource Budget block so the agent does not override them. Details: docs/runtime/run-budget.md, docs/runtime/resource-caps.md, docs/runtime/orchestrator-verification.md.
Durable facts about the project (.cyclopsctl/memory/facts.jsonl) are injected into implementation prompts alongside ai-context.md, preferring facts recorded for the same task. No human step is needed:
- the update agent adds facts with
cyclopsctl memory add --task-id N --text "…"(deduplicated); - after the update phase, if no fact was added and the task is complex enough, one short follow-up on the same agent asks for 1–3 facts (
[memory] nudge); - the orchestrator records runtime facts itself: budget breaches, productive run drops, premium-model fallbacks, handover-restore violations.
Inspect with cyclopsctl memory list [--task N] [--tag runtime]. See docs/workflow/memory-automation.md.
Inspect and update the native queue under .cyclopsctl/tasks/. Run from the project root or pass --project-root.
| Command | Description |
|---|---|
cyclopsctl tasks list |
All tasks: Rich table with ID, title, status, phase, complexity, dependencies; Executor column when any task is cloud |
cyclopsctl tasks list pending |
Non-done tasks |
cyclopsctl tasks list done |
Completed tasks only |
cyclopsctl tasks list <status> |
Filter by status (in-progress, review, cancelled, blocked, deferred) |
cyclopsctl tasks show <id> |
Full task record (--format json for scripts); plain text adds executor reason, needs-repo, and result path for cloud tasks |
cyclopsctl tasks next |
Lowest in-progress task (work a crashed cycle left behind), else lowest pending task whose dependencies are done; explains why when nothing is eligible |
cyclopsctl tasks set-status --id=<id> --status=done |
Update status |
cyclopsctl tasks tags |
List tags/phases with total / done / pending counts |
cyclopsctl tasks use-tag <name> |
Switch the active tag context |
Shared flags: --project-root, --tag, --format json|plain. Full reference: docs/tasks/tasks-cli.md.
- Tags group tasks by phase. Pass
--tag NAMEonrun/launch, or settag = "..."incyclopsctl.toml. Inspect and switch withcyclopsctl tasks tags/cyclopsctl tasks use-tag <name>. - Multi-phase PRDs: each PRD/phase maps to its own tag. Start the next phase with
cyclopsctl launch --prd prd-phase2.md— launch parses into a fresh tag, runs complexity scoring (even when a prior-phase report exists), syncs a clean handover, and keeps previous phases as history. If tasks on a new tag have no complexity scores, runcyclopsctl analyze-complexity(do not useinitafter a PRD change on a mature project). Seedocs/cli/launch-prd-change.mdanddocs/cli/analyze-complexity-cli.md. - Phase gates (within one tag): when parse is told to create them, cyclopsctl writes
.cyclopsctl/tasks/phases.jsonwith gatesG0,G1, … (replanon, no command). A gate with no command passes once every task in the phase is done or cancelled, and a replan agent may adjust the next phase. Setmechanicalor"human": trueinphases.jsonbetween runs when the gate should check or wait. Stops use exit 3–5. Commands:cyclopsctl phases status/decide/reopen. Limits:[phases]. Wording and flags: Phase gates and cloud checks. Guide:docs/tasks/phase-gates.md. - Profiles: named
[profile.solo-default]tables incyclopsctl.toml; seed viacyclopsctl init --profile NAME. CLI flags override profile values.
A plain PRD does not create gates and does not mark cloud tasks. Before the parser runs, cyclopsctl reads prd.md and asks only when it finds a phase list (a heading that is only Phases, Phase plan, or Phase list, or at least two Phase N headings or list items) or a check a local checkout cannot do (a browser walk-through, clicking through a UI, a clean Ubuntu machine, a machine that has never seen the repo). Text inside fenced code blocks is ignored. One use of the word "phase" or "browser" does not ask.
Each question defaults to no. Yes is stored in .cyclopsctl/tasks/capability-choices.json for that tag and that PRD hash, and reused until the PRD changes, including by the desk setup child. --yes does not answer. Without a TTY, pass the flag or the parse stops and names it.
| Flag | Effect |
|---|---|
--phases |
Create phase gates for this parse |
--no-phases |
Parse without phase gates |
--mark-cloud |
Mark cloud check tasks and set [cloud] enabled = true |
--no-mark-cloud |
Parse without cloud tasks |
The flags are on init, bootstrap, and launch. Copy-ready wording is in prd.example.md (the file init copies into a project). After a parse that opted in, init and bootstrap print PRD capabilities: …. When the queue needs a cloud agent or has gates with no command, they also print a Queue needs: line. cyclopsctl doctor reports the same cloud gap as a note. Technical detail: docs/tasks/parse-prd.md.
Cloud tasks have executor: "cloud". They are checks, such as a browser walk-through or a clean Ubuntu install. They do not implement code. Cyclopsctl runs one on a Cursor cloud agent when [cloud] enabled = true in cyclopsctl.toml, instead of the local implement → update cycle. Cloud agents are billed as normal Cursor usage on your existing CURSOR_API_KEY (no second credential). Answering yes, or passing --mark-cloud, writes that switch on. enabled = false is a pause: cloud tasks stay in the queue and the run holds them until you turn the switch back on. A project that already agreed, and whose file never set enabled, turns the switch on at the start of the next run. A blank [cloud] model runs the cloud agent on Grok 4.7 high. The project must be on GitHub. Before a cloud agent starts, the run commits and pushes outstanding project files so the agent sees the current code. Files under .cyclopsctl and .env stay uncommitted. A private repository must be granted to the Cursor GitHub app.
[cloud] max_tasks (default 5) caps how many open cloud tasks a tag may hold. [cloud] mark_tasks = false stops a later replan from adding cloud tasks. To keep a re-parse from marking any, pass --no-mark-cloud or answer no. Inspect marked work with cyclopsctl tasks list (the Executor column appears when any listed task is cloud) and cyclopsctl tasks show <id> (executor reason, needs-repo, result path). After parse, init and bootstrap print a Cloud assessment: summary and one reason line per cloud task.
A cloud cycle writes the result under .cyclopsctl/cloud/results/ (or the task's resultPath), marks the task done, and refreshes the handover. It skips the update agent and [verification]. Ctrl+C during polling leaves the remote run going and the task in-progress; the next run reattaches. A needsRepo task runs only from a clean tree whose commit is already on origin.
When cloud tasks block the queue — only cloud work remains, [cloud] is disabled, or a needsRepo task needs a clean pushed tree — the run stops with exit 6. The run window lists each cloud check (the [cloud] switch, and for a repository task the origin, a clean tree, and whether HEAD is on origin) and prints the hold line again under the run summary. The queue stays unfinished. Commit and push, set [cloud] enabled = true, or cancel a task you do not want with cyclopsctl tasks set-status --id=<id> --status=cancelled. Guides: docs/tasks/cloud-cycle.md, docs/tasks/cloud-held-exit.md, docs/runtime/cloud-executor.md.
Reads .cyclopsctl/reports/complexity-report.json:
| Complexity score | Default model |
|---|---|
| 1–5 | Composer (composer_tier: standard or fast) |
| 6–8 | Grok 4.7 (grok_tier: standard or fast; default standard / not-fast) |
| 9–10 | Fable 5.2 high-thinking (falls back to Grok if Fable is disabled or unavailable) |
Configure via [routing] in cyclopsctl.toml (composer_tier, grok_tier, fable_enabled, score-band [[routing.rules]]), CLI flags (--composer-tier, --grok-tier, --no-fable), or interactive cyclopsctl launch prompts. Full guide: docs/runtime/model-routing.md. Inspect presets with cyclopsctl models.
Transient recovery: by default, a run that the Cursor backend rejects within seconds of being sent (no agent activity, or a bridge error code such as "Authentication error" / resource_exhausted) is resent unchanged after 30 s, 120 s and 300 s. Empty-detail run errors that survive that (infrastructure drops with no SDK message) trigger one same-agent continue on the live handle before a fresh-agent cycle retry. Cyclopsctl fingerprints the git worktree at cycle start; if the tree changed before the drop, the agent was mid-work (work is already on disk) and the fresh-agent retry is suppressed instead of re-running the whole implementation. Fresh retries for empty-detail errors are capped at one. If the update (bookkeeping) run is what failed, cyclopsctl marks the task done and writes the next handover itself rather than ending the run. The failure report includes the bridge's recorded error code (bridge: line) and how many resends were attempted — see docs/runtime/transient-retry.md.
The task queue (.cyclopsctl/tasks/tasks.json) is the source of truth. History and state files are caches that cyclopsctl reconciles against it; you never edit them by hand.
- Run history is scoped by tag.
run-history.jsonrecords which tasks a verified cycle finished for which phase. Task ids restart at 1 on every PRD, so a record from an earlier phase can never skip work in the next one. Legacy untagged records are intersected with the queue and stamped at startup. --resumeskips only what the queue confirms. An id in history is skipped only whentasks showsays the task isdoneon the active tag; otherwise the task runs and the stale id is dropped. Ids are written per verified cycle, after the store saysdone.launchturns--resumeon by itself only when the history record is tagged for the active phase.- Nothing runnable ≠ phase complete. If pending tasks remain but none is runnable (excluded by resume, or blocked on dependencies), the run stops with
TaskQueueBlockedError(exit2) naming the excluded and blocked ids. It never reports "Task queue empty" while work remains. - Unclean exits are recovered as interrupted.
state.jsonrecords the orchestrator pid. On the next launch arunningrecord whose process is gone becomesinterrupted, and the task — which was set toin-progressat cycle start — is picked up first bytasks nextand handover selection. - Ctrl+C stops the local run (exit
130). A local agent is closed. During a cloud poll, the remote run keeps going and the task staysin-progressso the next run can reattach. A second Ctrl+C hard-kills the local bridge process tree without a traceback.
cyclopsctl status shows both files. Details: docs/runtime/run-history.md, docs/runtime/crash-recovery-state.md, docs/tasks/empty-queue-completion.md.
| Code | Meaning |
|---|---|
0 |
Completed cycles, empty queue stop, or successful doctor/status |
1 |
Startup / configuration failure |
2 |
Agent run failure, handover verification failure, budget breach, queue blocked with pending tasks, or (phased) gate command timeout/launch error |
3 |
(Phased) Gate waiting — human decision, skipped tasks, or protected drift; stderr line suggests cyclopsctl phases decide or reopen |
4 |
(Phased) Gate failed (mechanical verdict); reopen the gate before continuing |
5 |
(Phased) Stuck replan disabled or cap reached |
6 |
Cloud task(s) held — executor disabled, needsRepo dirty tree, or only cloud work left; stderr lists each task |
130 |
Interrupted (Ctrl+C): local agent closed, or cloud poll stopped with the remote run left in progress |
Phased stops print one stderr line (gate id, phase, reason, next step). Cloud held stops list each held task. Details: docs/tasks/phase-exit-codes.md, docs/tasks/cloud-held-exit.md.
| File | Role |
|---|---|
current-handover-prompt.md |
Next implementation task; must include # Task ID: <n>; rewritten by the update agent each cycle |
update-handover-prompt.md |
Fixed template; passed through unchanged by the orchestrator. Bookkeeping only: must not run tests or builds (doctor flags it if it does) |
ai-context.md |
Prepended to implementation prompts; carries phase rules and project context for agents |
.cyclopsctl/memory/facts.jsonl |
Durable project facts, injected into implementation prompts; maintained by agents and the orchestrator |
.cursor/skills/cyclopsctl/SKILL.md |
Cursor agent skill for ad-hoc task/CLI help outside runs; installed on init, commit in your repo |
See ai-context.md in this repo for the canonical rule set.
Cyclopsctl/
├── src/cyclopsctl/ # Python package
├── install.ps1 / install.sh # Global install scripts
├── docs/ # Feature-level technical docs (see docs/index.md)
│ ├── guides/ # User guides and technical brief
│ ├── setup/ # Install, init, config, bootstrap
│ ├── workflow/ # Handover and workflow file generation
│ ├── tasks/ # Native task queue and PRD parse
│ ├── runtime/ # Run loop, agents, observability
│ ├── cli/ # CLI command reference
│ ├── testing/ # Regression and readiness docs
│ └── archive/ # Completed product and phase PRDs
├── prompts/ # Bootstrap templates
├── .cursor/skills/cyclopsctl/ # Operator skill (committed here; copied to target repos on init)
├── cyclopsctl.toml.example
├── ai-context.md # Agent phase rules
└── current-handover-prompt.md # Next implementation task (update agent rewrites)
Module-level documentation: docs/index.md. Agent-oriented overview: docs/guides/technical-brief.md.
pip install -e ".[dev]"
python -m pytestWindows: if pip install -e . fails with WinError 32 (cyclopsctl.exe in use), close terminals running cyclopsctl and run:
Get-Process cyclopsctl -ErrorAction SilentlyContinue | Stop-Process -Force
pip install -e .While the exe is locked, use python -m cyclopsctl … to run the editable build. See docs/setup/package-distribution.md.
For manual validation on a fresh directory or an existing repository, follow docs/guides/testing-guide.md. It covers greenfield init → launch, brownfield attach/continue scenarios, and automated pytest regression.
- Orchestrate runs, not plans. Sequence agent cycles, routing, and verification; task content lives in prompts and the native queue.
- Scenario-first adoption.
initandlaunchare the default path;runand flags are there for automation and power users. - File-based continuity. Prompts, handovers, and
ai-context.mdare the workflow contract between sessions. - Two-phase discipline. Implementation agents implement and run targeted tests; cyclopsctl runs the full suite once; update agents mark done and advance handovers.
- The host sets the limits. Build jobs, test threads, and memory caps come from the machine cyclopsctl runs on and from the project's own build config. Explicit
[resources]values override them. - Fail closed on stuck handovers. A handover that did not advance stops the run.
- The queue is the truth. History and state files are caches. When they disagree with
tasks.json, cyclopsctl heals them. A phase with tasks still open stays open.
Full product requirements: docs/archive/prd.md.
MIT, see LICENSE.

