Loop Command

The loop command runs Claude Code in an automated cycle — it picks the next available task, implements it, marks it done, and moves on. You can step away and come back to completed work.

Usage

# Start the automated loop
tm loop

# Watch Claude's work in real-time
tm loop --verbose

# Run in a Docker sandbox for isolation
tm loop --sandbox

How It Works

Each iteration of the loop:

  1. Finds the next task respecting dependencies and priorities
  2. Builds a prompt with full task context
  3. Launches Claude Code to implement the task
  4. Waits for completion (detected via structured markers)
  5. Moves to the next available task
  6. Stops when all tasks are done or a task is blocked

Progress is tracked in .taskmaster/loop-progress.txt so you can monitor status.

Presets

Presets configure the loop for different development workflows:

# Default preset — standard task execution
tm loop

# TDD preset — enforce test-driven development
tm loop --preset test-coverage

# Linting preset — enforce code quality checks
tm loop --preset linting

# Duplication preset — check for code duplication
tm loop --preset duplication
Preset Focus
default Standard task execution
test-coverage Enforce tests with each task
linting Run linting after each task
duplication Check for duplicate code
entropy Minimize code complexity

Options

Flag Description
--verbose / -v Show Claude's real-time output
--no-output Exclude full output to save memory
--sandbox Run in Docker sandbox for isolation
--preset <name> Use a specific workflow preset

Loop vs Start vs Clusters

Command Best for
tm start Single task, hands-on implementation
tm loop Sequential automation, step away and return
tm clusters start Parallel automation with agent teams

Tips

  • Use --verbose the first few times to build confidence in what the loop is doing
  • The loop respects your dependency graph — it won't skip ahead
  • If a task gets blocked, the loop stops and reports why
  • You can interrupt with Ctrl+C and resume later — progress is saved