Ihtesham Ali Profile picture
investor, writer, educator, and a dragon ball fan 🐉

Mar 18, 13 tweets

The only guide to prompt engineering you'll ever need.

I went through every resource Anthropic and OpenAI have published publicly.

Here are 10 techniques that actually work in 2026:

1/ Role + Context stacking

Forget "act as an expert." That's beginner stuff.

The real move: give the model a role AND the situation it's operating in.

Instead of "you're a marketing expert" try:

"You're a direct response copywriter who's written 200+ landing pages for SaaS companies. I'm launching a B2B tool. My buyer is a VP of Engineering who hates being sold to."

The more specific the operating context, the sharper the output.

Generic personas = 60% quality.
Specific role + situation = 94% quality.

Anthropic calls this "grounding the model in your world." OpenAI calls it "system prompt clarity."

Same principle. Works every time.

2/ Chain of thought forcing

Most people ask for the answer. Smart people ask for the reasoning first.

Here's the technique: add "Think through this step by step before giving your final answer" to any complex prompt.

Sounds obvious. Almost nobody does it.

I tested this on the same Claude prompt — with and without it.

Without: a decent answer in 3 sentences.
With: a 10-step breakdown that caught 2 edge cases I hadn't considered.

The model isn't smarter. You just unlocked a reasoning layer it wasn't using.

OpenAI's internal docs call this "deliberate thinking mode." The difference on hard problems is not subtle.

3/ Constraint injection

LLMs want to please you. Which means they'll pad, hedge, and over-explain.

Constraints fix this.

"Explain this in 3 bullet points. Each bullet must be one sentence. No preamble."

"Give me 5 options. No overlap between them. Each must work for a complete beginner."

The wild part: constraints don't just shorten output. They improve quality.

Forcing the model to work within limits makes it prioritize, not ramble.

Anthropic's prompting guide calls this "output shaping." It's the fastest way to go from okay to actually usable.

4/ Few-shot examples

This is the technique everyone skips because it takes 2 extra minutes.

It's also the one that closes the gap between "pretty good" and "exactly right."

Before your request, show the model 2-3 examples of what you want.

"Here's a tweet that performed well: [example]
Here's another: [example]
Now write 5 in the same style for this topic."

You're not explaining what you want. You're showing it.

OpenAI found this works better than any instruction you can write. The model reverse-engineers your taste from the examples.

Use it for writing, formatting, tone, structure anything where style matters.

5/ Negative prompting

Most people tell AI what to do.

Almost nobody tells it what NOT to do.

"Write a LinkedIn post about this. No corporate jargon. No bullet points. Don't start with 'I.' Don't use the word 'excited.'"

The output shifts immediately.

Anthropic's docs have a whole section on this they call it "exclusion constraints." The idea is that models trained on massive datasets pick up bad habits from average content.

Negative prompts break those defaults.

Takes 10 seconds to add. Changes the entire feel of the output.

6/ Persona + Stakes

This one feels weird. It works anyway.

Assign the model a specific persona AND tell it something is on the line.

"You're a senior engineer at Google who just found a critical bug in production. The site goes down in 30 minutes. Review this code and tell me exactly what's wrong."

The "stakes" frame forces urgency and precision.

I've tested this dozens of times. Adding stakes to a persona prompt consistently produces more thorough, more direct responses.

Anthropic researchers call it "consequence framing." The model pattern-matches to high-stakes scenarios it's seen in training and outputs accordingly.

7/ Iterative refinement loop

Single prompt → single output is a beginner workflow.

The real technique: treat the first output as a draft, then refine in the same conversation with targeted feedback.

Round 1: get the output.
Round 2: "The tone is right but it's too long. Cut it by 40% without losing the core argument."
Round 3: "The opening is weak. Rewrite just the first paragraph to hook faster."

Each round costs you 10 seconds. The quality compounds.

OpenAI's internal guides call this "conversational iteration." The model has full context of what you're building.

Use it like a back-and-forth with an editor, not a vending machine.

8/ Task decomposition

Complex prompts produce messy outputs.

Break the task into stages.

Instead of: "Write a full marketing strategy for my product."

Do this:
Step 1 → "Identify the 3 biggest pain points for [audience]."
Step 2 → "Now write a positioning statement based on those pain points."
Step 3 → "Now write 5 headlines that address each pain point directly."

Same information. Completely different quality.

Anthropic calls this "sequential prompting." The model stays focused on one thing at a time instead of trying to juggle everything at once.

Works especially well for anything that has a logical order: code, strategy, writing, research.

9/ Self-critique prompting

After you get an output, ask the model to attack it.

"What are the 3 weakest parts of what you just wrote?"
"What would a skeptic say is wrong with this argument?"
"What am I missing that would make this fail in production?"

The model will find real problems.

This works because models are better at evaluating than generating on the first pass. You're using that asymmetry on purpose.

Anthropic's research team uses this internally for stress-testing agent outputs. OpenAI calls it "adversarial self-review."

It's the closest thing to a free editor that actually has opinions.

10/ Context front-loading

Most people bury the context at the end.

"Write me a cold email. By the way, my product does X, my audience is Y, and the goal is Z."

Flip it.

Lead with full context before the request:

"My product is [X]. My audience is [Y]. Their biggest objection is [Z]. They respond best to [tone/style]. NOW: write me a cold email."

Anthropic's prompting docs are explicit about this models pay more attention to information that comes first. The request should land after the model already has everything it needs.

Front-load context. End with the task. The difference in output quality is immediately obvious.

None of this is magic.

It's just understanding how these models actually process information and working with that instead of against it.

Most people treat prompting like a search bar.

The ones getting 10x results treat it like briefing a very capable, very literal collaborator.

Learn the model. Then give it what it needs.

That's the whole game in 2026.

If this helped, follow me @ihtesham2005 for more AI breakdowns that actually make sense.

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling