Designing for the Context Window
The single constraint that shapes every aspect of agent skill design is the context window — the finite amount of information an agent can hold and attend to at once. A skill that ignores this constraint bloats the agent's context, degrades its focus, and defeats its own purpose. Designing for the context window — loading only what is relevant, only when relevant, as compactly as possible — is the craft at the heart of good skills. This post is about that constraint and how it drives skill design.
Post 1 said skills are loaded on demand because of the context window. This post makes the context window the explicit design center. Understanding why context is scarce and precious — and designing skills to respect it — is what separates skills that make an agent more capable from skills that quietly make it worse. It’s the most important design principle in the series.
The context window is finite and precious
An LLM agent operates within a context window: the bounded amount of text (tokens) it can take in and reason over at once — the task, the conversation, any loaded knowledge, and the agent’s own working notes all share this one finite budget. This constraint is fundamental and has consequences that shape everything:
- It’s finite. The window has a hard limit, so everything the agent needs — instructions, knowledge, conversation, intermediate work — competes for the same bounded space. You cannot load everything; you must choose.
- More context isn’t free — it degrades focus. Even within the limit, filling the context has a cost: a model attending to a huge, cluttered context reasons less well about the actually-relevant parts (attention is diluted across irrelevant material). This is the crucial and under-appreciated point — a bloated context doesn’t just risk hitting the limit, it actively degrades the agent’s performance on the task by burying the relevant signal in noise. Context is not just finite; it’s precious, and spending it on irrelevant material has a real quality cost.
- It’s the agent’s working memory. The context window is effectively the agent’s short-term memory for the task, so what’s in it determines what the agent can “think about.” Managing it well is managing the agent’s attention and effectiveness.
This is why post 1’s “loaded on demand when relevant” matters so much: if skills were always-on, a library of them would flood the context, blow the budget, and degrade the agent on every task. The context window is the scarce resource skills must respect, and the whole discipline of skill design is really context-window discipline — getting the right, minimal information into the agent’s working memory at the right time.
The core principle: load only what’s relevant, only when relevant
The master principle of skill design follows directly from the context constraint: minimize what occupies the context, maximize its relevance. Concretely:
- Relevance-triggered loading. A skill should load only when the task actually calls for it (post 1’s triggering), so the agent’s context holds the skills relevant to this task and not the dozens that aren’t. This is what lets an agent have a large library of skills while only a few occupy context at once — the key to scaling skills without drowning the agent. Getting the triggering right (so the right skill loads at the right time, and irrelevant ones stay out) is central.
- Progressive disclosure / lazy loading. Don’t load a skill’s entire contents up front — load a lightweight summary or the core instructions first, and pull in detailed reference, examples, or resources only if and when needed. This “progressive disclosure” keeps the common case lean (just the essentials in context) while the depth is available on demand. A well-designed skill reveals itself in layers, so the agent pays context cost only for the depth a given task actually requires.
- Compactness. Within what is loaded, be concise — every token of instruction or knowledge spends scarce context, so a skill should say what’s needed clearly and no more. Verbose, redundant, or tangential content in a skill is a direct tax on the agent’s working memory and focus. Ruthless concision is a skill-design virtue, not optional polish.
Put together: a good skill loads the minimal relevant information, at the right time, in the most compact form — and defers everything else. This is the opposite of “stuff everything the agent might need into one giant always-on prompt,” which is the naive approach that bloats context and degrades performance. Skill design is the discipline of being parsimonious with the agent’s attention.
Why this makes skills better than big prompts
Designing for the context window is also why skills are a better pattern than ever-longer prompts (post 1’s reframe), and seeing the connection clarifies the whole approach:
- Big prompts don’t scale. Cramming all possible instructions and knowledge into one prompt hits the context limit and, well before that, degrades focus (the dilution problem). It also means paying the context cost of everything on every task, even the irrelevant parts. The monolithic-prompt approach collapses under its own weight.
- Skills are modular context management. Skills let you decompose capability into units that load independently and only when relevant — so the agent’s context at any moment holds just what this task needs. This is essentially good information architecture for the agent’s attention: the right modularity (one skill per coherent capability), the right triggering (load when relevant), and the right layering (progressive disclosure) keep context lean regardless of how large the total skill library grows.
- It’s a familiar engineering idea. This is modularity and separation of concerns (classic software design) applied to an agent’s context: instead of one monolithic blob, many focused, independently-loadable modules, composed as needed. The same reasons modular code beats a giant function apply to skills beating giant prompts — focus, reuse, composability, and manageable complexity.
The deeper insight to carry through the series: skill design is context-window design. Every later topic — how to structure a skill (post 3), patterns of work (post 4), what makes a good vs bad skill — comes back to this constraint: get the minimal relevant information into the agent’s precious, finite working memory at the right moment, and keep everything else out. A skill that respects the context window makes the agent more capable and more focused; a skill that ignores it (bloated, always-on, verbose) makes the agent worse even as it tries to help. Master the context window, and you’ve mastered the core of skills.
The throughline: the context window — the finite tokens an agent can hold and attend to at once — is the constraint that shapes all skill design. It’s finite (everything competes for one budget — you can’t load it all) and, crucially, more context isn’t free: it degrades focus (a bloated context dilutes attention and worsens the agent on the task — context is precious, not just limited), and it’s the agent’s working memory. So the master principle is load only what’s relevant, only when relevant, as compactly as possible: relevance-triggered loading (only the task’s skills occupy context — lets a large library scale), progressive disclosure (load essentials first, pull depth on demand — layered), and compactness (every token taxes focus — ruthless concision). This is why skills beat big prompts — monolithic prompts hit the limit and dilute focus and pay for everything every time, while skills are modular context management (separation of concerns applied to the agent’s attention). The deep insight for the whole series: skill design is context-window design — minimal relevant information, at the right time, everything else kept out.
Key takeaways
- The context window (the finite tokens an agent can hold/attend to at once) is the constraint shaping all skill design: it’s finite (everything — task, conversation, knowledge, working notes — competes for one budget, so you can’t load it all) and it’s the agent’s working memory.
- Crucially, more context isn’t free — it degrades focus: a bloated, cluttered context dilutes attention and makes the agent reason worse about the relevant parts, so context is precious, and spending it on irrelevant material has a real quality cost (not just a risk of hitting the limit).
- The master principle: load only what’s relevant, only when relevant, as compactly as possible — via relevance-triggered loading (only this task’s skills occupy context — what lets a large skill library scale without drowning the agent), progressive disclosure/lazy loading (load essentials first, pull detailed reference/examples/resources only when needed — a skill revealed in layers), and compactness (every token taxes focus — ruthless concision is a design virtue).
- A good skill loads the minimal relevant information, at the right time, in the most compact form, deferring everything else — the opposite of the naive “stuff everything into one giant always-on prompt,” which bloats context and degrades performance.
- This is why skills beat big prompts: monolithic prompts hit the limit, dilute focus, and pay context cost for everything on every task, while skills are modular context management (modularity/separation-of-concerns applied to the agent’s attention — focus, reuse, composability). The series’ deep insight: skill design is context-window design — a skill that respects it makes the agent more capable and more focused; one that ignores it makes the agent worse.
Further reading
- Large language model — the context window and its limits
- Separation of concerns — the modularity principle skills apply to context