Claude Code works as a Unix citizen. Pipe anything into it:
# Analyze error logs
cat error.log | claude -p "What's causing these errors? Suggest fixes."
# Review a diff
git diff | claude -p "Review this diff for bugs and suggest improvements."
# Explain a file
cat src/complex-module.ts | claude -p "Explain this code in plain English."
# Analyze test failures
npm test 2>&1 | claude -p "Why are these tests failing? Give me the fix."
Combine with Other Tools
# Find and analyze all TODO comments
grep -rn "TODO" src/ | claude -p "Prioritize these TODOs by importance and suggest which to tackle first."
# Check for security issues in dependencies
npm audit 2>&1 | claude -p "Which of these vulnerabilities are critical and how do I fix them?"
# Analyze git history
git log --oneline -20 | claude -p "Summarize what's been worked on recently."
Output as JSON
git diff --staged | claude -p "List all changed functions" --output-format json
The -p flag makes Claude non-interactive. It reads stdin, processes it, and prints the result to stdout. Perfect for scripting.