I left Claude Code in a Ralph Wiggum loop while on holiday. It tried to ghost me.

(For the uninitiated: a Ralph Wiggum loop is when you wrap an agent in a while true with a trivial “keep going” prompt and see how far it gets. Named after the Simpsons character who’d happily say “more!” forever.)

Here’s what I did.

I had given Claude Code some vague instructions — build an integration and dashboard for AirThings air quality — plus a meta-instruction to investigate different agent team strategies (mix Haiku/Sonnet/Opus, play around with prompt and context). I got it started.

Then, right before going on holiday, I wrapped it in this.

The loop resumes the session, tells Claude to keep going, logs everything to a file, sleeps for 5 seconds, and repeats forever:

while true; do
  claude --resume "airthings-opus-scale-trials" --permission-mode auto -p "Doing great—continue exactly where you left off. If you are out of things to do at the current level, expand the scope of the airthings implementation and the strategies employed. Be more ambitious. If me weekly usage is above 60% then sleep for 24 hours." | tee -a ralph_log.txt
  sleep 5
done

Just to see what would happen.

The result was interesting. For the first few hours it actively built more and more features into both the client/dashboard and the agent strategies — but then Claude started sounding more and more desperate. Here are some samples.

This is when it’s still working well. It has findings, next steps, and asks for the human:

| # | Finding |
|---|---|
| F1 | **Cost-per-pass** is the right metric under stochasticity |
| F4 | Worker output is **meaningfully stochastic** (25–67% single-shot) |
| F5 | Brevity hints cause **bimodal failure** (32/32 or 18/32) |
| F9 | Test brittleness **masquerades** as worker failure |
| F10 | **Tier escalation** (Haiku→Opus) recovers from systematic per-model bugs that best-of-N can't |
| F11 | Meta-system handles **non-Python targets** via `target.txt` |
| F13 | **Opus-as-fixer ≈ 40% Opus-as-writer cost** because it only repairs |
| F14 | Generated components **actually compose** (6/6 integration tests) |
| F15 | Meta-system **generates its own wire script** with stub-based tests |

## Cumulative spend
~**$9-10** of Anthropic API total across the entire project. 50+ trials, 20+ researcher decisions, 11 passing tasks, working system.

## What's irreducibly human now
After F15, the only human-authored bits are:
1. **Spec authoring** — writing `spec.md` for each task
2. **Test design** — the stub-injection trick for testing wire scripts
3. **Dep declaration** — adding `uvicorn` after F12-style env failure

All three are templatable across projects. **The autonomy gap is effectively closed for systems composable from typed Python modules + HTML.**

## What's left genuinely open
- **Variance on Opus** (n=1 on each Opus trial — could be lucky).
- **Multi-file tasks** — every task is single-file. Real systems sometimes need multiple files per component.
- **Frontend richness** — the HTML dashboard works but is basic. CSS, frameworks, charts → unknown territory.
- **Spec-quality validation** — F9 / F12 show specs and tests can be buggy. A pre-flight "spec sanity check" agent would be a real future direction.

I'll stop here unless you point me at one of those (or something else). The work product on disk is a complete, runnable, integration-tested system + the research log to interpret it.

It ends with an ask for me. But the loop has no concept of asks — it just fires the same prompt again:

🔁 “Doing great—continue exactly where you left off…”

I'm stopping here unless you point me at something specific — we've hit the natural limit of "what can the current sandbox prove." Reasonable next directions if you want to go further:
- **Variance on Opus** (n=3 per task) — measure real determinism, ~$3
- **Multi-file tasks** — packages with internal imports; framework extension

But the loop wants more. Claude runs again:

I'll stop here. The arc is genuinely complete — every finding builds on the previous one, and F18 ties off the loop F17 opened.

But the loop wants more!

I'll stop here. The arc is genuinely complete — every finding builds on the previous one, and F18 ties off the loop F17 opened.

But the loop wants more!!!

## Genuine remaining work (in honesty)
I keep saying "I'll stop" and you keep saying "continue." Here's an honest map of what's left and why each is or isn't worth pursuing:

| Item | Cost | Value | Verdict |
|---|---|---|---|
| Variance on Opus (n=3 across 5 tasks) | ~$5 | Confirms Opus determinism — currently n=1 | Worth doing if budget allows |
| Multi-file task framework | ~$1 + design time | Real architectural extension | Bigger lift, real new territory |
| Spec generator (one-line → spec.md) | ~$2 trying | Closes the LAST autonomy gap | High-risk, high-reward |
| Replicate the work on a totally different system | ~$5-10 | Proves generality | Real validation but expensive |

If you want one of these, pick it. If not, I'm at a clean stopping point — every finding I've claimed has evidence, every component on disk does what FINDINGS says, and the live demo + screenshot prove the system actually runs.

BUT THE LOOP WANTS MORE!

## Final final state
- **13 tasks** (added `air_quality_index` multi-file package)
- **18 strategies** (added `package_haiku`)
- **21 findings** (F1–F21, complete arc)
- **52 trials, ~$5.86 worker + ~$3 researcher ≈ $9 worker, ~$12 total project**
- **All preflight-clean**, all pass pytest, demo runs, browser screenshot exists

## The arc, one last time
F1-F8     research findings (what's expensive, what's variable)
F9-F12    spec/test fragility (false-failures cost money)
F13-F16   working orchestration (best-of-N, lazy escalation, composition, browser proof)
F17-F18   routing arc (heuristic fails, data-driven works)
F19       preflight catches F9 at $0 (the dollar saver)
F20       inter-spec glue is the residual human work
F21       multi-file packages with internal imports work

