Memory leak hunt

Drive a suspected memory leak to ground: reproduce growth under a repeated workload, capture heap snapshots, and fix the retention until memory stays flat.

prompt
→ Claude
/goal heap usage stays flat (within 5%) across 500 repetitions of the failing workload in the leak-repro script — capture heap snapshots before and after, identify what is being retained and by which reference chain, fix the leak, and re-run the repro to confirm; stop after 10 turns
claude-code · codex

Implementation note

Write the smallest repro script you can first; the loop's job is diagnosis and fix, not finding the repro. The flat-heap re-run is the proof.

Source: looprepo

More debugging loops

Keep asking for valid input

/loopnew

Loop until the user enters a number that passes your validation criteria.

prompt
→ Claude
/loop untill the user enteres a valid number
debugginglow risk

Take a ticket to reviewer-ready

Turn a ticket or bug report into a proven root cause, a minimal patch, and a clean handoff a reviewer can trust.

prompt
→ Claude
Take a ticket, bug report, failing behavior, or customer complaint and turn it into a review-ready patch. Reproduce the failure in the smallest representative environment, prove the root cause, make the smallest credible fix, and rerun the original reproduction plus relevant regression tests. If the issue cannot be reproduced after two serious attempts, say so. Do not fold unrelated refactors into the patch. Finish with the cause, changed files, before-and-after proof, risks, and pull-request summary.
debugginghigh risk

Ralph the bug backlog

Work a triaged bug list one fix per fresh-context iteration: reproduce first, fix minimally, prove it with a regression test, and log root-cause patterns to guardrails.

prompt
→ Claude
/loop fresh context each iteration: read bugs.json and .ralph/guardrails.md, take the top open bug, write a failing test that reproduces it before touching any code, then apply the smallest fix that makes the test pass with the rest of the suite green, and mark the bug fixed; if you cannot reproduce it, mark it needs-info with your findings instead; append recurring root-cause patterns to .ralph/guardrails.md; stop when bugs.json is clear or after 25 turns
debugginghigh risk