CLI commands and flags

--max-turns

Restricts the total number of agent interaction turns allowed in print mode.

Syntax

--max-turns

Example

Terminal
claude -p --max-turns 3 "query"

Type to search the reference, templates and lessons.