← ClaudeAtlas

headless-automationlisted

Claude Code headless mode and CI/CD automation guide. Covers the -p flag for non-interactive execution, --output-format stream-json for structured output, GitHub Actions integration with anthropics/claude-code-action, GitLab CI and Jenkins pipeline patterns, batch processing with parallel instances, CLAUDE_CODE_TASK_LIST_ID for multi-instance coordination, and output parsing with jq. Use when automating Claude Code, setting up CI/CD pipelines, running batch processing, or scripting non-interactive workflows.
seanwinslow28/code-brain · ★ 0 · AI & Automation · score 72
Install: claude install-skill seanwinslow28/code-brain
# Headless Mode and Automation ## Purpose Automate Claude Code for CI/CD pipelines, batch processing, and scripted workflows using headless mode (-p flag), structured output formats, and multi-instance coordination. Build reliable automation that integrates with GitHub Actions, GitLab CI, Jenkins, and shell scripts. ## When to Use - Running Claude Code in CI/CD pipelines (GitHub Actions, GitLab, Jenkins) - Batch processing files or tasks with parallel instances - Piping data into Claude Code for automated analysis - Parsing structured output from headless runs - Coordinating multiple Claude Code instances on the same project - Setting up automated PR reviews or test generation ## Examples **Example 1: Automated PR review** ``` User: "Set up Claude Code to review PRs automatically in GitHub Actions" Claude: [Uses headless-automation] Creates .github/workflows/claude-review.yml: name: Claude PR Review on: pull_request jobs: review: runs-on: ubuntu-latest permissions: contents: read pull-requests: write steps: - uses: actions/checkout@v4 - uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} prompt: "Review this PR for security and performance issues." claude_args: "--max-turns 5" ``` **Example 2: Batch file analysis** ``` User: "Analyze all TypeScript files for type safety issues" Claude: [Uses headless-automation] Creates a fan-out script: for file i