| This is the best question anyone has asked. Let's consider context. At some level the more context you have is good. At some level, the more irrelevant context you have is bad. Okay. We have at top level of context, a hook that forces a system prompt on every action. Next level we have a ./claude/CLAUDE.md
then we have the project level CLAUDE.md
then we have a possible not required agent setup
then we have the instructions you give it We know that CLAUDE.md gets lost in the context, at any level. The system prompt level hooks don't. Why does the CLAUDE.md get lost? Why are we losing ability with a longer context. The problem is irrelevant context to the action. The Documentation agent doesn't require the Golang modernization rules. The Golang agent, doesn't require the planing coordinator rules. So the question I asked myself last weekend was, what is the experience if you split the contexts to only the required information for the task. I did head to head battles with agents, reading in the information, versus contextual specific information. The agents with context specific destroyed the competition. Like it was another world. So then I ran head to head tests on the type of information. Etc etc. My current setup is the best level achieved in those tests. So my argument is that removing the context that is entirely irrelevant for the agent improves performance dramatically. But I'm one person doing tests... it's true for me. Maybe it's not true for others. People have to explore the conception and determine that. I can only tell you what has worked best for me, and for me, it's like a model jump in performance improvements. |
I've been exploring the ways in which I could "lazy load" context depending on the task at hand. I've approached this by defining an AI "receptionist", a set of roles and a set of tasks.
The receptionist is the entrypoint of the system. It knows where to find roles/tasks but only loads very basic information about the roles.
Depending on the role I ask for, it then loads the right role file, which in turn loads additional context. Then I ask for whatever i want to do, and it loads specific task files based on what I asked. And the task files load additional context etc.
This works quite well because I end up with just the right context for the task at hand. And each role/task can actually be executed as a sub-task/agent