Original Reddit post

While the rest of the industry is building software factories, I’m still tuning my main agent’s context. We put a lot of effort into the build loop: CLAUDE.md, skills, plan mode, when to compact or write a handover and clear. What gets overlooked is everything else the main agent does. Research was the first one I caught. I’m a Salesforce developer, and Salesforce ships three releases a year, so what the model remembers about an API, a limit or a feature is often a release or two behind. I constantly ask the agent to check the latest docs so the design holds up, and every fetch added a chunk to my context. So I moved research into a subagent and measured it. What the subagent changed I ran the same 10 questions through Salesforce Docs MCP twice, three rounds each. Called from the main session, it added a median 45,636 tokens to my context. In a subagent with only the MCP, it added 5,327. The catch: the subagent got 24 of 30 right against the main session’s 28, because the main session also fell back to web fetch, and the subagent couldn’t reach pages outside the index. The lesson: any task that reads a lot but returns a little belongs in a subagent. But a subagent can only answer from what its tools can reach. When the answer is somewhere it can’t look, it should say so instead of guessing. What I built on that lesson My Salesforce documentation agent, sf-docs-agent , uses my own fetch script instead of an index. Against Salesforce’s own platform-docs-get skill, which reads pages inline, it added 83% fewer tokens to my context and used 41% fewer tokens over the whole session, with 40 of 40 right. Three things let the main agent trust the answer without reading the source: It returns lines, not pages. A script caches each page on disk, the subagent picks line numbers, and the script prints those lines verbatim with the source URL. No quote is written from the model’s memory. A hook checks each quote against the cached page before the report comes back (in a folder you trust). It reports what it didn’t read. Skipped pages and unfollowed links come back as gaps, so you know where the answer stops. The MCP in a subagent is still faster and lighter on session tokens. I traded that for quotes I can check against the source page with one grep. The tool is for Salesforce. The pattern is for any stack. Where this is going for me Research is just the first. The goal is a main agent that holds only the context for the feature it’s building: the requirement, the design, the code. Everything else (testing, deployment, debug log reading, repo scouting, data loading and extraction) goes to a subagent. Each one follows the same rule as the research agent: do the task in its own context and hand back only the result the main agent needs and can check. Factory or not, that rule is part of the workflow, not a cleanup step. Handovers decide what carries over when I clear. Subagents decide what the main agent never has to hold. I’m curious how this looks in other stacks. Which agents have you moved out of your main session, or think should be? submitted by /u/drsaavedra

Originally posted by u/drsaavedra on r/ClaudeCode