I’ve been tinkering with an idea that came from reading about the https://ghuntley.com/loop/ — the simple pattern of running an agent in a loop where each iteration reads its previous state, does work, and writes its new state. I wanted to see what happens if each iteration could also spawn more loops below it. .loop is a bash harness that runs Claude Code in an iterative loop with persistent memory. Any iteration can spawn child agents, each running their own independent loop. The parent pauses until the child finishes, reads what it learned, and continues. Children can spawn their own children. The goal is to give the loop itself more autonomy — not just the ability to keep going, but to decide it needs help, create a focused sub-agent, delegate to it, and absorb the result. How it works:
- Many short conversations instead of one long one — fresh context every iteration
progress.md as persistent memory across iterations (auto-archived to prevent bloat)
- Agents signal the harness: success (keep going), finished (done), or failed (retry)
- Spawned child agents block the parent until they finish, then the parent absorbs the result
- Git worktrees for isolation, automatic commits after every iteration, reverts on failure
- When an agent needs something it doesn’t have — a dataset, a tool, an API — it builds it from scratch in its own sandbox directory The stack is just bash, tmux, git worktrees, signal files, and Claude Code. No frameworks. This is a rough experiment. If anyone finds the idea interesting and wants to try it, poke at it, or build on it — the repo is here: https://github.com/jandrikus/loop submitted by /u/jandrikus
Originally posted by u/jandrikus on r/ClaudeCode
