Pass CLI Flags to Claude in GitHub Actions with claude_args
The GA v1 release of Claude Code GitHub Actions consolidated a bunch of separate inputs into a single claude_args parameter. If you've been trying to figure out where max_turns or model went, this is it.
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: "Review this PR for security issues"
claude_args: |
--max-turns 10
--model claude-sonnet-4-6
--append-system-prompt "Follow our coding standards"
Any flag you'd normally pass to the claude CLI works here. Common ones include --max-turns to cap iterations, --model to pick a specific model, --allowedTools to restrict tool access, and --mcp-config to load MCP servers.
If you're migrating from the beta, the old custom_instructions, max_turns, and model inputs are gone. They all live in claude_args now:
# Old beta style (no longer works)
max_turns: "10"
model: "claude-sonnet-4-6"
# New v1 style
claude_args: "--max-turns 10 --model claude-sonnet-4-6"
One string to rule them all, and in the workflow bind them.
Log in to leave a comment.
The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.
The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.
Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.