Progressive Disclosure.mp4

Progressive Disclosure

I've taken the CLAUDE.md file that we had in the last lesson and I have opened it out a little bit more and added a bunch of sediment inside here - as if a bunch of developers had gone in and added their own ideas into this file.

CLAUDE.md file with lots of lines in

If you've been using Claude with a bunch of teammates, then you probably have one that looks a little bit like this.

Why This Is a Problem

Now this is not exactly ideal for reasons that we've already touched on. We have put a bunch of instructions into the global scope and not all of these are going to be relevant for every single request that we make of the LLM.

All of these instructions are going to be competing with the instructions that we give it in the prompt, for instance, in the plan.

A bad instruction about positional parameters

And if we're only touching front-end code that maybe doesn't have any positional parameters, that doesn't touch any services, maybe we don't even need to do any importing. Maybe we don't need to add a new ID to the database. Maybe we don't need to add a new timestamp to the database.

You know, all of these instructions are actually pretty narrow in the kinds of sessions that are going to need them.

Visualizing the Context Window

I want you to imagine that each one of the instructions in the CLAUDE.md is one of these grey blobs in the context window.

Diagram 1

Now it might be that only these little blobs here are actually relevant to front-end code. It might be that only these instructions are relevant for database code. Maybe these instructions are the ones that are relevant for React Router.

Now looking at all of these blobs, isn't it funny that we've got them grouped all into one file?

The Solution: Organize by Relevance

Wouldn't it make more sense if they were grouped together?

Since a session that needs one piece of React framework advice will probably need more React Router framework advice.