Cooldecode · AI Watch · Prompt engineering in practice
Prompt engineering in 2026: what actually changed with models like Opus 5
Today's rotation points to prompt engineering — and there's no Anthropic/Claude news relevant enough today to jump the queue. The interesting part is that a lot of what was "best practice" two or three years ago is now outdated: reasoning models changed the game, and Anthropic itself recently revised its official guide.
01Why prompt engineering still matters
With increasingly capable models, it's tempting to think "just ask and the model gets it". In practice, the difference between a vague instruction and a well-built prompt is still the difference between needing several back-and-forths to land on the right result, or nailing it the first time. Anthropic's official 2026 guide sums it up well: prompt engineering is the foundation for something broader, called context engineering — managing everything the model "sees" before responding, not just the last question.
02Techniques that still work well
Be explicit: say exactly what you want, without expecting the model to infer it. "Build a dashboard" performs worse than "build a dashboard with as many relevant features as possible, going beyond the basics".
Give context and motivation: explaining why something matters helps the model make better decisions in ambiguous cases. Instead of "never use bullet points", it works better to say "I prefer flowing text because I find it easier to read and more conversational".
Be specific: include clear constraints (length, format, deadline), the target audience, and the desired output structure.
Use examples (few-shot): show instead of just describing, especially when the format or tone is hard to explain in words. The recommendation is to start with a single example and add more only if needed.
Give the model permission to say "I don't know": explicitly ask it to admit uncertainty instead of risking an answer — this reduces hallucination in a simple, direct way.
03Advanced techniques, for complex tasks
Prefill (pre-filling the start of the response)
Via API, you can "start" the model's response yourself — for example, opening with a { to force pure JSON output, with no preamble. In chat interfaces, a similar effect can be achieved by being very explicit: "respond with valid JSON only, start with an opening brace".
Chain of thought (step-by-step reasoning)
Asking the model to "think step by step" before the final answer helps with complex analytical tasks. With models that already have native extended thinking (like the Claude 4.x/5.x family), this manual technique becomes less necessary — but it's still worth it when the explicit reasoning needs to be reviewed by a person.
Prompt chaining
Breaking a complex task into several sequential prompts, where one's output feeds the next (summarize → review → improve based on feedback). Increases latency, but significantly improves reliability on multi-step tasks.
04What's fallen out of favor
Anthropic's own guide is direct about this: some techniques that were popular a few years ago have lost relevance with current models.
XML tags as structure
Previously recommended to separate sections of a long prompt. Current models understand structure well with just clear headings and spacing — XML still helps in extreme cases of very mixed content, but it's no longer a general rule.
Heavy role prompting
Defining an elaborate persona ("you are a renowned expert who never makes mistakes...") tends to add noise. Being direct about the desired perspective ("analyze focusing on risk and long-term growth") usually works better than assigning a role.
05Example: before and after
A simple data-extraction task shows the effect of combining the right techniques well.
BEFORE (vague):
"Pull the financial data out of this report."
AFTER (specific, with format and permission for uncertainty):
"Extract the financial metrics from this quarterly report and
present them as JSON. The response must contain ONLY valid JSON,
with no preamble. Use this structure:
{
"revenue": "value with unit",
"profit_margin": "percentage",
"growth_rate": "percentage"
}
If any value isn't clear in the report, use null instead of
risking a number. Start the response with the opening brace: {"
The "after" version combines five things at once: an explicit instruction, context about the reason for the format, an example structure, permission to express uncertainty, and format control via prefill. No single technique on its own would solve everything — the combination is what makes the difference.
06Common mistakes to avoid
Over-engineering the prompt: a longer, more complex prompt isn't synonymous with a better result.
Ignoring the basics: advanced techniques don't make up for a core instruction that's already vague or ambiguous.
Using every technique at once: pick the right combination for the specific problem, don't stack everything out of caution.
Not iterating: the first prompt is rarely the ideal one — testing and refining is part of the process.
To remember
Prompt engineering didn't disappear with smarter models — it became the foundation for something bigger, context engineering. The core techniques (be explicit, give context, be specific, use examples, allow uncertainty) still hold for everyday use; the advanced ones (prefill, chain of thought, chaining) come in when the task demands a strict format or several reasoning steps. And it's worth being skeptical of old advice about XML tags or elaborate personas — a lot has changed since those practices became popular.
Share:
Newsletter
Learn what AI is creating for you. Don't get lost.
Get notified when a new deep dive or lesson goes up. No spam, just new posts.
Cooldecode · IA Watch · Prompt engineering na prática
Prompt engineering em 2026: o que realmente mudou com modelos como o Opus 5
A rotação de hoje aponta para prompt engineering — e não há nenhuma notícia de Anthropic/Claude relevante o suficiente hoje para furar a fila. O ponto interessante é que boa parte do que era "melhor prática" há dois ou três anos ficou obsoleto: modelos de raciocínio mudaram o jogo, e a própria Anthropic revisou seu guia oficial recentemente.
01Por que prompt engineering ainda importa
Com modelos cada vez mais capazes, é tentador achar que "basta pedir e o modelo entende". Na prática, a diferença entre uma instrução vaga e um prompt bem construído continua sendo a diferença entre precisar de várias idas e voltas para chegar no resultado certo, ou acertar de primeira. O guia oficial da Anthropic para 2026 resume bem: prompt engineering é a base sobre a qual se constrói algo mais amplo, chamado context engineering — gerenciar tudo que o modelo "vê" antes de responder, não só a última pergunta.
02As técnicas que ainda funcionam bem
Ser explícito: dizer exatamente o que se quer, sem esperar que o modelo infira. "Crie um dashboard" funciona pior que "crie um dashboard com o máximo de funcionalidades relevantes, indo além do básico".
Dar contexto e motivação: explicar por que algo importa ajuda o modelo a tomar decisões melhores em casos ambíguos. Em vez de "nunca use bullet points", funciona melhor "prefiro texto corrido porque acho mais fácil de ler e mais conversacional".
Ser específico: incluir restrições claras (tamanho, formato, prazo), o público-alvo e a estrutura de saída desejada.
Usar exemplos (few-shot): mostrar em vez de só descrever, especialmente quando o formato ou o tom é difícil de explicar em palavras. A recomendação é começar com um exemplo só e adicionar mais apenas se necessário.
Dar permissão para o modelo dizer "não sei": pedir explicitamente que ele admita incerteza em vez de arriscar uma resposta — isso reduz alucinação de forma simples e direta.
03Técnicas avançadas, para tarefas complexas
Prefill (preencher o início da resposta)
Via API, é possível já "começar" a resposta do modelo — por exemplo, abrir com uma chave { para forçar uma saída em JSON puro, sem preâmbulo. Em interfaces de chat, o efeito parecido se consegue sendo bem explícito: "responda só com JSON válido, comece com uma chave de abertura".
Chain of thought (raciocínio em etapas)
Pedir "pense passo a passo" antes da resposta final ajuda em tarefas analíticas complexas. Com modelos que já têm extended thinking nativo (como os da família Claude 4.x/5.x), essa técnica manual passa a ser menos necessária — mas ainda vale quando o raciocínio explícito precisa ser revisado por uma pessoa.
Encadeamento de prompts (prompt chaining)
Quebrar uma tarefa complexa em vários prompts sequenciais, onde a saída de um alimenta o próximo (resumir → revisar → melhorar com base no feedback). Aumenta a latência, mas melhora bastante a confiabilidade em tarefas de múltiplas etapas.
04O que caiu em desuso
O próprio guia da Anthropic é direto sobre isso: algumas técnicas populares há alguns anos perderam relevância com os modelos atuais.
Tags XML como estrutura
Antes recomendadas para separar seções de um prompt longo. Modelos atuais entendem estrutura bem só com títulos claros e espaçamento — XML ainda ajuda em casos extremos de conteúdo muito misto, mas deixou de ser regra geral.
Role prompting pesado
Definir uma persona elaborada ("você é um especialista renomado que nunca erra...") tende a adicionar ruído. Ser direto sobre a perspectiva desejada ("analise focando em risco e crescimento de longo prazo") costuma funcionar melhor que atribuir um papel.
05Exemplo: antes e depois
Uma tarefa simples de extração de dados mostra bem o efeito de combinar as técnicas certas.
ANTES (vago):
"Tira os dados financeiros desse relatório."
DEPOIS (específico, com formato e permissão de incerteza):
"Extraia as métricas financeiras deste relatório trimestral e
apresente em JSON. A resposta deve conter APENAS JSON válido,
sem preâmbulo. Use esta estrutura:
{
"receita": "valor com unidade",
"margem_lucro": "percentual",
"taxa_crescimento": "percentual"
}
Se algum valor não estiver claro no relatório, use null em vez
de arriscar um número. Comece a resposta com a chave de abertura: {"
A versão "depois" combina cinco coisas ao mesmo tempo: instrução explícita, contexto sobre o motivo do formato, estrutura de exemplo, permissão para expressar incerteza e controle de formato via prefill. Nenhuma técnica isolada resolveria tudo — a combinação é que faz a diferença.
06Erros comuns a evitar
Superengenhar o prompt: prompt mais longo e complexo não é sinônimo de melhor resultado.
Ignorar o básico: técnicas avançadas não compensam uma instrução central que já é vaga ou ambígua.
Usar toda técnica de uma vez: escolher a combinação certa para o problema específico, não empilhar tudo por precaução.
Não iterar: o primeiro prompt raramente é o ideal — testar e refinar é parte do processo.
Para fixar
Prompt engineering não desapareceu com modelos mais inteligentes — ele virou a base de algo maior, o context engineering. As técnicas centrais (ser explícito, dar contexto, ser específico, usar exemplos, permitir incerteza) continuam valendo para o dia a dia; as avançadas (prefill, chain of thought, encadeamento) entram quando a tarefa exige formato rígido ou várias etapas de raciocínio. E vale desconfiar de dicas antigas sobre tags XML ou personas elaboradas — muita coisa mudou desde que essas práticas ficaram populares.
Compartilhar:
Newsletter
Saiba o que a IA está criando pra você. Não fique por fora.
Seja avisado quando eu postar uma imersão ou lição nova. Sem spam, só posts novos.