Knowing how to write good prompts has gone from being a nice-to-have to a basic requirement for any professional using AI daily. With ChatGPT running GPT-5 and Claude operating on Opus 4.7, these models' capabilities have grown enormously — but output quality still depends directly on the quality of input you provide. A poorly structured prompt wastes the model's potential, while a well-crafted prompt transforms a generic AI into a surgical tool for your specific problem.

I've been working with prompt engineering for over two years, and what surprised me most during this period was how the techniques have evolved. In 2023, most guides taught superficial tricks — "speak as if you were an expert" or "ask for step-by-step." In 2026, prompt engineering is a real technical discipline, with documented patterns, measurable benchmarks, and significant differences between models. I use ChatGPT and Claude daily for tasks ranging from code generation to long document analysis, and I've learned through practice that each model responds better to different structures. What works perfectly on Claude can produce mediocre results on ChatGPT, and vice versa.

What changed in prompt engineering in 2026

Prompt engineering in 2026 is fundamentally different from what we practiced two years ago. The most important change is that the emphasis shifted from long prompts to structured prompts. The ideal size for most tasks is between 150 and 300 words — not because longer prompts are bad, but because structure and clarity matter more than text volume.

Another fundamental change is the emergence of extended reasoning models. GPT-5 with thinking mode and Claude Opus with extended thinking perform chain-of-thought reasoning internally. This means the classic chain-of-thought technique — explicitly asking to "think step by step" — has become redundant for these advanced models. They already do this on their own, and forcing explicit reasoning can actually degrade response quality.

The third major shift is the agentic paradigm. Modern prompts aren't written just to obtain text — they're written to activate autonomous work cycles where the model uses tools, searches for information, and executes actions independently. Claude Code and custom GPTs are direct examples of this evolution.

Basic structure of an efficient prompt

Every efficient prompt in 2026 follows a structure that works like a contract between you and the model. According to Anthropic's official documentation, the essential elements are:

  • Role: who the model should be in this interaction. Don't use generic roles like "expert" — be specific: "senior software engineer with experience in microservices architecture."
  • Success criteria: what defines a good response. Instead of "help me with this code," say "refactor this function to reduce cyclomatic complexity from 12 to under 5, keeping all existing tests passing."
  • Constraints: explicit limits. "Use only Python standard libraries," "Respond in 200 words maximum," "Don't suggest solutions that require database migration."
  • Output format: how the response should be structured. JSON, Markdown, numbered list, table — specify exactly.
  • Uncertainty handling: give explicit permission for the model to say "I don't know" instead of making things up. This reduces hallucinations dramatically.

Practical example: bad prompt vs. good prompt

Bad prompt: "Explain Docker to me"

Good prompt: "I'm a Python backend developer who has never used containers. Explain Docker focusing on: (1) why I should use it instead of virtualenv for environment isolation, (2) the 5 commands I'll use 90% of the time, (3) a minimal Dockerfile for a FastAPI API. Use practical examples, not abstract theory. If any concept requires prior networking knowledge, explain it briefly."

The difference isn't just in length — it's in specificity. The second prompt gives the model context about who you are, what you need, how you want to receive information, and where your knowledge gaps are.

Differences between prompts for ChatGPT and Claude

Each model has different architecture and training, which means they respond differently to different prompt structures. Understanding these differences is what separates a casual user from someone who truly extracts the maximum from each tool.

Claude: XML tags are the gold standard

Claude was trained to recognize and respect XML tags as structural delimiters. According to Anthropic's best practices documentation, using XML tags is genuinely the best structuring method for Claude — not Markdown, not numbered lists.

TechniqueClaudeChatGPT
Preferred structureXML tags (<instructions>, <context>)Markdown sections (##, ###)
Few-shot examples3-5 examples in <example> tags3-5 examples in code blocks
Chain-of-thoughtActivated via extended thinking (automatic)Activated via thinking mode (automatic)
Long contextUp to 1M tokens — place documents firstUp to 256K tokens — be more selective
Structured outputResponds well to JSON schema in XMLNative structured outputs via API

In practice, when I work with Claude, my prompts follow this pattern:

<role>Senior data engineer</role> <context>I'm migrating pipelines from Airflow to Dagster...</context> <task>Rewrite this DAG as a Dagster job...</task> <constraints>Use only dagster core, no extra plugins</constraints>

ChatGPT: Markdown and direct instructions

ChatGPT responds better to prompts structured with Markdown. Sections with headers (##), bulleted lists, and code blocks delimited by triple backticks are processed more efficiently by GPT-5.

Another practical difference: ChatGPT tends to be more verbose by default. If you want concise answers, you need to be explicit: "Respond directly, without introductions or closing summaries. Maximum 150 words." With Claude, conciseness tends to be more natural when the prompt is well-structured.

Advanced techniques that work in 2026

Beyond basic structure, there are advanced techniques that significantly elevate response quality. These are the ones I use most frequently and that have measurable impact on results.

1. Few-shot prompting with diverse examples

Providing 3 to 5 input/output examples remains one of the highest-return techniques in prompt engineering. The secret is that examples must be diverse — cover normal cases, edge cases, and ambiguous situations. If all your examples follow the same pattern, the model will generalize superficially.

2. Prompt chaining for complex tasks

Instead of trying to solve everything in a single giant prompt, break the task into sequential steps. First ask the model to analyze, then to plan, then to execute. Each step receives the previous output as context. This works especially well for tasks like code refactoring, where the model needs to first understand the existing codebase before proposing changes.

3. Citation before analysis

When working with long documents, ask the model to first quote the relevant excerpts from the document and only then perform the analysis. According to Anthropic's documentation, this significantly improves accuracy because it forces the model to anchor its conclusions in concrete textual evidence, reducing hallucinations.

4. Output contracts with JSON schema

For programmatic integrations, define the exact JSON schema you expect. This is particularly important when the model's output feeds into another system. Both ChatGPT and Claude support structured outputs via API, but even in conversational use, providing a schema in the prompt improves consistency.

5. Prompt caching for efficiency

If you use Claude's API, take advantage of prompt caching. With this feature, large system prompts cost approximately 10 times less per call after the first execution. This is particularly useful when you have an elaborate system prompt that doesn't change between calls — for example, a prompt with your project's code style rules.

Common mistakes that degrade quality

After hundreds of hours testing prompts, these are the most frequent mistakes I see — and that I made many times before understanding why:

  • Asking to "be creative": this is an anti-pattern. Creativity without constraints generates unpredictable results. Instead, define the creative space: "Suggest 3 alternative approaches to fix this bug, prioritizing readability over performance."
  • Excessive negations: positive instructions work better than prohibitions. Instead of "don't use technical jargon, don't make long paragraphs, don't include disclaimers," say "write in language accessible to non-technical readers, with 2-3 sentence paragraphs, getting straight to the point."
  • Insufficient context about yourself: the model doesn't know your experience level. A prompt about "how to deploy" will generate completely different responses depending on whether you're a senior DevOps engineer or a student who just created their first project.
  • Ignoring the system prompt: if you use the API, the system prompt is where persistent instructions should live — role, format rules, constraints. The user prompt should contain only each interaction's specific task.
  • Not iterating: prompt engineering is an iterative process. If the first response wasn't good, don't rewrite the prompt from scratch — analyze what went wrong and adjust specifically that aspect.

Ready-to-use templates

Here are templates I use daily that work consistently on both ChatGPT and Claude:

Template for code review

"Analyze the following [language] code. Identify: (1) potential bugs with severity level, (2) performance issues with estimated impact, (3) language convention violations. For each problem found, suggest the fix with the exact diff. If the code is good in some aspect, say so explicitly — don't invent problems."

Template for technical writing

"Write a [document type] about [topic] for an audience of [profile]. The tone should be [formal/conversational/technical]. Include practical examples from [context]. Structure with an introduction presenting the problem, 3-5 sections with h2 headers, and a conclusion with actionable next steps. Length: [X] words."

Template for debugging

"I'm getting [error] when [action]. Stack trace: [paste]. Environment: [language, version, OS]. Already tried: [list attempts]. What I expect to happen: [desired behavior]. Diagnose the root cause and propose the simplest fix that solves the problem without side effects."

Conclusão

Prompt engineering em 2026 não é sobre truques ou hacks — é sobre comunicação clara e estruturada com sistemas que entendem nuances quando você as fornece. A regra mais importante é esta: trate o prompt como uma especificação técnica, não como uma conversa casual. Defina o papel, os critérios de sucesso, as restrições e o formato de saída. Use a estrutura que cada modelo prefere — XML para Claude, Markdown para ChatGPT. Forneça exemplos diversos, dê permissão para incerteza e itere sobre os resultados. Essas práticas não são teoria — são padrões testados em produção que consistentemente geram outputs melhores, mais confiáveis e mais úteis. A diferença entre um prompt mediano e um prompt excelente pode ser a diferença entre uma resposta genérica de IA e uma solução que resolve seu problema específico em minutos.