Module 02 / Lesson 01
Manage the Context Budget with Rules, Skills, and MCP
Treat your AI coding agent like an engineer who needs a clear handbook, an organized desk, and a safe sandbox.
You wouldn’t dump a 500-page operational manual into every short conversation with a teammate, nor would you let an intern run experimental tests directly on your production branch. When you connect too many tools or paste huge documents into an AI session, its memory context fills up, causing it to ignore earlier rules and make random mistakes.
Read the narration transcript
Start with the task, then choose the tools
I want to verify that a published incident update reaches the public page. Before touching the app, this setup has acquired a database integration, a browser integration, several prompt packs, and a custom server.
Each tool adds something I have to understand and maintain. I start over with a simple question. What capability do we actually need for this task?
Choose between instructions, skills, and MCP
The project rule is to use the existing typed database client. That belongs next to the code because anyone working on an update needs to know it.
The release review is a set of steps we repeat. That can live in a skill. The client can load the detailed procedure when it applies.
Now I want the agent to see the public page in a fresh browser. Reading a file won't answer that question. A browser tool can observe the actual behavior.
See what occupies the context window
Here’s the budget in plain English. The agent can only see so much at once. In a client that eagerly exposes tool descriptions, even idle connections can occupy space. The size depends on the client.
The skills index can carry the title and description up front. A relevant skill opens like a recipe when you need it. Leave the publish review in that recipe and keep the always-on repository rule short.
Now I add the browser because I need to observe a real page. Compare tool listings or token readings before and after in the same client. The useful measurement is what your setup actually sends.
Repeat one task with the smaller setup
Run the same check with and without the unnecessary integrations. Watch which calls the client actually makes. How tools are exposed in context varies by client.
Keep the browser check if it tells you when the visitor sees the update. Put the release procedure in a file. That's the smallest setup I can explain to someone joining this repo.
The everyday problem
The release reviewer needs to answer one question: after the operator clicks Publish, does a fresh visitor see the update? Their project setup has a full release history, a custom server that returns checklists, and several browser and database connections. They start a session with more setup to sort through than work to do.
We’ll give each kind of instruction a place. By the end you should be able to explain why the publish check needs a browser and why the written procedure can stay in the repo.
Why the agent got it wrong
A context window is how much information the agent can work with at once. Messages, repository guidance, file contents, and tool descriptions can all occupy space. Some clients expose many tool descriptions up front. Others discover tools on demand. The same set of servers therefore has different costs in different clients.
More context can help when it contains evidence the model needs. Extra instructions can also compete with the current task. The practical question is which file or tool should be available for every task and which should show up only when needed.
The tool and technique
Use three categories. A rule is a sticky note: always use the existing test fixtures. A skill is a recipe card: when you review publishing, follow these steps. An MCP connection is a cable to another system: use a browser to see what it returns now. MCP stands for Model Context Protocol, a way for an agent client to connect to tools and resources.
Many skill clients use progressive disclosure. They expose a short name and description first, then load the full SKILL.md when the task calls for it. Use an action-oriented description that names when the skill applies.
Pick the smallest tool that answers the question
Repository instructions apply to routine work. A skill packages a repeatable procedure and can load its full instructions when relevant, depending on the client. MCP connects the agent to live tools such as a browser or database. Clients differ in how they expose tool descriptions and measure context usage.
AGENTS.md → Always run the affected publish tests. SKILL.md → Review a publish form in three steps. Browser MCP → Check whether the saved message appears after reload.
Start with the instruction file and the skill. Compare a new session before and after enabling the browser connection. Keep the connection when live page evidence answers a question the files cannot.
On screen in the status app
Compare the before and after setup below. The streamlined version has an always-on instruction about seeded accounts, a skill that says how to confirm a publish, and one browser tool. Remove the custom MCP server whose only output was the checklist. The checklist is static text, so the repository can carry it.
Begin with a new session against the local app. Inspect which tools the client exposes and whether the skill can be found. Publish with the seeded operator, then look through a separate visitor profile. The first session’s view of the draft cannot answer what a visitor sees.
docs/agent-setup.md
Before
Always load the full release history. Enable the checklist, database, design, and browser MCP servers for every task.
After
AGENTS.md Use the app’s seeded accounts for publication checks. SKILL.md Publish known text, then open the public page in a separate session. Browser MCP Enable when the task needs to observe the current page. Review output Record which account acted, which page was checked, and what appeared.
What to watch for
Your IDE’s meter may include more than tool definitions, or it may show only an approximation. Treat the motion graphic as an illustration of what takes up space. Avoid promising a percentage saved or a universal number of tools to keep.
A browser tool gives the client access to the pages and accounts in its profile. Use an isolated profile and the status app’s fixtures. Give the connection a concrete task so you can remove it when it no longer earns its place.
How you know it worked
Record the available tool list or context display before and after in the same client with a fresh version of the same task. Check that the agent found the written release procedure and that the report includes what the browser actually showed.
If it can answer with repository text alone, try the task without the connection. If it needs to observe the page, retain the browser and close idle connections. The next lesson explains how to inspect a downloaded recipe before trusting it.