Sub Agents


Sub Agents

I’ve been playing around with Claude Code sub-agents a lot recently and only just cracked how to get them working reliably.
​
At first I thought they’d just work automatically. After all, the docs do say just prompt Claude with ALWAYS USE and it’ll magically select the right agent.
​
But that never worked for me.
​
Instead I found tagging the agent with @sub-agent-name forced Claude to select it. This feels a bit broken but I guess its messy tool selection and thats a tricky problem.
​
I discovered a better method.
​
Asking Claude to tag the right agent when it builds the plan. This fits really nicely in my current workflow:
​
→ research
→ plan (this step)
→ execute
→ refactor
​
It turns out to be a really nice way to get it to automatically add agent selection to the planning stage without me having to manually select the agent at different stages. Its not full-proof but it does it a good majority of the time.
​
I should probably spend more time tweaking the agent descriptions and Claude.md file to get it to eagerly select these agents but I haven’t invested the time there yet.
​
I’ll have a go and make a post when I test this.

113 Cherry St #92768, Seattle, WA 98104-2205
​Unsubscribe · Preferences​

Not a vibe coder

I'm sharing the exact methods I use as an AI engineer to build production systems - techniques so effective they work even in niche languages like Elixir. Get the complete playbook delivered to your inbox 👇

Read more from Not a vibe coder

Hooks Hooks are another feedback mechanism we can use in Claude code.They run arbitrary commands after certain lifecycle events.There’s one hook I lean on heavily “Stop”.It’s called when Claude has finished generating code. Which maps really nicely to my normal workflow where I would run commands like compile, lint, prettier, etc. to check the code is in a good state before continuing.These commands are generally fast to run and when they fail the error is fed back to the LLM and continue to...

Background Agents My favourite thing about Github Agents is that they run in their own isolated containers and can scale infinitely. Until recently I’ve felt a bit stuck with Claude Code. On one hand its the best code generator. On the other, it doesn’t scale well beyond one instance and I have to wait for it to complete, which sometimes can be quite a while. Now I’ve figured out a way to work on multiple tickets at a time by running multiple instances of claude code. This is something they...