Loops

Codex loops I use.

Small operating loops for asking Codex to make progress, measure the result, and keep iterating against a clear target.

Codex prompts

Reusable loops.

What are Charlie Greenman's Codex loops?

Charlie Greenman's Codex loops are reusable prompts that ask Codex to inspect a software system, make one meaningful repair, measure the result, and continue only while the same benchmark shows a useful gap.

Evaluation

The product contract conformance loop

A product-quality loop that turns a business logic or product contract document into an evidence-backed implementation audit.

Source: Charlie Greenman Codex loops | Contributed by Charlie Greenman

Codex prompt
Audit [project] against [product contract document]. First extract every concrete product promise, business rule, permission rule, background job expectation, user-facing workflow, non-goal, and quality bar from the contract into a requirement ledger. For each requirement, find current evidence in code, configuration, tests, docs, jobs, migrations, routes, UI, prompts, queues, and production-safe runtime state. Mark each requirement proved, weak, contradicted, unimplemented, N/A with reason, or blocked with missing evidence. Fix only confirmed high-impact mismatches one bounded slice at a time, preserving unrelated work, adding regression coverage where practical, and rerunning the affected ledger checks. Ask before touching production, secrets, user data, destructive operations, or changing public claims. Stop only when every requirement is proved or honestly classified and the ledger contains no silent gaps.

  • Requirement ledger from the product contract
  • Evidence-backed status for every rule
  • Bounded fixes with regression coverage

Performance

The sub-50 ms page-load loop

A speed loop for local sites where the target is strict enough to force measurement discipline.

Source: Forward Future Loop Library | Contributed by Matthew Berman

Codex prompt
Continue optimizing the code for speed. After each significant change, measure page-load performance across every page under the same repeatable test conditions. Continue until every page loads in under 50 ms.

  • Repeatable test conditions
  • Every public page
  • Under 50 ms load time

Visibility

The SEO/GEO visibility loop

A visibility loop for improving technical SEO, answer readiness, and AI-search coverage through repeated audits and benchmarks.

Source: Forward Future Loop Library | Contributed by Matthew Berman

Codex prompt
Run an SEO/GEO audit across crawlability, indexation, page intent, titles, internal links, structured data, source citations, and answer-first content. Rank the gaps by expected impact, fix the highest-leverage issue, then rerun the same crawl and target-query benchmark across search engines and AI answer engines. Repeat until no critical technical issues remain, every priority query maps to a clear answer-ready page, and the benchmark shows no high-impact gap left to fix.

  • Crawl and query benchmark
  • Impact-ranked gaps
  • Answer-ready priority pages

Architecture

The architecture satisfaction loop

A refactoring loop for improving architecture through small, live-tested, independently reviewed checkpoints.

Source: Forward Future Loop Library | Contributed by Peter Steinberger

Codex prompt
Refactor until you are happy with the architecture. After each significant step, live-test the system, run autoreview, and commit. Track progress in /tmp/refactor-{projectname}.md.

  • Architecture target and risks
  • Live-tested significant steps
  • Autoreviewed and committed checkpoints