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:

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:

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:

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

Further reading

Sources & References