[DOCS] Critical: GitHub Actions example recommends destructive `--system-prompt` flag instead of `--append-system-prompt`
Documentation Type
Unclear/confusing documentation
Documentation Location
https://code.claude.com/docs/en/github-actions#before-and-after-example
Section/Topic
The "Before and After Example" section under "Upgrading from Beta".
Current Documentation
In the GA version (v1.0) YAML example:
- uses: anthropics/claude-code-action@v1
with:
prompt: "Review this PR for security issues"
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
claude_args: |
--system-prompt "Follow our coding standards"
--max-turns 10
--model claude-sonnet-4-5-20250929
What's Wrong or Missing?
The example uses the --system-prompt flag to add custom instructions ("Follow our coding standards").
According to the CLI Reference, the --system-prompt flag "Replaces entire default prompt". This removes all default Claude Code instructions, tool definitions, and agentic behaviors. If a user copies this example, the agent will lose its ability to function as a coding agent because the core system prompt is wiped out.
The intention of the example is clearly to add constraints, not replace the entire agent personality.
Suggested Improvement
Update the claude_args in the example to use --append-system-prompt, which preserves the default capabilities while adding the user's instructions.
Suggested Change:
- uses: anthropics/claude-code-action@v1
with:
prompt: "Review this PR for security issues"
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
claude_args: |
--append-system-prompt "Follow our coding standards"
--max-turns 10
--model claude-sonnet-4-5-20250929
Impact
High - Prevents users from using a feature
Additional Context
Relevant section from CLI Reference regarding System Prompt Flags:
--system-prompt: Use when you need complete control over Claude's system prompt. This removes all default Claude Code instructions...--append-system-prompt: Use when you want to add specific instructions while keeping Claude Code's default capabilities intact. This is the safest option for most use cases.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