LogoSu Jiang
  • Blog
  • Knowledge Base
  • About Me
I Went to Sleep, Woke Up to Finished Code
2026/01/14

I Went to Sleep, Woke Up to Finished Code

About Ralph Loop: a technique that lets AI autonomously execute tasks in a loop. $297 to complete a $50K contract. 3 months to generate an entire programming language.

I came across a few cases recently that deserve documenting.


$50K Contract, $297 to Complete

Geoffrey Huntley invented this method. He shared a friend's result on Twitter: a $50,000 freelance contract completed overnight by Claude, costing just $297 in API fees. MVP delivered, tests passed, code working.

Ralph Loop ROI Comparison

That's 167x ROI. Not a number from a pitch deck—an actual iMessage screenshot.


Three Months, One Programming Language

Huntley ran an even crazier experiment himself.

He gave Claude a simple instruction: "Make a programming language like Go, but swap all keywords with Gen Z slang." Then let Claude run in a bash loop for three months.

Three months later, out came a programming language called Cursed. 1,198 git commits, a complete compiler supporting macOS, Linux, and Windows, with both interpreter and LLVM compilation modes. The code started in C, then the AI rewrote it in Rust, then rewrote it again in Zig.

API cost: roughly $14,000—about a quarter of a San Francisco engineer's monthly salary. Now available for download at cursed-lang.org.


Other Cases

At a Y Combinator hackathon, a team started this system at night and woke up to find 6 complete code repositories—with tests, documentation, and deployment configs.

A large project migrated from React v16 to v19 using this method in 14 hours, zero human intervention.

In a recent viral video, a French developer used Claude Code + Ralph to generate a complete marketing plan in 10 minutes. Competitor research ran 17 automated searches, user personas pulled real pain points verbatim from Reddit, and the output included pricing strategy, value ladder, and landing page HTML. He even created two AI Agents simulating Alex Hormozi's and Russell Brunson's methodologies to review each step—if something didn't pass, it got redone.


What's It Called

Ralph Loop, also known as the Ralph Wiggum technique—named after The Simpsons character.

The core principle is dead simple, one line of bash:

while :; do cat PROMPT.md | claude-code ; done

It's an infinite loop that keeps feeding the same prompt to Claude Code. When Claude finishes and tries to exit, a hook intercepts it and re-feeds the prompt. Claude then reviews its previous code and continues improving. This repeats until preset completion conditions are met or maximum iterations are reached.

Ralph Loop Terminal Demo


Why It Works

Traditional AI coding has several problems. Context gets eaten—chat long enough and the AI forgets things. You need to babysit it constantly, going back and forth one question at a time. Quality is inconsistent—AI occasionally does something dumb and you have to fix it manually.

Ralph Loop solves this differently: each iteration uses fresh context, but memory persists through git history and files like progress.txt. The AI reads "inheritance" left by the previous round, not its own context. No babysitting needed—set the prompt and completion conditions, let it run, go to sleep. Built-in feedback loops run tests and typecheck after each round. If something fails, it keeps iterating. Quality has a floor.

As Huntley puts it: "Ralph makes mistakes, but every time it does, I tune the prompt—like tuning a guitar."


When to Use It

Works well for tasks with clear objectives and acceptance criteria. Things like "all tests pass" or "all lint errors fixed"—where machines can determine right from wrong. Repetitive work fits too: batch migrations, batch generation. Greenfield projects and documentation generation—tasks that don't require deep judgment—are ideal.

What doesn't work is also clear: anything requiring complex decisions, fuzzy acceptance criteria, or high-risk production code.


My Observation

The core of this isn't the technology. The technology is just one line of bash.

The core is the ability to define tasks. You need to break vague requirements into clear steps, each with explicit acceptance criteria. If you can do that, AI can execute for you. If you can't, no amount of AI capability will help.

It's the same principle as managing people—except now you're managing machines.


Resources

Ralph project: https://github.com/snarktank/ralph

Geoffrey Huntley's blog: https://ghuntley.com/ralph/

Cursed programming language: https://cursed-lang.org

Original video: Search YouTube for "Claude Code Built My Entire $100M Offer"


If you're also exploring AI workflows like this, feel free to reach out.

I'm working on something: helping people turn the most repetitive, resource-draining parts of their business into AI-executable workflows. Not selling courses—delivering results. Let's chat if you're interested.

All Posts

Author

avatar for Su Jiang
Su Jiang

Categories

  • AI探索
$50K Contract, $297 to CompleteThree Months, One Programming LanguageOther CasesWhat's It CalledWhy It WorksWhen to Use ItMy ObservationResources

More Posts

苏江:我们每个人都会死的。
AI探索

苏江:我们每个人都会死的。

苏江:我们每个人都会死的。

avatar for Su Jiang
Su Jiang
2025/06/13
苏江:一场针对财务工作者的AI培训
AI探索

苏江:一场针对财务工作者的AI培训

苏江:一场针对财务工作者的AI培训

avatar for Su Jiang
Su Jiang
2025/09/26
杨振宁:发现宇宙的不对称之美
AI探索

杨振宁:发现宇宙的不对称之美

杨振宁:发现宇宙的不对称之美

avatar for Su Jiang
Su Jiang
2025/10/19

Need a Custom Solution?

Still stuck or want someone to handle the heavy lifting? Send me a quick message. I reply to every inquiry within 24 hours—and yes, simple advice is always free.

100% Privacy. No spam, just solutions.

Newsletter

Join the community

Subscribe to our newsletter for the latest news and updates

LogoSu Jiang

AI Developer · Writer · Investor | Exploring AI Applications

TwitterX (Twitter)Email

WeChat: iamsujiang

WeChat QR Code
Scan to add WeChat
Product
  • Features
  • Pricing
  • FAQ
Resources
  • Blog
  • Knowledge Base
Company
  • About Me
  • Contact
  • Waitlist
Legal
  • Cookie Policy
  • Privacy Policy
  • Terms of Service
© 2026 Su Jiang All Rights Reserved.