Iterator finds bugs in a pull request and fixes them one by one. It uses any coding terminal (OpenCode, Claude Code, etc.) to do the actual work.
curl -fsSL https://raw.githubusercontent.com/potrepka/iterator/main/install.sh | bashRun this inside a git repository.
iterator PR [OPTIONS]| Flag | Default | Description |
|---|---|---|
PR |
(required) | Pull request number |
| Flag | Default | Description |
|---|---|---|
--terminal |
opencode run |
Command to run the coding terminal |
--prompt |
/review $PR |
Prompt sent to the terminal ($PR and $BRANCH are replaced) |
--output |
bugs/$BRANCH.md |
File where bugs are collected ($PR and $BRANCH are replaced) |
--search |
8 |
Search iterations per round |
--fix |
128 |
Upper bound of fix iterations per round |
--repeat |
4 |
Number of rounds |
--verbose |
(off) | Show terminal output |
Different terminals:
iterator 10
iterator 11 --terminal "claude -p"
iterator 12 --terminal "codex exec"
iterator 13 --terminal "gemini -p"Custom prompt and output:
iterator 14 --prompt '/audit $PR'
iterator 15 --output 'output/$BRANCH.md'Note: Use single quotes for
--promptand--outputvalues. Double quotes will cause the shell to expand$PRand$BRANCHbefore Iterator can substitute them.
Fewer iterations:
iterator 16 --search 4 --repeat 2Each round has two phases:
- Search: Runs the review prompt for
--searchiterations in separate terminal sessions. Each session appends any bugs it finds to the output file, skipping duplicates. - Fix: Picks the easiest bug to fix from the file, fixes it, removes it from the file, deletes the file if empty, commits the changes, and pushes. Repeats until the file is deleted or
--fixiterations is reached.
The script runs Search and Fix for --repeat rounds, then exits.
The script checks for a newer version on each run and updates itself if one is available.
MIT