This is a port of the Pickle Rick Gemini CLI extension (itself an implementation of Geoffrey Huntley's "Ralph Wiggum" technique) for Claude Code, with one meaningful enhancement: context clearing
between iterations.
The core idea: a Claude Code Stop hook intercepts every session exit and blocks it, injecting a fresh prompt instead. Claude never actually stops — it just keeps working through a rigid lifecycle (PRD
→ ticket breakdown → per-ticket research/plan/implement/refactor) until the task is genuinely complete or a limit is hit.
The problem with long loops: Claude Code compresses old conversation turns as context fills up. After enough iterations, the agent loses track of what phase it's in, which tickets are done, and what
it was supposed to be building. It starts restarting from scratch.
The fix: every decision: block response from the Stop hook includes a reason field with a structured session summary — current phase, iteration count, ticket checklist with status, original task,
session path. Claude Code injects this as a system message at the top of each new iteration. Even after full conversation compression, Rick wakes up knowing exactly where he is.
Workers (Morty) already got clean context for free since they're fresh claude -p subprocesses. This brings the same resilience to the long-running manager session.
Also ports the "Pickle Jar" queue — you can jar multiple tasks during the day and run them all unattended overnight with /pickle-jar-open.
Repo: https://github.com/gregorydickson/pickle-rick-claude
Credit: galz10 for the original Pickle Rick extension, Geoffrey Huntley for the Ralph Wiggum technique.