Agent Task Brief
Give an AI agent a clear goal, boundaries and a checkable definition of done.
Structured prompts, long source material and clear boundaries.
Claude is often used for long documents, careful analysis, coding and agent-style tasks. It tends to do well when a prompt is organized into clearly labeled parts and when the task has clear boundaries. This page shows how to structure prompts for it, with a copyable formula, before-and-after examples, common mistakes and templates that suit it. It suits people who work with long source material or who set up assistants for multi-step work. The advice is general and based on stable habits, so check the provider's documentation for the latest features.
Claude tends to follow prompts that separate instructions, context and material into labeled parts. Tag-style delimiters, such as <task> and <context>, are a simple way to do this. They also make the prompt easier for you to scan and edit. Pick tag names that describe the content, and use the same names every time so your own templates stay consistent. Plain headings can work too, as long as the boundaries between parts are obvious. The real benefit is clarity: when the model can tell exactly where your document ends and your request begins, it is less likely to treat text from the document as an instruction. Tags are also handy for reuse: you can keep a prompt skeleton in a note and fill in the sections each time.
When you paste a long document, place it near the top of the prompt and put your question or instruction after it. This tends to work better than a short instruction followed by pages of text, because the model reads the material before it learns what you want from it. Wrap the document in its own section and refer to it by name in the task, for example: "Using the text in <report>, list the three main risks." If you have several documents, give each one its own section and a clear name, and say which one the question concerns, so the answer does not blend them together.
State the output format and length explicitly: a table with named columns, five bullet points, a 150-word summary, a JSON structure. If you leave format open, you get whatever the model considers a good default, which may not suit your next step. When the output feeds another tool or person, give an example of the exact shape you need and say to follow it. A single short example often communicates structure better than a paragraph of description, and it helps keep answers consistent when you run the same prompt many times.
For multi-step or agent-style work, describe the goal, what the model may use, what it must not do, when it should stop and ask, and how you will judge the result. Claude tends to respond well to a clear definition of done and to being asked to restate its plan before it starts. Put persistent rules in a system prompt, and keep task-specific details in the message. This division keeps your instructions stable over many tasks and makes it easier to see which part to change when the results are not what you expected.
Tell the model what to do when information is missing: ask you, state an assumption, or leave the item out. Without that instruction, any assistant may fill gaps with plausible guesses. A short line such as "If something essential is missing, ask me before you continue" often improves reliability more than extra detail elsewhere in the prompt. Do this early in the prompt, since it shapes how the model treats everything that follows.
The formula below puts long material first, then the role, task, context, output format and constraints, each in its own labeled section. Fill in only what the task needs: a quick question may need just the task and the format, while a document analysis uses every part. Delete sections you do not need rather than leaving them empty. Keep the closing instruction, because it asks the model to restate the task, to check its own work and to ask you when something is missing instead of guessing.
<documents>
{source_material}
</documents>
<role>
{role}
</role>
<task>
{task}
</task>
<context>
{context}
</context>
<output_format>
{output_format}
</output_format>
<constraints>
{constraints}
</constraints>
Before you answer, restate the task in one sentence. If something essential is missing, ask me instead of guessing. When you finish, check your answer against the task and the constraints and tell me what you could not verify.| Variable | What to put in | Example |
|---|---|---|
| {source_material} | Documents, notes or data to work from. Delete the section if there are none. | The full text of a project report. |
| {role} | The perspective to take, only if it helps. | A careful analyst who reads for risks. |
| {task} | The one thing you want done. | List the three biggest risks to the delivery date. |
| {context} | What the model cannot guess. | The report is for a client meeting on Friday. |
| {output_format} | The shape and length of the answer. | A table with risk, evidence and suggested action. |
| {constraints} | Rules and limits. | Use only the report; do not speculate beyond it. |
Illustrative examples of how a prompt can change. They are not output from any specific product.
Why it is better: The material sits in its own section, the reader and the length are defined, and the model knows what to do when the report is silent. The result is easier to use and easier to check against the original. It is also a prompt you can reuse for the next report by replacing one section.
Why it is better: It separates the error from the code, asks for the cause before the fix and allows the model to ask a question rather than guess. You see the reasoning first, so you can judge whether the fix makes sense before you apply it.
Why it is better: The task has a goal, a finish line and boundaries, and the plan check lets you correct course before the work begins. Each of those removes a place where an agent-style task usually goes wrong.
Claude is often used for multi-step work: reading several documents, planning, writing code and revising it. Whether it can search, open files or run tools depends on the product and the settings you use, so check what is available to you. The prompting principles stay the same either way, and they matter more as the number of steps grows.
Start with the goal and a definition of done that you can check. List the inputs the model may use and the actions that need your approval. If tools are available, say which ones it may use freely and which require a question first. Ask for a short plan before it begins and read it, since a wrong assumption is cheapest to fix at that point.
For longer tasks, add checkpoints: after each major step, ask the model to summarize what it did and what remains. If your plan supports file uploads, name each file in the prompt and say what to look for in it. Finally, ask it to report what it verified and what it could not, and review that list yourself. When you resume a long task in a new conversation, paste a short summary of the decisions so far, so the model does not repeat or contradict earlier work.
Give an AI agent a clear goal, boundaries and a checkable definition of done.
Define which tools an agent may use, what it may never do and when it must ask first.
Make the AI check its own work against your requirements before it hands anything back.
Ask an agent for a step-by-step plan with review points before it starts working.
Get a structured research brief that separates findings from assumptions and names its sources.
Extract key points, obligations and risks from a document, with quotes so you can check each one.
Get a prioritized code review that covers correctness, security, readability and tests.
Diagnose an error by giving the AI the message, the code, what you tried and what you expected.
Move the document to the top, inside its own tagged section, and put the task after it. Refer to the section by name in the task, so it is clear which text the instruction applies to. Check the result against the document, since a long answer can still miss a detail.
Use separate sections for instructions, context and source text so the model cannot confuse your document with your request. This also protects you when the document itself contains instructions.
State the format, length and structure. If another tool or person will read the answer, include a short example of the exact shape and say to follow it.
Add a definition of done and a rule such as "stop and ask me before any irreversible action". Ask for a plan before work starts, and read it before you say go.
Ask the model to verify its answer against your requirements, and read the list of what it could not verify before you rely on the result. Check facts, numbers and quotes yourself.
No. They are one clear way to separate parts of a prompt, and Claude tends to handle them well. Clear headings or labels can work too. What matters is that the boundaries between instructions, context and material are obvious.
Usually near the top, in its own section, with the question or instruction after it. Name the section and refer to it in the task so there is no doubt which text the instruction applies to. This order tends to work better than a short instruction followed by pages of text.
Keep the fixed parts of your prompt identical, move permanent rules into a system prompt or reusable template, and vary only the task details. A clear output format also reduces variation. For important workflows, test the prompt on several real examples, not just one.
Many products let Claude take multi-step actions with tools, but availability depends on the product and your plan. Check the provider's documentation. The same habits apply: a clear goal, boundaries, approval points and a definition of done.
Say what to do instead: ask you, state the assumption or leave the item out. A line such as "If something essential is missing, ask me before continuing" is often enough.
They are written to work across assistants and tend to suit Claude's preference for structured sections. They are drafts, so test one on a real task and adjust the wording to your needs. If a template is too long for your task, delete the sections you do not need.
What an AI agent is, how to structure a task for one, and how to avoid the failures that waste time. Includes examples and copyable prompts.
A five-part formula for prompts that work in any AI assistant, with a weak and a strong example for each part and a reusable skeleton.
What a system prompt is, the seven sections to include, a complete worked example and a simple way to test and improve it with a few test cases.
A versatile assistant that rewards clear roles, steps and follow-ups.
Text, files and images together, plus work that lives in Google's apps.
Current information, a conversational tone and claims worth checking.
Product features change often — check the provider's documentation for the latest.