Day 14
Loop Mode
Automate repetitive tasks — generate tests for every function, document every endpoint, refactor every file.
0 / 4 tasks
What is Loop mode?
Loop mode (invoked with `/loop`) runs a task repeatedly over a set of inputs — files, functions, endpoints, etc. It's perfect for tasks where the logic is the same but the target changes. Think: 'add docstrings to every function' or 'generate tests for every endpoint'.
Loop examples
bash
# Loop over all Python files and add type hints
claude
> /loop For each Python file in app/services/, add type hints to all functions. Process one file at a time.
# Loop over API endpoints and generate tests
> /loop For each endpoint in app/api/, generate a corresponding test file in tests/api/. Use the existing test_users.py as a template.
# Loop over a list
> /loop I have these 5 database tables: users, posts, comments, tags, attachments. For each one, generate a Pydantic schema in app/schemas/.