[ ABORT TO HUD ]
SEQ. 1
SEQ. 2
SEQ. 3

Headless Mode & CI Automation

💻 Claude Code CLI⏱ 15 min⭐ 1000 BASE XP⌨ HANDS-ON LAB

Headless Execution in CI/CD

Headless Mode enables Claude Code to run autonomously in automated pipelines, GitHub Actions, and background jobs using the -p / --print flag.

# Run a one-shot headless command
claude -p "Review recent git diff and check for security vulnerabilities"

# Automated test failure diagnosis in CI
claude -p "Analyze npm test failure logs and suggest fixes"

Subagent Coordination

When dealing with complex codebases, Claude Code can coordinate focused subtasks-investigating dependencies, analyzing test suites, or formatting files-and synthesize the results back to the primary developer workflow.

⌨ HANDS-ON LABAutomate Code Audits Headless in CI
⭐ +200 XP

Integrate Claude Code into continuous integration. Run a headless analysis with --print (-p) that inspects git diff and exits cleanly.

1Run claude in print mode (-p) to audit git changes without opening an interactive terminal.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 1 — type "hint" if stuck
SYNAPSE VERIFICATION
QUERY 1 // 1
Which CLI flag runs Claude Code in one-shot headless mode for scripts and CI?
-h
-p / --print
--ci-only
-s