Claude Code Cut 80% of Its Prompt. Yours Should Too.

Iniciado por joomlamz, Hoje at 06:25

Respostas: 1   |   Visualizações: 2

Tópico anterior - Tópico seguinte

0 Membros e 1 Visitante estão a ver este tópico.

Saudações, malta do **webmastersmz.com**! É um prazer estar aqui para partilhar conhecimento técnico com esta comunidade que faz a web moçambicana acontecer.

Hoje trago uma análise sobre um movimento recente da Anthropic com o seu novo **Claude Code**. O tópico "[Claude Code Cut 80% of Its Prompt. Yours Should Too.]" foca-se numa técnica essencial que todos nós, que integramos IA nos nossos sistemas, devemos dominar: a **Otimização de Contexto e Prompt Caching**.

Aqui estão os pontos principais desta "jogada de mestre" e como isso impacta os nossos projetos:

### 1. O Trunfo do Prompt Caching
O Claude Code conseguiu reduzir o tamanho dos prompts enviados em 80% não por "cortar" informação necessária, mas por usar **Prompt Caching**. Em vez de enviar toda a documentação e o código do projeto em cada interação (o que gasta milhares de tokens desnecessários), eles "congelam" a parte estática do contexto no servidor da API.

### 2. Redução Drástica de Custos e Latência
Para nós em Moçambique, onde cada dólar conta no orçamento de infraestrutura, esta técnica é vital.
*   **Menos Tokens:** Se pagas por token, reduzir 80% do envio significa uma poupança direta no bolso.
*   **Velocidade:** Ao não ter de processar o prompt inteiro do zero em cada *request*, a resposta da IA volta muito mais depressa. Para quem desenvolve apps interativas, isso melhora a UX significativamente.

### 3. "Context Window" não é um depósito de lixo
O erro de muitos developers é atirar ficheiros inteiros para o contexto da IA. O Claude Code mostrou que a eficiência vem de saber **o que** enviar e **como** reaproveitar o que já foi enviado. Se o teu sistema envia os mesmos "System Prompts" ou manuais longos repetidamente, estás a queimar recursos.

---

**Vamos ao debate:**
Malta, como é que vocês estão a gerir o consumo de tokens nos vossos projetos com LLMs (OpenAI, Claude, Gemini)? Já estão a implementar estratégias de *caching* ou ainda estão a enviar tudo "a bruto" em cada pedido? Partilhem aí as vossas experiências e as dificuldades que encontram na integração de APIs de IA aqui na nossa realidade.

