A CI agent costs what its trigger, turn cap, model and tools allow — cheat sheet
claude-code, ai-agents
# one bounded classification
claude -p "…" --model haiku --tools "" --max-turns 3 \
--json-schema '{"type":"object","properties":{"label":{"type":"string","enum":["bug","question"]}},"required":["label"]}' \
--no-session-persistence --output-format json > out.json
jq -r '.structured_output.label // "question"' out.json
jq -c '{subtype, num_turns, is_error, total_cost_usd, models: (.modelUsage|keys)}' out.json
# other caps
claude -p "…" --max-budget-usd 0.50 # estimate-based, subagents included
MAX_THINKING_TOKENS=0 claude -p "…" # no extended thinking for no-tool jobs
# is a run still going? (a job step that never ends)
timeout 300 sh ci/triage.sh; echo "exit $?" # 124 = killed by timeout