Craig Motlin's Autonomous Development Loop
Table of content

Craig P. Motlin is a VP at Two Sigma and a software engineer with 20+ years of experience. He studied Computer Science and Finance at the University of Pennsylvania. Previously, he spent 12 years at Goldman Sachs. His blog at motlin.com documents his Claude Code setup in detail, and he maintains his dotfiles publicly on GitHub.
Motlin built a Claude Code workflow that runs autonomously for hours, processing task lists without human input. His system combines todo-driven automation, hierarchical subagents, and parallel git worktrees to keep multiple Claude instances working simultaneously.
Background
- Two Sigma VP: Engineering Manager of Software Development Life Cycle
- Goldman Sachs: 12 years as VP Senior Engineer
- Open Source: Contributor to Eclipse Collections, maintains public dotfiles
- Blog: Detailed Claude Code series covering configuration, workflows, and automation
The Development Loop
Motlin’s core workflow is a repeating cycle:
/todo → Test → /commit → /compact → Repeat
Each command does one thing:
| Command | Purpose |
|---|---|
/todo | Implement the next incomplete task from .llm/todo.md |
/commit | Stage and commit with a concise message |
/compact | Summarize conversation to manage context window |
He plans features by chatting with a thinking model, requesting a markdown checklist in implementation order. Each checkbox is an independently committable task.
<!-- .llm/todo.md -->
- [ ] Add user authentication endpoint
- [ ] Implement JWT token generation
- [ ] Add refresh token rotation
- [ ] Write integration tests
The /todo command extracts the first incomplete task and implements it in isolation. Every task contains all the context needed to execute.
Parallel Worktrees
LLMs work slowly. Waiting for one task wastes time. Motlin’s solution: run multiple Claude instances on separate git worktrees.
# Create worktree for a task
git worktree add ../project-auth feature/auth
# Run Claude in the worktree
cd ../project-auth && claude /worktree
His /worktree command automates this:
- Mark the next todo as in-progress
- Create a new git worktree with a branch
- Copy environment files (.envrc, etc.)
- Create a focused single-task todo file
- Launch Claude in a new terminal tab
Each Claude instance works in complete isolation. No file conflicts. He runs loops outside Claude to spawn multiple instances:
for i in $(seq 1 10); do claude /worktree; done
When tasks complete, he cherry-picks commits into a single branch for review. Anthropic now officially recommends this parallel worktree approach in their documentation.
Hierarchical Subagents
The real power comes from nested agents. Motlin’s /todo-all command orchestrates a looping workflow:
/todo-all
└── @do-todo (implements task)
├── @comment-cleaner (removes redundant comments)
├── @precommit-runner (validates build/tests)
├── @git-commit-handler (stages and commits)
└── @git-rebaser (rebases on upstream)
└── @conflict-resolver (handles merge conflicts)
The key insight: each subagent runs in its own context window. All the verbose output (test failures, build logs, git operations) happens inside the subagent and never touches the main window.
This separation prevents token bloat. Motlin’s longest automation run lasted over two hours. Claude worked independently, processing an entire task list without human input.
Configuration
Motlin uses a tiered configuration system:
- Global
~/.claude/CLAUDE.md: Default behaviors across all projects - Project
CLAUDE.local.md: Overrides without committing Claude-specific files
His configuration includes:
## Code Style
- Prefer explicit types over inference
- No redundant comments
## LLM-Specific
- Do not run long-lived processes (npm start, npm dev)
- Do not force push or delete branches
- Gather contextual files in `.llm/` directories
He accepts that LLMs generate excessive comments despite instructions. Instead of fighting it, he uses /all-comments to clean them up after.
Phone Notifications
When Claude finishes a task, Motlin gets a notification on his phone:
{
"hooks": {
"Stop": [{
"matcher": "",
"hooks": [{
"type": "command",
"command": "if [ \"$NOTIFICATIONS\" = \"true\" ]; then woof \"Claude: $(basename $(pwd))\"; fi"
}]
}]
}
}
This uses Pushover via a custom woof command. He can walk away from a task and know when to come back.
Key Takeaways
| Principle | Implementation |
|---|---|
| Task isolation | Each todo contains all needed context |
| Parallel execution | Git worktrees for multiple Claude instances |
| Context preservation | Subagents run in separate context windows |
| Autonomous loops | /todo-all processes entire task lists |
| Post-hoc cleanup | Accept LLM quirks, fix after with commands |
Lessons Learned
Motlin discovered that agents work better with several short, focused prompts rather than one long prompt with multiple steps. Converting slash commands to subagents enabled this decomposition naturally.
He also found that agent descriptions load lazily. Unlike slash commands that load fully into context when invoked, agents load only their description initially. Full prompts stay in isolated context windows, similar to MCP tools.
Links
- Claude Code: My Complete Setup
- The Perfect Development Loop
- Parallel Development with /worktree
- Keeping It Running for Hours
- From Slash Commands to Agents
- GitHub: @motlin
- X: @motlin
Next: Jesse Vincent’s Superpowers Skills Framework
Get updates
New guides, workflows, and AI patterns. No spam.
Thank you! You're on the list.