headless-automationlisted
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