Context engineering for a team: what goes in the window, and what we learned testing ours
What context engineering means for a team that works with coding agents: what loads into the window and when, where each kind of knowledge should live, and what we measured in our own setup.
By Christian Buckner
An agent once worked a whole session in our own repository without calling our memory tool, which is the one thing we build. Nothing was wrong with the tool. Claude Code had listed it by name only, to save space, and nothing in the session told the agent to go and load it. So it was never really in front of the model, and the model never chose it.
That's the plainest lesson I have about context engineering. A model can only use what's in its window, and most of the work is deciding what gets in there, when, and how much room it takes.
The term comes from Anthropic's Effective context engineering for AI agents, which describes the goal as finding "the smallest possible set of high-signal tokens" that gets the result you want. The post also explains why smaller is better: as a window fills up, a model gets worse at recalling what's in it. Most of what's written on this is for people building an agent. This is about the other side, a team of people using agents on one codebase, where the question is whether five people's agents all get the same right things.
What's in the window before you type
In Claude Code, a session starts with the system prompt, your CLAUDE.md files (or AGENTS.md in their place), Claude's own auto memory, the names of your MCP tools, and the description of every skill. Then each file the agent reads is added, along with any rule file that matches it, the output of every command, and whatever your hooks print.
Run /context in a session to see your own numbers by category. It's worth doing once on a normal working day, because it's rarely what you'd guess.
Where each kind of knowledge goes
| What it is | Where it lives | When it loads |
|---|---|---|
| True in every session | CLAUDE.md or AGENTS.md at the root | At the start, every time |
| True for one part of the code | A rule file with a paths line | When the agent opens a matching file |
| A procedure with steps | A skill | Its description at the start, the rest when it's used |
| A fact that changes, like what was decided last week | Somewhere the agent can look it up with a tool | When the agent asks |
| A big read, like searching the whole repository | A subagent | Never in your window, only its summary |
For a team, what matters is that every row is either a file in the repository or a tool everyone connects to. Anything that lives in one person's head, or one person's session, isn't in anyone else's window.
Keep the always-loaded part small
Our CLAUDE.md reached 107,000 characters before we split it. Today the root file is about 29,000 and mostly an index, and the rules for each area sit in 13 rule files that load only when an agent opens a matching file. I wrote that up in CLAUDE.md for a team.
One catch came out of Claude Code's docs and not our own experience. When a long session is compacted, the root file is read again from disk, but a rule file that loaded along the way is summarized with the rest of the conversation. A rule that has to hold through a long session belongs in the root file.
Tools are context too
Every tool's name and description is text the model reads to decide what to do, so it deserves the same care as the instructions file. We test ours by handing a model our exact tool list, eight unrelated tools, and a coding prompt that never mentions us, then counting which tool it reaches for.
With our full descriptions, the model called our tool nearly every time it should have. With a one-line description, that fell to about four times in five. What surprised me was how it failed. The model didn't go quiet. It grabbed a different tool instead, like a shell command or a code search.
We also merged eleven tools down to one per job: one finds, one opens, one counts. Anthropic's post makes the same point from the other direction, that if a person can't say which of two tools fits, the model can't either.
And the story at the top is the first rule here. Claude Code keeps MCP tool definitions out of the window until they're needed, which is the right default, but it means a tool the agent should always use needs a line in CLAUDE.md saying so. Ours says to call it before answering anything about the product or the team.
Give injected context a budget
A hook can add text before every prompt. Ours asks Jackdaw what the team already knows about the question. We give it 2,000 tokens, and it keeps whole items only, because an earlier version cut the last one in half. The details are in Claude Code plugins for a team. The rule I'd take from it is that anything added on every turn needs a fixed size, since you pay for it every turn.
Hand over pointers, then let the agent open what it needs
Anthropic's post describes agents that hold references and load the data only when they need it. Claude Code works this way with files: it doesn't load your repository, it searches and opens what it needs.
We built our lookup the same way. An answer comes back as short lines, each with a reference, and the agent can open any line in full: the whole thread, the whole page, the history of a record. Often the short lines are enough. When they aren't, opening one costs a single extra call, where sending everything up front would have cost every question.
Retrieved text is not instructions
Whatever a lookup returns was written by somebody: a teammate, a customer's email, a web page. A model can read a sentence in it as an order. We label everything our tools return as data, and we strip anything that imitates an instruction block before the model sees it. If your agents read tickets, emails or web pages, it's worth asking what happens when one of those says "ignore your rules".
Long sessions
Claude Code compacts a conversation when the window fills. The root CLAUDE.md and auto memory come back from disk, and so do skill descriptions on version 2.1.304 or later. Text your hooks added earlier is summarized with everything else, and a skill you used comes back cut to its first 5,000 tokens.
You can steer it. /compact focus on the auth bug fix keeps what you name, and /clear between unrelated tasks starts you clean. A big search goes to a subagent, which reads in its own window and returns a summary.
What a summary can't be trusted to keep is a decision. Anthropic's post calls the fix structured note-taking: write it down outside the conversation. For us that's a page per area of the codebase in Jackdaw. Our agents read an area's page before changing it, and write decisions and test results back when they finish, so the next session, or the next person's agent, starts with them.
How to check your own
Pick a handful of questions a teammate would really ask, run them, and write down what the agent did. Then change one thing, a description or a rule or a budget, and run them again. Run each side more than once. When we compared two nearly identical wordings of a tool description with two runs each, the test couldn't tell them apart, so now we use four for wording that matters.
If you only do one thing, ask an agent at the start of a session which instruction files and tools it was given. If the answer surprises you, start there.
Sources
Read on November 29, 2026: Anthropic's Effective context engineering for AI agents, and in Claude Code's documentation, Explore the context window, How Claude remembers your project and Manage costs effectively.