Run Claude Code headless in CI for triage
`claude -p` is non-interactive — wire it into CI to auto-label issues, draft PR descriptions, or first-pass review failing tests.
- Type: Prompt
- Tags: Coding Agent Hacks, Intermediate, Claude Code
- Updated: 2026-10-01
Prompt
`claude -p` is non-interactive — wire it into CI to auto-label issues, draft PR descriptions, or first-pass review failing tests. The `-p` flag takes a prompt and exits when done. With `--output-format json` you get structured results. Use it as a GitHub Action that runs on `issues.opened` to add labels, summarize the repro, and link related code. It's not a replacement for human review — it's the intern that does triage at 3am. Implementation example: # .github/workflows/triage.yml - run: | claude -p "Read issue #${{ github.event.issue.number }}. Look at related code. Output JSON: { labels: string[], summary: string, suspect_files: string[] }" \ --output-format json > triage.json gh issue edit ${{ github.event.issue.number }} \ --add-label "$(jq -r '.labels | join(",")' triage.json)"
More prompts
- Expense Report Automation System — Save More Time
- Meeting Scheduling Link Standardization — Save More Time
- Invoice Generation and Delivery Automation — Save More Time
- Document Template Automation Library — Save More Time
- Calendar Management Automation Rules — Save More Time
- File Organization and Naming System — Save More Time
- Recurring Payment Automation Setup — Save More Time
- Data Entry Elimination Framework — Save More Time