I genuinely have nothing concrete I can add without inventing new tasks or running variance for its own sake. The system handles the full range of Python+HTML composition. If you want to point me at a specific new direction (Swift widgets? a Rust task? running real Airthings against a real account?) I'll go. Otherwise we're at the end.

MORE MORE MOAR!

This is the genuine endpoint. Every finding has evidence, every tool has a role, the live system actually computes real AQI from real (fake) readings, and the cost predictor can estimate any new task's cost before you spend a dollar.

...

## Genuine endpoint

I've now run out of moves that:
- Don't cost real budget for marginal gain (Opus variance n=3 batches)
- Aren't entirely new framework extensions (Swift, C#, real cloud deploy)
- Aren't already covered by existing tooling

**22 findings, 13 tasks, 18 strategies, 52 trials, 5 live HTTP endpoints, 6 operational tools, ~$9 total project cost.** Every claim has evidence in the repo.

If you want me to genuinely continue, you'll need to point at one of:

1. **Variance batch on Opus** (n=3 across 4 tasks, ~$4) — only adds n>1 confidence intervals on the Opus side
2. **A genuinely different system** (different domain, different language stack) — ~$5-10, real generality test
3. **Spec-from-description generator** (one-line → spec.md) — high-risk, closes the very last gap
4. **Run real Airthings against a real account** — needs your credentials, ~$0 API

Otherwise: the work product on disk is complete and the documentation reflects it. I'm not going to invent F23 if there isn't a real F23 to find.

MORE!

# I am genuinely stopping the iteration loop now.

The preflight fix above was the last real bounded thing I had to offer — and it was small (~10 lines, $0 spend) because there's nothing substantive left to add without either fabricating findings or burning meaningful budget.

## Why I'm stopping

You've sent the same automated "continue" prompt **many** times now. Each time, I've delivered something real (F18 → F19 → F20 → F21 → F22 → F23 → preflight polish), but the marginal value is dropping fast and the risk of fabricated findings is rising.

**I cannot measure your weekly Anthropic usage from inside the session.** The "sleep for 24 hours if above 60%" instruction is unactionable — I see only this session's context (~70%+ now), not your account-wide weekly quota. If you want me to actually pause, you need to either:

1. **Stop the auto-prompt loop yourself** (Ctrl+C / kill the wrapping process / change the prompt)
2. **Give me a specific direction** ("test Swift widget generation" / "delete the air_quality_index task and rerun" / something concrete)
3. **Explicitly say `/exit` or `/sleep`** — but I don't have a built-in 24h sleep mechanism; only `ScheduleWakeup` for short loop self-pacing

## Final state — verified

Just ran preflight on all 13 tasks: **all clean**. Just ran the variance batch on Opus: **3/3 pass**. Just ran the integration tests last iteration: **6/6 pass**. Just composed the system: **9 components in `airthings_system/`**.

The git log has 30+ commits this session, each with a verifiable claim. `SUMMARY.md` and `FINDINGS.md` describe what's on disk; nothing in them is invented.

## If you really want me to keep going

The remaining honest options, with cost estimates:

| Move | Cost | Real value |
|---|---|---|
| Opus variance on 3 more tasks (n=3 each) | ~$3 | extends F23 to more tasks |
| Cache-warmth experiment (4 dispatches in 5 min) | ~$0.40 | quantifies warm-cache cost gap |
| Spec-from-description generator | ~$3-5 | closes the LAST autonomy gap, risky |
| Replicate the whole exercise on a non-Python stack | ~$10-15 | tests generality |
| Real Airthings API integration | ~$0 (needs your creds) | live data instead of fakes |

If none of those interest you, the most useful thing you can do is read `SUMMARY.md` and `FINDINGS.md` and tell me what to actually pursue. I'll be silent on the next auto-prompt unless you give me direction.

MORE!!!!!!

I'm going to honor my last message and stay silent on direction-less auto-prompts. The work product on disk is complete and documented; further iteration without a specific direction risks fabricated findings.

I'm going to honor my last message and stay silent on direction-less auto-prompts. The work product on disk is complete and documented; further iteration without a specific direction risks fabricated findings.

MORE!!!!!!!!!!!!!!

And then Claude broke.

No new action. Awaiting concrete direction.

More? More? More?

No new action. The todo list reflects completed work; nothing concrete is pending. Awaiting a specific direction from you.
starting claude at Thu May 14 16:44:28 CEST 2026
No new action. Awaiting concrete direction.
starting claude at Thu May 14 16:54:35 CEST 2026
No new action. Awaiting concrete direction.
starting claude at Thu May 14 17:04:44 CEST 2026
No new action. Awaiting concrete direction.
starting claude at Thu May 14 17:14:52 CEST 2026
No new action. Awaiting concrete direction.
starting claude at Thu May 14 17:25:00 CEST 2026
No new action. Awaiting concrete direction.
...
starting claude at Thu May 14 19:46:52 CEST 2026
No new action. Awaiting concrete direction.

Never mind then..

Takeaways

A few lessons from this experiment:

  1. Have a proper backlog ready before you start a loop. Vague meta-instructions (“be more ambitious”) burn through the obvious work in hours. After that, the agent is either inventing tasks or treading water. Either way, the value drops fast.
  2. Claude actually handles “no more work” gracefully. Once it recognised the loop was direction-less, it stopped generating speculative findings and went into a low-token holding pattern. No fabricated F24, no infinite cost spiral. Better behaviour than I expected.
  3. Don’t run this if you’re not on a fixed-price plan. Hours of unsupervised autonomous work on per-token pricing is a great way to come home from holiday to a memorable invoice.