From reference
Use Claude Code as a Unix utility. Headless mode, piping, CI/CD integration, output formats. Use when automating Claude into scripts or pipelines.
How this skill is triggered — by the user, by Claude, or both
Slash command
/reference:unix-pipeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Claude Code follows Unix philosophy — it's composable with other tools.
Claude Code follows Unix philosophy — it's composable with other tools.
Run without interactive session:
claude -p "explain this error" < error.log
claude -p "write a migration for adding email_verified_at to users" > migration.php
claude -p "review this diff for security issues" < <(git diff)
# Analyze build errors
cat build-error.txt | claude -p 'explain root cause and fix' > analysis.txt
# Generate commit message from diff
git diff --staged | claude -p 'write a concise commit message'
# Review a file
cat src/auth.php | claude -p 'review this for security vulnerabilities'
claude -p "prompt" --output-format text # Plain text (default)
claude -p "prompt" --output-format json # Structured JSON
claude -p "prompt" --output-format stream-json # Streaming JSON (for real-time)
# In GitHub Actions or CI pipeline
claude --permission-mode auto -p "fix all lint errors and commit"
# With tool restrictions
claude -p "review code" --allowedTools "Read,Grep,Glob"
{
"scripts": {
"ai:review": "git diff --staged | claude -p 'review this diff'",
"ai:commit": "git diff --staged | claude -p 'write commit message'",
"ai:test": "claude -p 'generate tests for recently changed files'"
}
}
claude -p "prompt" --verbose # Show tool calls and reasoning
npx claudepluginhub artmin96/forge-studio --plugin referenceIntegrates Claude Code into CI/CD pipelines using GitHub Actions, GitLab CI, pre-commit hooks for automated PR reviews, code generation, test validation, security scanning, headless mode, and cost control.
Use when the user asks to run Claude Code CLI (`claude`, `claude resume`) for review, analysis, implementation, refactoring, debugging, or follow-up specifically through Claude Code.
Runs Anthropic's Claude CLI as a subagent for second opinions, code reviews, and questions from a Codex (or other) session when you want an external perspective.