Reflexion Debug Loop
On each failed repro attempt, write a short reflection to disk, then retry with that memory — avoids repeating the same wrong fix.
3 copies · 1 installs · 14 views
by loops!
Use loop copies the kickoff. Share copies the loop link. Open in Cursor / Claude Code only pre-fill that prompt — they do not install hook files. Click Install files, extract the zip into your repo, then restart your agent. Full install guide
- Do not modify the check command or exit criteria to force success
- Do not skip, disable, or bypass checks to pass the exit condition
- If stuck after several iterations, stop and report blockers instead of gaming metrics
Two separate pieces
- Kickoff prompt — tells the agent the goal, check command, exit condition, and how to self-pace between passes.
- Install files — optional hooks under
.cursor/or.claude/that fire on events (save, commit, etc.). You must download and extract these into your repo.
- 1
Download and extract install files
Click Install files on this loop, unzip, and merge into your project root so paths like
.loops/reflexion.mdexist on disk.Restart Cursor or reload the Claude Code session so hooks are picked up. Until then, nothing is “installed” — the browser cannot write into your repo.
- 2
Copy or open the kickoff prompt
Use Use loop to copy the kickoff, or Open in Cursor / Open in Claude Code to pre-fill the prompt in that app. Those links only carry text, not hook files.
- 3
Paste and let the agent self-pace
Paste the kickoff into agent chat. The agent should run your check command between iterations and stop when the exit condition passes.
Full guide with Cursor /loop notes: How to install loops
1. Reproduce bug
Run the minimal repro steps or failing test. Capture exact error output.
npm test -- --testNamePattern=<failing-test>
2. Reflect on failure
Append to .loops/reflexion.md: what you tried, what failed, and one hypothesis to avoid next pass.
3. Apply targeted fix
Read reflexion.md. Apply a different fix than prior attempts. Prefer root cause over symptoms.
Start the "Reflexion Debug Loop" loop. Goal: the failing test or repro passes Max iterations: 8 Between iterations run: npm test -- --testNamePattern=<failing-test> Exit when: the repro test exits 0 Step 1: Reproduce the bug. If it fails, append a reflection to .loops/reflexion.md before trying a new fix. Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.
Related loops
Start the "Investigation Script Loop" loop. Goal: prove the root cause with a minimal repro script Max iterations: 8 Between iterations run: node scripts/investigate.mjs Exit when: script output demonstrates root cause Step 1: Write a tiny throwaway script that reproduces the issue. Run it and iterate on what the output shows. Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.