I was using Claude Code Sub-agent wrong...
Here's what I learnt after 20+ hrs trial & errors
Made my agents way more effective
๐ Thread below https://x.com/jasonzhou1993/status/1955970025984287004/photo/1

First -
Why did Anthropic build sub-agents initially?
It's all about context engineer & context optimisations
It works best when focusing on planning & researching and send back with a summary plan to conversation thread https://x.com/jasonzhou1993/status/1955970028878356510/video/1
However,
Context sharing between sub-agents is non-exist
That's why if you have sub-agent do actual work, then this context is not visible to all other agents
This cause problems... https://x.com/jasonzhou1993/status/1955970031743066532/video/1
Meanwhile,
@ManusAI_HQ has this blog on how they use file storage as the ultimate context system
It inspired me to design a context sharing setup to get main agent & sub agents to share context between each other
.claude/
โ tasks/ (Updated by all agents)
โ session_context_01.md
โ session_context_02.md
โ ...
โ docs/ (Store result of each sub agent)
โ http://shadcn-frontend-implementation.md
โ http://vercel-ai-sdk-5-plan.md
โ http://usage-pricing-plan.md
โ ...
This allow effective handover & ability to maintain context
This is how I built:
- @shadcn -ui-expert agent
- vercel-@aisdk -5-expert agent
Using principles above https://x.com/jasonzhou1993/status/1955970037736726543/video/1
Result?
It can one-shot building a fully functional chatGPT replica using latest @aisdk v5 (introduced a few weeks ago) https://x.com/jasonzhou1993/status/1955970040567881953/video/1
If you interested in learning more
We have a claude code template in @aibuilderclub_ with best hooks/agents/commands that actually useful
We do weekly build together sessions https://x.com/jasonzhou1993/status/1955970044481225099/photo/1
