Creating Effective Prompts for Claude
Claude is a brilliant, and under-appreciated, alternative to ChatGPT. I've found its writing more relatable when producing long form content.
In this post, I'll summarize the Claude Doc's best practices for effective prompts.
First, describe your task well.
"Think of Claude as similar to an intern on their first day on the job. Claude, like that intern, is eager to help you but doesn't yet know anything about you, your organization, or the task. It is far more likely to meet your expectations if you give it clear, explicit instructions with all the necessary details."
Framing Claude as an intern helps me remember to:
- Explain what I want and how I want it done. I offer examples where possible to minimize misinterpretation. 2-3 examples is enough to infer the appropriate tone, level of detail, and formatting I expect.
- Don't expect any domain expertise. The intern is very smart, but doesn't have any industry experience. I provide any specific information I want it to use.
- For difficult tasks, I anticipate edge cases or tricky situations, and tell it what to do when it encounters them.
- Offer an easy out. Explicitly tell Claude it can say "I don't know" to prevent hallucinations.
Secondly, mark out parts of your prompt.
Delimiters and XML tags can demarcate different sections of a prompt. You can see an example of this in the featured image.
Lastly, documents before instructions.
Always provide documents and text before the instructions. Claude pays extra attention to the bottom of the prompt so emphasize important instructions near the end of your prompts.
This was surprising to me because ChatGPT works the other way. Open AI tells you to put instructions at the beginning of your prompts.
For more best practices, the official guidelines if you want to dive deeper:
https://docs.anthropic.com/claude/docs/introduction-to-prompt-design