The best tricks to improve your prompts in Claude, two types of structure explained by the Claude team itself

Let’s tell you two structures to create better prompts in Claude, explained by the Anthropic team, creators of this artificial intelligence. They are very precise structures for this specific AI, although they will also work well in other alternatives such as ChatGPT , Gemini either Copilot inter alia. This is something more advanced than when we taught you how to improve Claude’s answers in a simple way.

This is a lesson in good prompting practices using engineering engineering. promptsthe practice with which to improve the commands you give to applications LLM. Come on, these are tricks to learn how to communicate with an AI more effectively and shape its responses so that they are better, more reliable, and more tailored to the task you want it to perform.

We are going to offer you two prompt structures. The first is a simple five step structure. It is perfect for relatively simple or slightly advanced tasks, and we are going to explain it to you in depth. Then there is a structure for much more sophisticated tasks that has ten steps, and in this case we are going to summarize it for you.

Five-step structure of a good prompt

Simpler structure
Simpler structure

The best way to communicate with artificial intelligence and with Claude in particular is to know the best structure for a good prompt. These structures are set up to make sure you give you all the information necessary for the AI ​​to correctly understand what you are asking it to do.

This is the best structure for a prompt according to Anthropic:

  1. One or two sentences to establish the role and description of the task you want me to do.
  2. Add dynamic content to contextualize
  3. Detailed task instructions
  4. Examples of what you want it to do (optional)
  5. Repeat critical instructions (especially when you write a very long prompt.

1. Describe the role and task to be performed

As you can see, first of all you need to spend some time establishing the role of the AI, saying what role it should play. For example, telling you that you are a high school teacher, or an AI specialized in reviewing accident reporting forms.

Along with the role of AI, it is also recommended describe the task to be performed. Come on, this is where you have to tell him what you want him to do by playing the role that you have indicated. These two elements should be the beginning of a good prompt.

2. Add dynamic content to contextualize

After describing the task, it is helpful to provide content to better contextualize your task or the content you want me to work on. For example, if you want it to analyze a text, a photograph, or even a web link, you should add it after the description.

This content can also be another element that you have obtained from an application, or even from an AI, whether it is a screenshot or something else. The main thing is that add what the AI ​​needs to do what you asked it to do. You can attach several files, but then you will have to describe well what you want it to do with each one.

3. Detailed task instructions

At the beginning of the prompt you have told it in summary what you want it to do, and then you have attached the content on which you want it to work. Now, after this introduction you will have to detail task instructions What do you want me to do?

This fragment of text becomes the heart of the task you are programming. You will have to tell it what you want it to do precisely, just as if you were telling it to a person so that they understand it correctly without having to ask you anything else. If you have added several images or different types of content for context, you will also have to explain what you want it to do with each of the elements.

4. You can give him examples of what you want him to do

When you do not give the AI ​​any example of the result you want it to offer you, it is what is called a Zero-shot or “0 examples”. With this, you will blindly trust that the artificial intelligence model knows how to do the task. However, when you want to obtain very specific results or with a specific formatthen you should explain this with examples.

You can use a single example or multiple examples. By doing this, the model will see the examples of the task already classified or solved, and will use that information to generate the new answers. keeping the same response format that you have indicated. The more examples you give, the more precise the answer format will be. This is optional, but in tasks that require a specific type of response it can be very useful.

5. Repeat critical instructions.

You’ve started by describing the task, and then you’ve given him a thorough description of each step he must take. But if you’re asking it to do a very complex task with a particularly long prompt, it’s a good idea to at the end repeat the most critical instructions of the task you have asked him to do.

This is the equivalent of underlining the most important and vital points of the instructions, something that you think is absolutely vital that you always keep in mind and not overlook it.

Advanced prompt structure in 10 steps

ten steps
ten steps

If the five-step structure isn’t enough for you, Claude’s creators also aim for a 10-step structure. It is like the first one we told you about, but more fragmented to give AI each and every detail what you will need.

Each of these steps can be one or several paragraphs in the prompt that we are going to compose. You don’t have to do this every time, normally the previous structure is enough, but for particularly complex tasks can help you. These are the ten steps summarized so that you understand them:

  1. Task context: You have to give him the context of the task, the type of task he must perform. For example, interpret a traffic document, analyze a text, extract information from an image, or whatever you ask. It’s like a header.
  2. Tone context: You can tell Claude to be objective, close, or to talk to you in a certain way. You can also specify that he only responds when he determines what he answers is true, and that if he has questions he asks you more questions. With the latter you will avoid forcing the AI ​​to invent things without being sure of it.
  3. Additional data, documents and images: You will have to add all the data, images and documents that you want it to work on. With this, you will be giving Claude important information, information that will not change and on which he will be able to work. For example, if you want him to work with forms, you can give him a blank form first so that he doesn’t waste time trying to guess what it looks like and takes that into account, which will help him also better read the other already filled out forms that you give him. You can also write the structure of the data you will receive with XML tags or even Markdown. For example, you can tell him that the form will have X columns, each representing one thing or another, all well labeled so that it is better understood. You can even tell it that the form will be filled out by humans and that sometimes there will be circles indicating things, or text that doesn’t line up perfectly in the boxes. This is only for the more advanced tasks you perform in the Anthropic console.
  4. Detailed description of the task and standards: You can make a list of rules or tasks that the AI ​​must perform with your request. Make a kind of step-by-step process for Claude to follow each one so he can analyze the information and complete the task in an informed way. This is critical for tasks that require consistent formatting, specific jargon, or following certain business standards. Very often the detailed list of rules or steps to follow is more useful than giving examples.
  5. Examples: You can also add several examples of the type of response you want the AI ​​to give you, to help better establish the desired response format.
  6. Conversation history: If you are going to have Claude generate responses as if you did, or perform tasks working on your behalf, you should give him examples of how you express yourself in real conversations, and thus help the AI ​​do so in a similar way. This step is optional, and useful when you are going to perform automations with Claude.
  7. Immediate description of the task or request: After having finished with all the points that shape the context of your request, it is advisable to remind the AI ​​of the most critical aspects of the task, highlighting the most important orders and the specific task it must perform. To avoid hallucinations you can add commands here such as answer only if you are confident in the answer to prevent you from making things up, think before answering, find relevant quotes in important documents, or say “I don’t know” when there is something you don’t know.
  8. Step by step thinking: You can give Claude instructions on how to process the task step by step. For example, imagine that you upload two elements, a document and an image, and if you don’t read the document you won’t understand the image. So, tell it to first read the document and what you want it to do, and then take certain things into account to analyze the image the way you want. It’s like giving you step-by-step instructions for whatever you do, and you can add as many steps as you need to make it stick to that order.
  9. Output format: After giving him the context and explaining how you want him to perform his task, now it’s time to start formatting the response you want him to give you. You will be able to tell it how you want the structure of the answer to be as detailed as you want.
  10. Filled in response (if any): And if you are looking for the response to have a specific format that you have an example of, you can end up giving it this context, examples of the response already made so that it adheres to that specific format, avoiding free interpretations of the instructions you have given before.

In Xataka Basics | 64 free courses for AI with Claude, ChatGPT, Gemini and Copilot created by your own companies

Leave your vote

Leave a Comment

GIPHY App Key not set. Please check settings

Log In

Forgot password?

Forgot password?

Enter your account data and we will send you a link to reset your password.

Your password reset link appears to be invalid or expired.

Log in

Privacy Policy

Add to Collection

No Collections

Here you'll find all collections you've created before.