How Anthropic Boosted Engineer Code Output 8‑Fold with Context Engineering

Anthropic engineers increased daily code merges by eight times without changing models, hardware, or team size, simply by giving Claude a fully engineered context before it acts, a practice the article calls "context engineering" that replaces traditional prompt engineering.

AI Architecture Hub
AI Architecture Hub
AI Architecture Hub
How Anthropic Boosted Engineer Code Output 8‑Fold with Context Engineering

01 Why Your AI Agent Gives Bad Answers

When an AI agent fails, most blame the model for wrong files, assumptions, or obvious mistakes, but the real issue is missing context. Claude can only see what is inside its context window; everything outside is invisible, leading to incorrect guesses.

02 What Is Context

Context is more than a single prompt. A well‑engineered context consists of seven coordinated parts: memory, instructions, examples, files, prior actions, tool results, and state. Each time Claude takes an action, the context grows with new tool results, files read, and updated state, forming a loop that drives the agent.

User request
↓
Context built from seven parts
↓
Claude decides action
↓
Tool execution
↓
Result added to context
↓
Claude sees new context
↓
Next action
↓
Repeat until done

03 The Three‑Layer Context Stack

Anthropic recommends three layers of context, each loaded at different stages:

Global context : permanent information such as agent identity, core rules, coding style, security constraints, and things the agent must never modify.

Project context : knowledge about the specific codebase, including architecture, design decisions, dependencies, README, AGENTS.md, folder structure, and testing guidelines.

Task context : the immediate file(s), current ticket, concrete goal, recent changes, test results, and task‑specific constraints.

Most developers only provide task context, forcing Claude to guess the missing global and project information.

04 AGENTS.md: The Game‑Changing File

AGENTS.md is the single most important file in any serious Claude Code setup. It lives in the project context, is automatically read at the start of each session, and contains the agent’s identity, coding standards, prohibited actions, and other rules. By accumulating the team’s conventions and past mistakes, it becomes a living specification that the agent never forgets.

05 Driving the Context Stack

Effective AI engineers do not start with a clever prompt; they load a stack of structured information before Claude acts:

Load global context (identity, rules, style).

Load project context (AGENTS.md, architecture, documentation).

Retrieve relevant historical memory.

Load files relevant to the current task.

Load current state (test results, recent changes).

Define clear success criteria for the task.

Let Claude act with the complete information.

Comparing a poorly engineered agent (problem → Claude → answer, with Claude guessing) to a well‑engineered one shows that the latter follows a richer pipeline: problem → document retrieval → memory retrieval → AGENTS.md → file reading → state check → Claude → answer based on full context.

06 Memory: Persistent Context Across Sessions

Anthropic distinguishes three memory types that feed context:

Long‑term memory : everything learned from all past sessions, allowing the agent to compound value over time.

Short‑term memory : events within the current conversation.

Working memory : the content currently inside the context window.

Long‑term memory is stored in a Markdown file that the agent reads at session start and updates at the end, ensuring knowledge never disappears.

07 MCP: Context From Everywhere

Context does not come only from the repository. A production‑grade agent also needs information from issue trackers, monitoring tools, documentation, databases, and communication platforms. The Model Context Protocol (MCP) lets Claude pull such external data without custom integrations for each system.

File system (local files, configs, code).

GitHub (issues, PRs, commit history, CI results).

Linear / Jira (tickets, priorities, project status).

Slack (decisions, discussion context).

Postgres (live data, schema, query results).

Google Drive (documents, specifications, meeting notes).

Sentry (runtime errors, frequency, affected users).

With MCP, Claude sees not only code but also the why, the design discussions, the failure signals, and the data model constraints needed for correct decisions.

08 Context‑Engineering Workflow

A properly engineered task proceeds as follows: the agent receives the user request, loads the three‑layer context stack, retrieves relevant documents, memory, and files, checks the current state, and then produces an answer based on the complete information.

09 A Weekend‑Long Practical Setup

Day 1: Build the three‑layer stack—create a global context file with identity and core rules, write an AGENTS.md with architecture, coding conventions, and a “do‑not‑touch” list, and set up a memory file that updates each session.

Day 2: Connect external sources via MCP—install a GitHub connector, a file‑system connector, and optionally Slack or Linear connectors.

Day 3: Run the same task with the old “prompt‑only” approach and with the full context stack; the productivity gap demonstrates the eight‑fold increase.

10 The Shift That Has Already Happened

Prompt engineering focuses on finding the right wording; context engineering focuses on constructing the right information environment. Prompt writing is only the last 1 % of the work; the surrounding context accounts for the remaining 99 %.

Agents with perfect prompts but poor context make seemingly smart mistakes, while agents with ordinary prompts but complete context make correct decisions. The model is the same; the information environment differs.

Building the right context is the operating system for AI. When done correctly, an eight‑fold productivity boost is no longer a unique Anthropic story—it can happen in any codebase.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AI agentsMCPPrompt EngineeringProductivityClaudeContext EngineeringAGENTS.md
AI Architecture Hub
Written by

AI Architecture Hub

Focused on sharing high-quality AI content and practical implementation, helping people learn with fewer missteps and become stronger through AI.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.