The Constraint Goes First
Everyone writes prompts top-down: role, context, task, then a stack of rules at the end. That's the bug.
Reviewed by Agnel Nieves

I'll save you the forty minutes I wasted on this.
For about a year I wrote prompts the way every guide tells you to. Role at the top, context next, task in the middle, format and constraints at the bottom. It read clean. It also produced drafts I had to rewrite. Then I flipped the order, and the same model on the same input started giving me work I could ship. Same words, different position, different output.
The thesis is simple. Constraints belong at the top of the prompt, not the bottom. The model is paying the most attention to what it reads first. If the first thing it reads is "you are a senior content strategist," it spends a paragraph being a senior content strategist before it considers that you needed a 90-word answer in plain English with no bullet points. By the time it gets to your rules, it has already committed to a shape. Then it negotiates with itself for the rest of the response, and you can feel the negotiation in the draft.
This is not a personality quirk of Claude. There is now a small pile of research, including Anthropic's own guidance, pointing the same direction: telling the model what NOT to do, and putting the hardest constraints up front, does more work than any other single change you can make to a prompt. I have tested this on roughly two hundred client briefs over the last six months. The ordering change alone cut my rewrite time by something like a third. I did not measure it cleanly. I am not going to pretend I did.
What the bad version looks like
Here is a sanitized version of the prompt I used to send. I was writing a homepage hero brief for a Series A company in the supply-chain space. The client wanted something specific. They got something generic.
You are a senior B2B content strategist who specializes in
writing for technical founders. You have ten years of experience
and a sharp eye for the difference between marketing copy and
operator copy.
We are working with a company called Tessera. They make
middleware for warehouse robotics. Their customers are operations
directors at mid-market 3PLs. The current homepage is dense and
buries the value prop. The founder wants something that reads
like a peer wrote it, not an agency.
Please write three options for the homepage hero. The hero
includes a headline, a one-sentence subhead, and a primary CTA.
Make them distinct from each other. Avoid generic SaaS language.
Do not use the words "unlock," "seamless," or "transform." Keep
the headline under 70 characters. Match the voice of an operator,
not a marketer.
What I got back was three headlines that all sounded like Stripe's third-most-confident competitor. Two of them used the word "seamless." One of them said "transform." Both were on the banned list, in the same prompt, three paragraphs above the output.
The model was not being stupid. It was responding to the prompt I actually wrote, which spent its opening describing a persona that writes that kind of copy for a living. The constraints arrived after the model had already chosen a register.
What the working version looks like
Here is the same prompt restructured. Same facts. Different order.
Constraints, in priority order: 1. Do not use the words "unlock," "seamless," "transform," "leverage," or "robust." If you reach for one of these, pick a more specific verb instead. 2. The headline is under 70 characters. The subhead is one sentence under 25 words. 3. The voice is an operations director talking to another operations director. Not a marketer. Not a founder pitching at a conference. A peer. 4. Three options. They must be meaningfully different in angle, not three rewrites of the same sentence. Task: write the homepage hero (headline, one-sentence subhead, primary CTA) for Tessera, a middleware company for warehouse robotics. The customer is an operations director at a mid-market 3PL. The current homepage is dense and buries the value prop. The founder wants peer-to-peer, not agency. You are writing as someone who has spent a decade inside a warehouse, not someone who has spent a decade writing about warehouses.
Three headlines came back. None of them used a banned word. Two were genuinely different in angle (one led on speed of integration, one led on the cost of a bad pick). The third was weaker, which is honest. The client picked one with a one-word edit. I sent the invoice the same afternoon.
The change is not magic. The model treats the top of your prompt as the part it has to honor; the bottom is the part it negotiates with. If the part you cannot afford to lose is at the bottom, you are betting that the model will negotiate in your favor. Sometimes it will. On a tight brief, you do not want to bet.
Why the order works
Two things are happening, and they are worth understanding so you can adapt the pattern instead of memorizing it.
The first is that constraints are easier for the model to satisfy when they are still in working memory. A banned-word list at the top of the prompt is something the model can check itself against, sentence by sentence, as it drafts. The same list at the bottom is something the model encounters after it has already written a draft in its head. It can self-correct, but self-correction is slower and less reliable than writing inside the lines from the start. You can feel the difference if you watch streaming output. Constraint-first prompts start clean. Constraint-last prompts hesitate.
The second is that role and context, despite what most guides will tell you, are not constraints. They are setting. They tell the model the world the answer lives in. If you put them first, you are telling the model to optimize for fidelity to a persona, and persona is a soft target. The model will hit it, but it will hit it loosely, and any specific rules you bolt on afterward get filtered through that persona's defaults. The persona for "senior content strategist" includes the words "unlock" and "seamless," whether you like it or not. You have to outrank the persona, not append to it.
The way to outrank a persona is to put the rules above it. That is the whole trick.
The structure I use now
I have a single template I run for every client deliverable. It has three sections and a fixed order. I do not deviate from the order. I deviate from the content all the time.
## Constraints - [hard rule 1, the one I would walk back the most] - [hard rule 2] - [hard rule 3] - [banned words or phrases, if relevant] - [length and format, exact] - [what NOT to do, two or three items] ## Task [Two or three sentences. The deliverable, the audience, the shape of the output. No backstory.] ## Context and voice [The setting. Who the company is, who the reader is, what tone the founder is asking for, what the current copy gets wrong. This is the longest section. It is also the section the model treats as background, which is correct.]
The thing I want you to notice is that the "context and voice" section, which most prompt guides put at the top, is at the bottom in my version. That is not because context does not matter. It matters a lot. It is because context is a thing the model can use loosely without breaking the deliverable. Constraints are not. If the headline is 84 characters, the client cannot use the headline. If the voice is slightly off, the client can usually live with it or send a one-line note.
You are ordering by what is non-negotiable, top to bottom. Put the things you will not edit at the top. Put the things you might edit at the bottom.
A note on what this is not. This is not "the model cannot follow instructions at the end of a prompt." It can. Opus 4.7 is genuinely good at honoring long instruction sets in any order, and on a generous brief you will not see the difference. You will see the difference on tight briefs, on first drafts, on anything where you do not have time for a second pass. Which, if you are a working operator, is most things.
What to do on Monday
Pick one prompt you run regularly. Could be a meeting summary prompt, a draft-the-LinkedIn-post prompt, an audit prompt, whatever. Find the one where you most often have to do a second pass to fix the same kind of mistake. That repeated mistake is your constraint. It is the thing the model keeps forgetting because you keep putting it at the bottom of the prompt.
Move it to the top. Make it the first thing the model reads. Run the prompt again with the same input you used last week and compare the two outputs side by side. If you do not see a difference, your prompt is already in good shape and you should be writing this article instead of reading it. If you do see a difference, congratulations, you just got a meaningful upgrade for the price of a copy-paste.
The order is the cheapest optimization in prompting. It costs nothing. It ships today. You do not need a new model, a new tool, or a new framework. You need to move three lines up.
Read next

AEO & Visibility · 6 min read
Optimizing Your Site for AI Agents and LLMs
Your site has human visitors and AI visitors. Here is how to serve both, with llms.txt, inline LLM instructions, structured data, and machine-readable feeds.