Quick Start
- 1Sign in (opens your browser, ~30s)
npx codeloop auth - 2Switch into your project folder
cd your-project # replace with your real folder nameIf your folder name has spaces (e.g.
Photometry DB), wrap it in quotes:cd "Photometry DB". Same on macOS, Linux, and Windows PowerShell. - 3Wire Cursor / Claude Code in this repo (one-time per repo)
npx codeloop initinitautomatically writes the project config and the global activation files (~/.cursor/mcp.json,~/.claude.json,~/.claude/CLAUDE.md), and tries to install runtime tools (ffmpeg, Playwright) for you. No separate--globalstep needed.
Cursor requires a manual toggle to enable any MCP server. There is no JSON, CLI, or deeplink way to flip it (security model). The good news: it's genuinely one click, only once per workspace.
- Press Cmd+Shift+J (Mac) or Ctrl+Shift+J (Windows / Linux) to open Cursor Settings.
- Click Tools & MCP in the sidebar.
- Toggle the
codelooprow to ON and approve the consent prompt. - Reload the IDE window if the tools don't appear immediately.
Claude Code users: nothing to do. init already wrote .claude/settings.local.json with permissions.allow entries that auto-authorize the CodeLoop tools. Just open or restart Claude Code in this folder.
That's it. Open Cursor or Claude Code in this folder and start coding — your agent now runs verify, diagnose, and gate-check on every change.
One command checks every layer of the activation chain (API key, MCP registration, global rules, runtime tools, network) and prints a concrete fix for whatever is missing. Always run this first if anything looks off.
npx codeloop doctorEverything below is either an alternative for people who don't want a browser flow, or extra polish (auto-run, always-on, per-project rules) that you can add later.
The CodeLoop MCP server (the version your AI agent actually calls) is pinned to codeloop-mcp-server@latest in both ~/.cursor/mcp.json and ~/.claude.json. Every Cursor or Claude Code restart re-resolves that tag against npm, so you always get the newest server with zero manual action.
If you also type npx codeloop ... by hand in a terminal, npx caches that binary per major version. When a new CLI release comes out, every run prints a one-line “Update available” banner; running npx codeloop@latest <cmd>once flushes the cache and you're back on the newest version.
Verify it's working
- Open a chat with Cursor or Claude Code in your project.
- Ask: “Run codeloop_verify on this project.”
- You should see structured JSON come back — tests passed, screenshots captured, gate score. That's it; CodeLoop is live.
From here on, the agent will call verify, diagnose, and gate-check on its own after every code change. You write code; CodeLoop keeps it green.
Alternative setup paths
Skip this section unless the three-command path above didn't suit you (corporate firewall, headless box, want to stay in the browser, etc.).
Path 1: Website Signup
- Sign up at codeloop.tech/signup — no credit card required.
- Copy your API keyfrom the post-signup screen (it's shown only once).
- Set the environment variable in your shell:
# macOS / Linux — add to ~/.zshrc or ~/.bashrc export CODELOOP_API_KEY="cl_live_your_key_here" # Windows PowerShell — set as user env var [System.Environment]::SetEnvironmentVariable("CODELOOP_API_KEY", "cl_live_your_key_here", "User") - Initialize in your project:
cd your-project npx codeloop initThis auto-detects your project type, creates the MCP config for Cursor or Claude Code, and sets up rule files.
Path 2: CLI Signup (Terminal-First)
Prefer doing everything from the terminal? No problem.
# Create your CodeLoop account
npx codeloop signup
# Follow the prompts: name, email, password
# Your API key will be displayed and saved automatically
# Then initialize in your project
cd your-project
npx codeloop initPath 3: Browser Key Flow
Run codeloop auth from the terminal — it opens codeloop.tech/cli-auth, where you sign in (GitHub, Google, Apple, or email), confirm the request, and the browser hands a fresh API key back to the CLI over a one-time loopback callback. No copy-pasting, no environment-variable surgery.
# Open the browser-based auth flow
npx codeloop auth
# After approval, the key is saved to ~/.codeloop/config.json
# and codeloop status will show "authenticated"Pass --no-browserto fall back to email / password prompts if you're on a headless box.
Path 4: Agent-Guided Setup
If your AI agent (Cursor or Claude Code) recommends CodeLoop during a coding session, you can set it up right from the integrated terminal:
# Run in the integrated terminal when your agent suggests CodeLoop
npx codeloop init
# If you don't have an account yet, init will offer to create one
# Just follow the inline promptsManual sanity checks (optional)
If you want to confirm the wiring before opening a chat:
- Check MCP config exists:
# Cursor cat .cursor/mcp.json # Claude Code cat .claude/settings.local.json - Look for CodeLoop toolsin your AI agent's tool list. You should see tools like
codeloop_verify,codeloop_diagnose, etc. - Ask your agent: “Run codeloop_verify on this project” — the agent should call the tool and return structured results.
Optional: make it even more hands-off
CodeLoop already works after the three commands above. The two polish steps below remove the last bit of friction so the agent can run completely on its own.
Enable Auto-Run (Cursor users)
By default, Cursor shows a “Skip / Run” prompt for every terminal command the AI agent runs. This slows down the CodeLoop verification loop. To enable automatic execution:
- Open Cursor Settings: Cmd+Shift+J (Mac) or Ctrl+Shift+J (Windows/Linux)
- Go to Features > Terminal
- Find “Auto-Run Mode”
- Set to “Yolo” (runs everything automatically) or “Auto-Run with Allowlist” (safer — only auto-runs commands you approve)
This is a one-time setting. Once enabled, CodeLoop can run flutter test, npm install, git status, and other commands without manual approval.
Claude Code users: No action needed — codeloop init automatically configures permissions.allow in .claude/settings.local.json.
Always-on (across every future project)
Good news — this is now the default. Since codeloop@0.1.27, running npx codeloop init in any project also performs the global setup automatically: it writes ~/.cursor/mcp.json, ~/.claude.json, and ~/.claude/CLAUDE.mdif they're missing or out-of-date. So opening any future project in Cursor or Claude Code already has the MCP server registered.
If you want global registration without touching the current directory (e.g. on a fresh machine before you have any project), the explicit form still works:
npx codeloop init --globalConversely, --skip-global on a regular initopts out of the global write — useful in CI or multi-tenant setups where ~/.cursor/mcp.jsonshouldn't be touched.
Claude Code — Fully Automatic
No extra steps required. codeloop init writes the global MCP config, the agent memory file (~/.claude/CLAUDE.md), and .claude/settings.local.json with permissions.allowentries that auto-authorize the CodeLoop tools. Every new project triggers CodeLoop with zero manual intervention — no toggle, no consent prompt.
Cursor — One Required Manual Step
Cursor requires you to paste a User Rule into Cursor Settings. This is a one-time setup that takes 30 seconds and ensures CodeLoop triggers automatically in every project:
- Open Cursor Settings — press
Cmd + ,(Mac) orCtrl + ,(Windows/Linux). - In the left sidebar, click “Rules, Skills, Subagents”(or “Rules” in older versions).
- Find the User Rules text box at the top of the page. Click inside it.
- Paste the following rule (on a new line if you have existing rules):
After EVERY code change, you MUST call codeloop_verify from the CodeLoop MCP server. If .codeloop/config.json does not exist, call codeloop_init_project FIRST. After verify: diagnose failures with codeloop_diagnose, fix, re-verify until codeloop_gate_check returns ready_for_review with confidence >= 94%. For UI projects: screenshots + video capture are MANDATORY. Never declare a task complete without passing codeloop_gate_check. - Click Save.
That's it. This User Rule is global — it applies to every project you open in Cursor, not just the current workspace. You only need to do this once.
Why is this step needed for Cursor?
Claude Code supports file-based global agent rules (~/.claude/CLAUDE.md), so CodeLoop can auto-configure them. Cursor stores its User Rules in an internal database — not in a file — so the only way to set a global rule is through the Settings UI. CodeLoop also uses MCP tool description hints and project-level rule files as additional reinforcement layers, but the User Rule paste is the most reliable method for always-on activation.
Per-Project Alternative (No Global Paste)
If you prefer not to set a global User Rule, run npx codeloop init inside each project. This creates a .cursor/rules/codeloop.mdc file that Cursor loads automatically for that workspace. The downside is you must run init in every new project.
Restart the MCP Server After Setup
After running codeloop init --global, restart the CodeLoop MCP server in Cursor to load the latest tool descriptors:
- Open Cursor Settings → click “Tools & MCPs” in the sidebar.
- Find the codeloop server in the list.
- Click the restart button (circular arrow icon).
Then start a new chat— the current chat session won't pick up the new rules until you open a fresh conversation.
If something doesn't work
Run the built-in diagnostics — it's the single command we recommend before reading anything else:
npx codeloop doctorDoctor checks every layer of the activation chain — global MCP registrations, agent rules, project config, network — and prints green checkmarks or actionable red fixes for anything missing. If it's green, CodeLoop is set up correctly.
Still stuck? See /docs/troubleshooting (symptom-first index).
You're done. Optional next reads:
- How the loop works — the mental model, if you're curious
- API key management — rotate keys, set env vars, security best practices
- Cursor setup — detailed Cursor-specific configuration
- Claude Code setup — Claude Code-specific setup
- Tool reference — all 29 MCP tools explained (you don't need to read this to use CodeLoop)