Context Engineering for Claude 5: Prompting When the Model Actually Reads the Docs
The Atomic Shift: From Prompt Engineering to Context Engineering
For two years, we’ve been playing a game of telephone with LLMs. We’d carefully craft system prompts, stuff a few relevant files into the context window, and pray the model didn’t hallucinate the rest of our API surface. That era just ended.
Anthropic’s latest post, The New Rules of Context Engineering for Claude 5 Generation Models, isn’t a minor tweak to the prompt-crafting playbook. It’s a hard pivot. The model now reads documentation the way a senior engineer joining a new team would: it ingests the whole repo, traces dependencies, and understands the system before it writes a single line of code.
The job of the engineer shifts from “write a clever prompt” to “curate a high-signal context environment.” You’re no longer whispering instructions into a black box. You’re onboarding a hyper-literate, tireless junior engineer who has photographic memory but zero real-world judgment. Your job is to give it the right onboarding materials.
Why This Flips the Script for Forward Deployed Engineers
If you’re an FDE, your life is defined by context-switching. Monday you’re in a customer’s Terraform repo debugging a VPC peering issue. Tuesday you’re writing a Python SDK wrapper for their legacy SOAP API. Wednesday you’re building a proof-of-concept that stitches together three of their internal microservices.
Claude 5 generation models change the economics of that work. Previously, you’d spend an hour distilling a customer’s sprawling internal wiki into a 2,000-word prompt. Now, you can point the model at the wiki itself, plus the relevant terraform.tfstate, plus the SDK source, and say: “Figure out why the staging environment can’t reach the data warehouse. Write the fix.”
This isn’t hype. The model’s extended context understanding means it can hold an entire microservice architecture in its head. For an FDE, that’s the difference between building one custom integration per week and building three. The bottleneck shifts from you translating context to you curating it.
Internalizing this shift is also a career accelerant. The FDEs who thrive in the next 18 months won’t be the ones who write the cleverest few-shot examples. They’ll be the ones who can walk into a customer environment, quickly identify the 12 files that actually matter, and feed them to the model in a structure it can reason over. That skill—context curation—is what separates a $180K FDE from a $280K FDE. If you’re coming from a backend background and want to build this muscle, the transition path is clearer than ever. We cover the roadmap from pure coding to this kind of systems-level, customer-facing engineering in our guide to breaking into FDE roles from a backend or frontend background.
The New Rules of Context Engineering (And Why “Chain-of-Thought” Is Legacy)
Let’s get concrete. The source post outlines a paradigm where the model is no longer a prompt-completion engine. It’s a document-reasoning engine. Here are the rules that matter, translated from research-speak to engineering reality:
- The System Prompt Is a Table of Contents, Not an Instruction Manual. In Claude 5, the system prompt’s primary job is to tell the model where to look, not how to think. You’re providing pointers: “The API spec lives in
docs/api.md. The auth logic is insrc/auth/. The customer’s data model is inschema.sql.” The model will read those files and derive the instructions itself. - Context Is a Graph, Not a Flat List. Dumping 50 files into the context window with no structure is the new equivalent of a spaghetti-code codebase. The model understands relationships. If you provide a
package.jsonor a Terraform dependency graph, it will trace imports. Structure your context in a way that mirrors the dependency tree of the system you’re working on. - Few-Shot Examples Are Now “Constraint Examples.” You don’t need to show the model how to do something by giving it three perfect input-output pairs. You show it what not to do by giving it constraints: “Here’s our style guide. Here’s a list of deprecated endpoints we can’t use. Here’s a customer’s security policy that prohibits public S3 buckets.” The model infers the positive behavior from the documentation; you provide the negative space.
- Verification Moves Upstream. When the model reads the docs directly, hallucination doesn’t look like a wrong API call. It looks like a correct API call to an endpoint that should exist but doesn’t. Your verification step isn’t “does this code look right?” It’s “did the model hallucinate a dependency?” The fix is to add that missing dependency’s documentation to the context, not to tweak the prompt.
Architecture: How Claude 5 Ingests a Codebase
To engineer context effectively, you need a mental model of what the model is doing under the hood. Think of it less like a chatbot and more like a just-in-time retrieval engine with native reasoning.
The flow is top-down. You provide a high-level index (the system prompt). The model pulls in the referenced documents and builds an internal dependency graph. It then reasons across that graph, applies your constraints, and generates output. The key insight: if a document isn’t in the graph, it functionally doesn’t exist for the model. Your job is to make sure the graph is complete but not bloated.
Practical Playbook: Structuring Context for Maximum Signal
Here’s how to actually do this today, in your terminal or IDE.
1. The “Repo Map” First Approach
Before you ask Claude to do anything, build a REPOMAP.md or use a tool that generates one. This is a concise, hierarchical map of the codebase with one-line descriptions of each directory and key file. Feed this to Claude as the very first piece of context. It gives the model the same 30,000-foot view you’d get from a senior dev on your first day.
Example REPOMAP.md snippet:
# Project: Customer Data Pipeline
- /src/ingestion/ : Kafka consumers for raw event streams
- /src/transform/ : Flink jobs for data normalization
- /src/storage/ : Write paths to S3 and Postgres
- /docs/api.md : Internal API spec for the pipeline config service
- /terraform/ : Infra-as-code for the AWS environment
2. The Constraint File
Create a single CONSTRAINTS.md file that you include in every session. This is your negative space. It’s a living document that grows every time the model makes a mistake.
Example CONSTRAINTS.md:
# Project Constraints
- NEVER use the /v1/legacy/ endpoints. They are deprecated and will be removed in Q4.
- All new services must use the company's standard logging library: `@corp/logger`.
- Do not create public S3 buckets under any circumstances. Customer data is PII.
- Python code must pass `mypy --strict` with no exceptions.
3. The “Ask-Docs” Prompt Pattern
Instead of writing a prompt that explains the task, write a prompt that points to the documentation of the task.
Old way (Prompt Engineering):
"You are an expert Python developer. Write a function that connects to our Postgres database using the
psycopg2library. The connection string is stored in an environment variable calledDATABASE_URL. The function should return a connection object and handle connection errors by retrying three times with exponential backoff. Use a context manager..."
New way (Context Engineering):
"Read
/docs/database.mdfor our Postgres connection patterns. Read/src/utils/retry.pyfor our standard retry logic. Implement a database connection function that follows these exact patterns. Constraints in/CONSTRAINTS.mdapply."
This is faster to write, less prone to your own errors, and automatically stays in sync with the codebase as the docs evolve. For a real-world example of this pattern in action—where you feed a model a database schema and let it reason over it—check out our guide on building a natural language SQL analyst agent over your Postgres database.
4. The Diff-Based Verification Loop
Don’t ask Claude “Is this correct?” It will say yes. Instead, use a verification loop that leverages the model’s document-reasoning capability.
- Ask Claude to generate the code.
- Ask Claude to generate a diff of its changes against the existing codebase.
- Ask Claude to re-read the relevant documentation and annotate each chunk of the diff with a citation from the docs that justifies the change.
If it can’t cite a specific section of the docs for a change, that change is a hallucination. Delete it and add the missing documentation to your context.
The Sharp Edges: When Context Engineering Goes Wrong
This isn’t a magic wand. There are failure modes you’ll hit within your first week.
Context Poisoning. If your documentation is wrong or contradictory, the model will confidently generate broken code. It trusts your docs more than its own pre-training. A single out-of-date API spec in the context window is worse than no spec at all. You need a doc hygiene process that’s as rigorous as your code review process.
The “Too Much Context” Trap. While the context window is huge, the model’s attention isn’t infinite. If you dump 10,000 lines of irrelevant code into the context, the signal-to-noise ratio drops and the model will start missing critical details in the files that actually matter. Be aggressive about pruning. If a file doesn’t directly touch the task, leave it out.
The Over-Abstraction Death Spiral. A common failure mode: you ask the model to implement a feature, and it generates a beautifully architected, hyper-abstracted solution with six new interfaces and a factory pattern. Why? Because it read your CONTRIBUTING.md that says “we value clean, extensible code.” The fix is in your CONSTRAINTS.md: “Prefer concrete, single-file implementations. Do not introduce new abstractions unless explicitly requested. Follow the pattern in /src/existing_feature.py.”
Verification Bottleneck. When the model can generate 500 lines of correct-but-subtly-wrong code in 30 seconds, your human review becomes the bottleneck. This is where the FDE skillset has to evolve. You need to get fast at reading diffs with an eye for hallucinated dependencies and misaligned business logic, not just syntax errors. This is the exact kind of high-leverage, customer-facing engineering work that defines the modern FDE role. If you’re wondering how that translates to compensation and career growth, we break down the numbers in our FDE compensation bands and negotiation playbook.
FAQ: Context Engineering for Claude 5
Q: Is prompt engineering dead? No. It’s been promoted. Prompt engineering was the craft of getting a model to do something it didn’t natively understand. Context engineering is the craft of giving a model the knowledge it needs, then getting out of its way. You’re still engineering, but at a higher level of abstraction.
Q: How do I convince my team to write documentation the model can read? Stop calling it documentation. Call it “context assets” or “model onboarding files.” The incentive changes when you frame it correctly: this isn’t a chore for future humans. It’s a direct input to a tool that can write 40% of your next sprint’s code. Teams that maintain clean, structured docs will literally ship faster.
Q: What’s the first thing I should try with this new approach?
Take your most annoying, context-heavy integration task—the one with a sprawling internal API and terrible docs. Spend 30 minutes building a REPOMAP.md and a CONSTRAINTS.md. Then, write a context-engineering-style prompt that points to those files. Compare the output to what you’d get from a hand-crafted prompt. The difference will be stark.
Q: How does this change the way I review AI-generated code? You stop looking for syntax errors and start looking for dependency hallucinations. The new question isn’t “Does this code work?” It’s “Does every library, endpoint, and data structure this code references actually exist in the context I provided?” If the answer is no, don’t fix the code. Fix the context.
Q: Does this work only for code generation? No. This paradigm applies to any domain where the model can read source-of-truth documents. Legal contract review, customer support with a knowledge base, medical research with a corpus of papers. If you can structure the source documents, the model can reason over them. For a practical example that’s closer to the FDE workflow of automating business processes, see our guide on building an invoice extractor that turns PDF receipts into structured JSON. The same context-first principles apply.
Want to build like a Forward Deployed Engineer?
FDE Coach is a cohort-based program in frontend, backend, AWS, and AI. Build real products and get referred to 200+ hiring partners.
Explore the program