· By Jody in Coding Agents, Prompt Engineering —

Protect your LLM's context window by using progressive disclosure

In my continuing quest to look after the context windows of my LLMs - I would like to talk about the principle of progressive disclosure. The basic idea of progressive disclosure is that you structure your external context (such as code in a code repository) in such a way that your coding agent can find what it needs, without having to fill up its context window with redundant information.

Typically, your external context has to be curated into some form of index, so it can be efficiently loaded on demand as needed. A good example of this is how your coding agent loads skills: Each skill has some metadata that gets loaded straight into your LLM's context window when a new session is started. Your LLM then uses this metadata to decide when to load the whole skill.

A good place to think about progressive disclosure is in your CLAUDE.md (or AGENTS.md) file. Rather than dumping a detailed overview of your entire project into it, a better way to use it would be to provide a skeleton overview, which then references key resources and other indexes - such as READMEs and other documents to progressively disclose context in specific areas.