Last reviewed
Correct answer: C. Sharing relevant surrounding code, language/framework version, and project conventions
Explanation
A model completing your code has no idea which version of the framework you are pinned to, what your team does about error handling, or that the helper it is about to invent already exists three files over. Give it a bare description and it fills those gaps with the statistical average of everything it has read. That is how a suggestion ends up calling an API that was removed two major versions ago, or quietly ignoring the repository pattern the rest of the codebase uses. Surrounding code, the version, and the conventions you actually follow are what narrow the guess.
The other three options describe the same move in different clothes: withholding information. Silence, brevity and unstated constraints are not neutral, because the gap gets filled either way, by you now or by the model later. Short prompts are fine when the context is already open in the editor, and length by itself proves nothing; a rambling paragraph that never mentions the framework version is worse than two specific sentences. What matters is whether the model can see the things your answer depends on.
Sources
“If you want to use a specific library, set the import statements at the top of the file or specify what library you want to use.”
“Think of Claude as a brilliant but new employee who lacks context on your norms and workflows. The more precisely you explain what you want, the better the result.”
“It is often useful to include additional context information the model can use to generate a response within the prompt you give the model.”
Practise 3 questions on this topic
Take Prompt Engineering for Code — Timed Test (3 questions) — scored instantly, explanation for every question, no login.