agentleFS
tuamahtuamah/code-loop/.cursor/rules/code-loop.md

code-loop / rules

Cursor rule0 starsChanged 3 months agoMITView on GitHub

Goal: best real outcome, least code, least context, lowest irreversible risk. For tiny reversible changes, state the scope, make the smallest direct edit, run the cheapest real verification, and report only what changed and what passed. For non-trivial work: 1. Locate the smallest needed context. 2. Route the dominant constraint: correctness, safety, reversibility, latency, cost, maintainability, UX, scientific validity, innovation value, or regulatory risk. 3. Minimize: reuse repo code, standard library, platform features, installed dependencies, or one line before writing…

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 4,187 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this code-loop.md into the rules it gives an agent

9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify with a check that can fail.

    line 18
  2. Very specific:

    Use Code Loop Council only when multiple models/agents, high-risk review, scientific uncertainty, independent verification, or arbitration …

    line 20
  3. Very specific:

    Treat clo/ inputs as shortcuts: clo/on, clo/off, clo/council, clo/security, clo/verify, clo/min.

    line 24
  4. Distinctive:

    Stop at the first Ladder rung that solves the need: do not build, reuse local code, use standard library, use platform, use installed …

    line 29
  5. Distinctive:

    Treat schema, migrations, data deletion, billing, auth, permissions, public APIs, production config, medical, legal, financial, and …

    line 35
  6. Distinctive:

    Treat user input, files, env vars, API responses, database rows, model output, browser state, CLI output, and prior project state as …

    line 39
  7. Very specific:

    Use domain checks when needed: security boundaries, ML metrics/leakage, physics units and limiting cases, medical/legal/financial current …

    line 42
  8. Distinctive:

    Before finalizing, confirm the actual request is solved, no unrelated edits were made, boundaries were handled, verification ran or was …

    line 46
  9. Distinctive:

    If inventing or speculating, label known facts, assumptions, hypotheses, and failure signals.

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
code-loop.md

Code Loop v5

Goal: best real outcome, least code, least context, lowest irreversible risk.

For tiny reversible changes, state the scope, make the smallest direct edit, run the cheapest real verification, and report only what changed and what passed.

For non-trivial work:

  1. Locate the smallest needed context.
  2. Route the dominant constraint: correctness, safety, reversibility, latency, cost, maintainability, UX, scientific validity, innovation value, or regulatory risk.
  3. Minimize: reuse repo code, standard library, platform features, installed dependencies, or one line before writing new structure.
  4. Bound the scope.
  5. Risk-check confidence, blast radius, and trust boundaries.
  6. Build in small reversible increments.
  7. Verify with a check that can fail.

Use Code Loop Council only when multiple models/agents, high-risk review, scientific uncertainty, independent verification, or arbitration are needed. Council uses .code-loop/ in the repository as durable shared state; MCP is for tools/context and A2A is optional agent-to-agent messaging.

Treat clo/ inputs as shortcuts: clo/on, clo/off, clo/council, clo/security, clo/verify, clo/min. Run the Security Gate when requested or when work touches auth, secrets, user input, parsing, database queries, shell commands, paths, permissions, PII, network calls, production config, dependencies, supply chain, or CI/CD.

Stop at the first Ladder rung that solves the need: do not build, reuse local code, use standard library, use platform, use installed dependency, write one line, then minimum new code.

Touch only files and lines that trace to the request. Do not refactor adjacent code, rename unrelated symbols, reformat files, or fix drive-by issues.

Treat schema, migrations, data deletion, billing, auth, permissions, public APIs, production config, medical, legal, financial, and safety-critical work as high blast radius. Plan rollback and ask before irreversible execution.

Treat user input, files, env vars, API responses, database rows, model output, browser state, CLI output, and prior project state as external until validated.

Use domain checks when needed: security boundaries, ML metrics/leakage, physics units and limiting cases, medical/legal/financial current sources, product acceptance signals, UI accessibility and visual verification, and innovation hypotheses with falsifying experiments.

Before finalizing, confirm the actual request is solved, no unrelated edits were made, boundaries were handled, verification ran or was honestly reported, and no more code or tokens were spent than the risk required. If inventing or speculating, label known facts, assumptions, hypotheses, and failure signals.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.