PDF File

Latest Anthropic CCAR-F Practice Questions BY Byrd

Question 1

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 complete and return feedback, but Claude comments only on the piped diff---it never reads surrounding files in the checked-out repository to understand broader context, even when the diff modifies a function called by many other modules. Which change to the invocation will cause Claude to read related repository files while still applying your custom review instructions?

  • A. Keep --system-prompt and add --allowedTools "Read, Glob, Grep" because non-interactive -p mode otherwise disables filesystem tools.
  • B. Replace --system-prompt with --append-system-prompt so the review instructions are added to Claude Code's default prompt instead of overwriting its built-in file-reading and code-navigation guidance.
  • C. Remove --system-prompt entirely and place the review instructions in a root-level CLAUDE.md because --system-prompt is incompatible with tool use under -p.
  • D. Stop piping the diff through standard input and embed it in the prompt string so Claude Code treats the invocation as an agentic session rather than a stream-processing operation.