The quality of Claude's output depends more on how you ask than on Claude's capabilities. The same question asked two different ways can produce very different results.
The specificity principle
Vague: "How do I handle errors in Python?"
Specific: "In this async FastAPI endpoint that calls an external payment API, what's the right pattern for handling network timeouts vs. payment failures vs. unexpected status codes? I want to return appropriate HTTP status codes to the client."
The specific version gets a useful answer. The vague version gets a tutorial.
The constraint principle
Good prompts include constraints:
- "without adding new dependencies"
- "in under 20 lines"
- "using the patterns already in this file"
- "without changing the function signature"
Constraints narrow the solution space. Claude can't know your constraints unless you tell it.
The context principle
Claude knows general programming but not your specific situation. Add context:
- What version of the library you're using
- What you've already tried
- What the error message actually says
- What the surrounding code looks like
"It's not working" is not a problem statement. "The API returns 422 with this body and I expected 200" is.
The format principle
Tell Claude what format you want:
- "Give me just the code, no explanation"
- "List the options with tradeoffs, don't recommend one yet"
- "Show me the diff, not the full file"
- "One sentence answer"
Claude defaults to a verbose, explanation-heavy format. If you want something shorter or more specific, ask for it.
The checklist
Before sending a prompt:
- Have I said what I'm trying to accomplish (not just what to do)?
- Have I said what constraints apply?
- Have I given Claude the context it can't see?
- Have I said what format I want the answer in?
Four questions. The answers fit in one paragraph. The quality difference is substantial.
Top comments (0)