Jason Zhou avatar

Jason Zhou

@jasonzhou1993

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
media photo
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.mdhttp://vercel-ai-sdk-5-plan.mdhttp://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
media photo
Compartilhar
Explorar