QuestionQ117

Claude Code Configuration & Workflows

You are integrating Claude Code into your Continuous Integration/Continuous Deployment (CI/CD) pipeline. The system performs automated code reviews, generates test cases, and provides pull-request feedback. You must design prompts that deliver actionable feedback while minimizing false positives.

Your pipeline runs:

PROMPT="You are a code reviewer."  
PROMPT="$PROMPT Analyze the provided diff"  
PROMPT="$PROMPT for bugs, security issues,"  
PROMPT="$PROMPT and style violations." claude -p \ -- dangerously-skip-permissions \ --system-prompt "$PROMPT" \ < diff.txt  

The reviews finish and return feedback, but Claude comments only on the diff text piped in—it never reads surrounding files in the checked-out repository to gain broader context, even when the diff changes a function called by many other modules.

Which invocation change will make Claude read related repository files while still applying your custom review instructions?

Explanation

--append-system-prompt adds custom instructions to Claude Code’s default system prompt, whereas --system-prompt replaces it. Retaining the default prompt preserves Claude Code’s built-in guidance for using file-reading and code-navigation tools, allowing repository context to be examined during the review. Anthropic documents both flags for print mode and distinguishes appending to the default system prompt from replacing it.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!