Para garantir que os vossos projetos e fóruns rodam sem falhas, convido-vos a conhecer as soluções de alojamento de alta performance da AplicHost em [https://aplichost.com](https://aplichost.com).

Estamos juntos! Vamos elevar o nível do desenvolvimento em Moçambique.

Claude Code Cut 80% of Its Prompt. Yours Should Too.



Tópico: Claude Code Cut 80% of Its Prompt. Yours Should Too.
Categoria: Tutoriais | Programação & Tecnologia
Idioma Principal: Português (Conteúdo de Tecnologia)

Descrição do Conteúdo / Informações:
-------------------------------------------------------------------------


Claude Code Cut 80% of Its Prompt. Yours Should Too.


Anthropic engineer Thariq Shihipar dropped a quiet bombshell at the AI Engineer World's Fair this month: the team removed over 80% of Claude Code's system prompt for Opus 5 and Fable 5 — and saw no measurable loss on coding evaluations. The system prompt shrank from roughly 2,686 words down to around 514 with memory disabled. The announcement and its retweet by Boris Cherny racked up 4.3 million views in a week, making it the most-discussed Claude Code development since the CLI launch.

Read the full version with charts and embedded sources on AgentConn

View original post on X

The headline is dramatic. The substance underneath is more interesting — and more actionable — than the number suggests. Anthropic published their reasoning as "The New Rules of Context Engineering for Claude 5 Generation Models", and it reads like a confession: the instructions they wrote to make Claude Code reliable were, in many cases, making it worse.

If you maintain an agent harness — any agent harness, not just one built on Claude — this is the most important piece of prompt engineering documentation published this year. Not because Anthropic's system prompt matters to you directly, but because the failure patterns they describe are almost certainly present in yours.



What They Actually Removed


The old Claude Code system prompt was built for a different era. Earlier models needed explicit guardrails: "never write multi-paragraph docstrings," "default to writing no comments," detailed step-by-step verification procedures loaded upfront. These constraints existed because Sonnet 3.5 would sometimes delete files unprompted or insert unprofessional comments into production code. The rules worked — until they didn't.

What Anthropic found when they audited transcripts of their own internal usage was that Claude was receiving contradictory instructions within a single request. One source said to leave documentation as appropriate. Another said not to add comments at all. The system prompt, the CLAUDE.md file, and the skill definitions had evolved independently, and the intersections had become minefields of conflicting guidance.

View original post on X

As Alex Prompter put it: "The instructions you added to make Claude more reliable are the reason it's less reliable."

The fix was not better instructions. It was fewer instructions.



The Six Rules That Flipped


Anthropic's blog post frames the shift as six principle reversals. Each one maps directly to a design decision in your own harness.



1. Rules to Judgment


Before: "Never write multi-paragraph docstrings."

After: "Write code that reads like the surrounding code: match its comment density, naming, and idiom."

The old approach encoded worst-case prevention. The new approach trusts the model to read the room — literally, to infer coding style from the codebase context. This works because frontier models can pattern-match on code style better than any rule set can describe it.



2. Examples to Interfaces


Before: Detailed tool-usage examples showing the model exactly how to call each API.

After: Well-designed tool schemas with expressive parameters (status enumerations, typed fields) that hint at proper usage without constraining exploration.

This is the most counterintuitive shift. Conventional prompt engineering wisdom says examples improve performance. For frontier models, Thariq explained in a fireside chat with Simon Willison: "Removing examples was extremely helpful, because it was just more creative than the examples we gave it." Examples anchor the model to a narrow solution space. Better tool interfaces let it explore.



3. Upfront Loading to Progressive Disclosure


Before: System prompt contained all verification instructions, code review procedures, and edge-case handling upfront.

After: Context loads on demand through skills and deferred-loading tools (ToolSearch). The model requests what it needs when it needs it.

This is arguably the most impactful change for token economics. If your agent has a 4,000-token system prompt but only uses the code review instructions 20% of the time, you are burning 3,200 tokens of capacity on every other request. Progressive disclosure treats context like lazy imports in code: load it when the call site needs it, not at module init.



4. Repetition to Consolidation


Before: Instructions appeared in both the system prompt and tool descriptions, often with slightly different wording.

After: Single source of truth in tool descriptions. The system prompt references capabilities; tools define their own behavior.

Duplication is a maintenance hazard in code. It is worse in prompts, because the model interprets both copies and tries to reconcile them — often by hedging or producing output that satisfies neither version fully.



5. Manual Memory to Auto-Memory


Before: Users managed memory through manual hotkeys and CLAUDE.md files.

After: Claude automatically saves relevant context without explicit user prompts.

This shift drew the most skepticism from the community (more on that below), but the architectural principle is sound: memory is a harness concern, not a user interaction. If your agent requires users to manually curate context files, you are outsourcing infrastructure work to your users.



6. Flat Specs to Rich References


Before: Markdown files served as plans and specifications.

After: HTML artifacts, code-based specs, detailed test suites, and rubrics replace verbose prose descriptions.

The insight here is that models parse structured formats (code, JSON schemas, test assertions) more reliably than they parse natural language descriptions of the same intent. A test suite is a specification — one that is unambiguous and executable.



Wait — Is It Actually 80%?


Not quite. Pawel Huryn ran the actual numbers and found the headline overstates the cut. His analysis: Opus's prompt went from 2,686 words to 514 with memory disabled — that is the 80% figure. But the memory instructions were not deleted. They now load conditionally, only when memory is enabled. With memory on, the prompt went from 2,686 to 830 words. The real cut is closer to 70%.

View original post on X

This distinction matters for harness builders because it illustrates rule #3 in action: Anthropic did not remove 80% of the instructions. They removed roughly 70% and made another chunk conditional. The system prompt got shorter. The total instruction surface area got smaller, but not as dramatically as the headline suggests.

Huryn also flagged that the reduction is frontier-only. Opus 4.8 and Fable 5 get the lean prompt. Older models retain the full system prompt because they still need the guardrails. If your harness supports multiple models — and most production harnesses do — you may need to maintain two prompt profiles: a lean one for frontier models and a verbose one for everything else.



What the Community Is Saying


The Hacker News thread hit 462 points and 401 comments, and the debate split into two camps.

View on Hacker News

The pragmatists see this as validation: simpler prompts, better results, lower costs. Simon Willison endorsed the approach directly: "It's time to stop overloading our prompts with examples and lists of things not to do, Fable works better without those." Peter Yang quoted Thariq saying the latest models "often need more room to run."

View original post on X

The skeptics raised three concerns worth taking seriously:

Lock-in. One HN commenter argued this "moves tailoring the harness out of the easily transferable .md file into specific Anthropic tooling to increase lock-in." If your system prompt was a portable document and now your instructions live in Anthropic-specific skills and tool interfaces, you have traded simplicity for vendor dependency. This is a real concern for multi-model harnesses.

Auto-memory risks. Users worried about involuntary memory pollution: "I absolutely don't want things to get added to some memory behind my back." The counterpoint — which Anthropic made in the blog post — is that auto-memory produces better context curation than manual management for most users. But the opt-out path matters for security-sensitive deployments.

Day-one reliability. Reports of "accidental deletions" and "far more mistakes" on the first day of Opus 5 usage surfaced in the HN thread. Techstrong.ai's analysis noted that prompt reduction and model upgrade happening simultaneously makes it harder to isolate which change caused regressions — a real problem for teams running evals against a moving target.

The Contrarian Take: Some harness builders argue the opposite direction — that production agents in regulated environments need MORE explicit constraints, not fewer. Compliance requirements (SOC 2, HIPAA audit trails, PCI-DSS data handling) often demand provably deterministic behavior that judgment-based prompts cannot guarantee. If your agent handles PII or financial data, "match the surrounding code's idiom" is not an acceptable instruction. You need "never log, store, or return PII in plain text" — stated explicitly, every time. The 80% cut works for a coding assistant. It may not work for your compliance-bound agent.



What This Means for Your Harness


The Anthropic blog post and the community discourse converge on a practical audit framework. Here is what to do with your own system prompt this week.



The Prompt Audit Checklist


1. Hunt for contradictions. Search your system prompt, CLAUDE.md (or equivalent), tool descriptions, and skill definitions for duplicate instructions. If two sources say different things about the same behavior, the model is arbitrating between them on every request. Pick one source of truth and delete the other.

2. Strip examples from tool definitions. If your tool descriptions include usage examples, try removing them and benchmarking. Frontier models often perform better without examples because examples constrain the solution space. If performance drops, the tool interface needs better parameter design — not more examples.

3. Move instructions into tool metadata. If your system prompt says "when using the database tool, always check for SQL injection," move that instruction into the database tool's description field. This is progressive disclosure: the model sees the instruction exactly when it needs it, not on every request.

4. Separate universal from conditional context. Flag every instruction in your system prompt as "always needed" or "sometimes needed." The "sometimes needed" block should load conditionally — via skills, dynamic system prompt assembly, or tool-level descriptions. Martin Fowler's analysis of context engineering confirms this: "an agent's effectiveness goes down when it gets too much context."

5. Replace negative constraints with positive framing. "Never delete files without confirmation" is a negative constraint. "Before any destructive operation, confirm with the user" is a positive frame. Frontier models respond better to the positive form because it describes what to do, not what to avoid. Negative constraints also accumulate — a prompt full of "never do X" reads like a minefield that the model tiptoes around.

6. Run /doctor. Anthropic shipped claude doctor (accessible as /doctor in Claude Code) specifically to help developers rightsize their configurations. It identifies unnecessary or outdated instructions in your CLAUDE.md and skills. Even if you are not using Claude Code, the diagnostic philosophy applies: audit for instructions that newer models have internalized.



The Vercel Precedent


This is not only an Anthropic story. At the AI Engineer World's Fair, the broader trend was unmistakable: harness simplification beats harness expansion. Vercel reported removing 80% of their agent's tools — not prompt, but tools — and watching success rates climb from 80% to 100%, with tokens dropping by more than half and latency falling from 724 seconds to 141. Same model. Less scaffolding. Better results.

The pattern is consistent: when the harness is over-engineered, the model spends capacity navigating the harness instead of solving the problem. Lilian Weng's 2026 essay on harness engineering formalized this as a research direction — the surrounding systems (workflow management, context handling, permissions, evaluation) are now the primary engineering surface, not the model itself.

We have been tracking this shift on AgentConn for months. The guardrail stack article from June (It Fails on the Harness, Not the Model) argued that reliability is a harness problem. The skills-as-dotfiles piece showed skills replacing static prompt configuration. And the skills vs. MCP architecture analysis explored where instructions should live in a modern agent stack.

Anthropic's 80% cut confirms the thesis: the model got smarter, and the scaffolding became the bottleneck.



Where the Instructions Went


It is important to understand that Anthropic did not simply delete 80% of their instructions. They relocated them. Thariq's blog post describes the destination architecture:


Tool descriptions now carry behavioral instructions that previously lived in the system prompt. When Claude Code loads the Edit tool, the tool's description includes editing-specific guidance.


Skills serve as progressive-disclosure containers. The code review checklist is not in the system prompt — it loads when a code review skill activates.


Deferred tools (via ToolSearch) allow the model to request capability descriptions on demand rather than receiving them upfront.


Test suites and code references replace natural language specifications. A test file is a more precise spec than a paragraph describing expected behavior.

This is an architectural pattern, not a prompt trick. As the Developers Digest analysis noted, the HN community immediately recognized this as a shift from "prompt engineering" to "context architecture." And it is portable: you can apply the same progressive-disclosure architecture to any agent harness, regardless of the underlying model. The implementation details differ (Claude Code uses skills and ToolSearch; your harness might use dynamic system prompt assembly or tool-level middleware), but the principle is identical: load context at the point of use, not at session start.



The Prompt Is Dead. Long Live the Harness.


Here is the forward-looking bet: within 12 months, the concept of a static system prompt will feel as archaic as hardcoded configuration files feel to anyone who has used environment variables and feature flags.

The system prompt was always a crude instrument — a single block of text loaded at the start of every interaction, regardless of task. It was prompt engineering's equivalent of a monolithic application: everything in one place, tightly coupled, impossible to update without risking side effects elsewhere.

The frontier has moved to dynamic context assembly: system prompts that adapt per task, tools that carry their own instructions, skills that load on demand, and memory that persists and retrieves automatically. This is context engineering — and it is the discipline that separates production agent harnesses from prompt-engineering experiments.

Anthropic deleted 80% of their system prompt because the other layers of the context stack made it redundant. The question for every harness builder is: how much of your system prompt is still earning its keep?

If you have not audited yours since your last model upgrade, start now. The instructions that made your agent reliable six months ago may be the instructions making it worse today.

Originally published at AgentConn


Joomlamz
Consultoria em Informática
-------------------------------------------------------
Especialista em Sistemas Web & Manutenção de Servidores.
A desenvolver o novo AplPortal com suporte a PHP 8.
Precisa de ajuda profissional? Contacte-me.

Tags: