Writing better prompts for Claude AI
Learn advanced prompting methods professionals use to get the best results with Claude AI
AI Tool: Claude
Level: Beginner
Access: Free
This guide is part 5 of the free course Learn how to use Claude.
In this guide, we will cover:
Using Claude - Going Beyond the Basics
Be Clear and Specific
Use Examples and Analogies
Break Down Complex Tasks
Use Constraints and Boundaries
Use Iterative Refinement
Role Assignment
Combining Techniques
If you need help setting up Claude, see part 3 of this course.
Using Claude - Going Beyond the Basics
If you've started using basic prompts for Claude, that's a great step, you have skills 98% of people don't yet have, congratulations! So what's next?
You might have discovered that you get varying results using Claude, sometimes you get great results, sometimes not so great. Is that just bad luck? Not exactly.
While Claude can't do everything, sometimes the reason you don't get good results is not that, but because we didn't ask Claude in the best way.
What is the best way?
That's what Prompt engineering is all about. Researchers have studied the best ways to use LLMs like Claude and have found 6 key techniques that help get the best results.Â
These are 6 advanced prompt engineering techniques AI professionals and data scientists use, and I have used them myself in both roles. Now I’ll show you what they are, and how you can use them.
1. Be Clear and Specific
Being clear and specific in your prompts ensures that Claude understands exactly what you are asking for. This technique involves providing clear, explicit instructions and context to guide Claude's responses accurately.
Example 1
Instead of asking "Write a poem," specify "Write a limerick poem about a cat who loves to play fetch."
How It Works: By specifying the type of poem and its subject, you help Claude understand the task better and generate a more relevant response.
Example 2
Instead of asking "How do companies grow?", ask "What strategies do tech startups use in their first year to increase their customer base?"
How It Works: This specific prompt eliminates ambiguity and helps Claude provide a more targeted and useful response
2. Use Examples and Analogies
Including examples in your prompts helps illustrate the desired output format or style. This technique guides Claude's responses by providing a pattern to follow.
Example 1
Ask Claude to "Describe how photosynthesis works using an analogy, like comparing it to baking a cake."
How It Works: Analogies help simplify complex concepts by relating them to familiar processes, aiding understanding.
Example 2
Ask Claude to "Generate a product description for a smartphone, similar to this: [Insert example here]."
How It Works: This technique clarifies the expected format and content of the response, leading to more accurate outputs
3. Break Down Complex Tasks
Breaking down complex tasks into smaller, more manageable steps helps Claude understand and execute complex tasks more effectively.
Example 1
Ask Claude to "First, explain the concept of blockchain technology. Then, discuss its applications in supply chain management."
How It Works: By dividing the task into step-by-step instructions, you help Claude provide more structured and detailed responses.
Example 2
Ask Claude to "First, list the key features of a successful marketing campaign. Then, explain how to implement each feature effectively."
How It Works: By dividing the task into listing and explaining features, you guide Claude through a structured response.
4. Use Constraints and Boundaries
Setting specific rules or limitations for Claude's responses helps control the output format, length, or content.
Example 1
Ask Claude to "List three benefits of renewable energy."
How It Works: By specifying the number of points to list, you constrain Claude's response to provide exactly what you need.
Example 2
Ask Claude to "Write a 500-word article on the impact of AI on healthcare, without using technical jargon."
How It Works: This technique ensures that Claude's response adheres to specific requirements, such as word count and writing style
5. Use Iterative Refinement
Iterative refinement involves progressively adjusting multiple prompts based on previous outputs to fine-tune the results.
Example 1
Initial Prompt: "Explain the concept of artificial intelligence."
Refined Prompt: "Based on your previous explanation, provide more details on the applications of AI in healthcare."
Further Refinement: "Considering the ethical implications, discuss potential challenges in implementing AI in healthcare settings."
How It Works: By refining prompts based on initial responses, you can guide Claude towards more detailed and focused answers.
Example 2
Initial Prompt: "Create an outline for a novel set in space."
Refined Prompt: "Add character development details for the protagonist in the outline."
Further Refinement: "Include potential plot twists that could occur during space exploration."
How It Works: This approach allows you to explore various narrative elements before settling on a comprehensive outline.
6. Role Assignment
Role assignment involves specifying a particular role or expertise for Claude to assume when generating responses. This can considerably improve the quality of the responses for a specific use case.
Example 1
Ask Claude to "As a travel agent, recommend three must-visit destinations in Europe for a family vacation."
How It Works: By assigning the role of a travel agent, you help Claude provide recommendations that are most relevant and practical for a family vacation.
Example 2
Ask Claude to "As a financial advisor, explain the benefits and risks of investing in cryptocurrency."
How It Works: This technique ensures that Claude's response is informed by the expertise and perspective of a financial advisor, providing a more authoritative, expert and nuanced explanation.
Combining Techniques
Using any one of these advanced techniques alone can be a significant boost to your prompting results with Claude.
But if you want to take it to the next level, to the best results possible, then consider combining some of these techniques. Here are some examples of how.
Example 1
Ask Claude to "As an expert financial analyst, summarise the current stock market trends. First, explain the concept of market volatility. Then, discuss its impact on investment strategies."
Methods Used: Clear and specific instructions, role assignment, breaking down complex tasks.
How It Works: By combining these techniques, you provide Claude with a clear understanding of the task, the role to assume, and the steps to follow, leading to a more accurate and relevant response.
Example 2
Ask Claude to "As an experienced travel guide, create an itinerary for a three-day trip to Paris. First, list must-see attractions. Then suggest dining options near each attraction."
Methods Used: Clear and specific instructions, role assignment, breaking down complex tasks.
How It Works: By combining these techniques, you provide Claude with clear guidance on structuring an itinerary while considering practical details like dining options.
Example 3
Ask Claude to "As an experienced chef, design a three-course meal plan. First, suggest appetisers suitable for summer. Then, propose main courses that pair well with each appetiser."
Methods Used: Clear and specific instructions, role assignment, breaking down complex tasks.
How It Works: By combining these techniques, you provide Claude with clear guidance on structuring a meal plan while considering seasonal appropriateness.
Conclusion
By mastering these advanced prompting techniques and combining them effectively, you can unlock Claude's full potential and achieve better results for your specific tasks and projects, and take your skills to the next level.
Remember, the key is to experiment, iterate, and refine your prompts based on Claude's responses. With practice and persistence, you'll learn to craft prompts that give impressive results from Claude.
Next guide in the course: Mastering Claude AI: Tips and Tricks for Effective Use