Live data from Hacker News

How to use Claude Code subagents to parallelize development

zachwills.net

101–110 of 131 posts

Re: How to use Claude Code subagents to parallelize development

#101

I am sceptical if these persona based agents really make that much of a difference, and more "appear" to make a difference because of their talk style. Underneath is just a system prompt, or more likely a prompt layered on top "You are a frontend engineer, competent in react and Next.js, tailwind-css" - the stack details and project layout, key information is already in the CLAUDE.md. For more stuff the model is goin…

I'm also skeptical partially because I don't like the huge essays generated by any llm. CLAUDE.md/AGENTS.md/README.md that are 5+ pages long are all equally bad imo. I prefer following the idea that if something is too verbose for me to want to get anything useful out of it, then the llm should behave similarly. Even if it's not true, why waste 2 paragraphs explaining something that could be explained in one short sentence?

My CLAUDE.md or AGENTS.md is usually just a bulleted list of reminders with high level information. If the agent needs more steering, I add more reminders. I try not to give it _too_ broad of a task without prior planning or it'll just go off the rails.

Something I haven't really experimented with is having claude generate ADRs [1] like your RFC/ idea. I'll probably try that and see how it goes.

[1]: https://adr.github.io/

Re: How to use Claude Code subagents to parallelize development

#102

Earlier quoted context omitted.

You don't need subagent, I shared this on ClaudeCode sub as well https://www.reddit.com/r/ClaudeCode/s/barbpBxG78 Subagents do not work well for coding at all

> Subagents do not work well for coding at all Subagents can work very well, especially for larger projects. Based on this statement, I think you're experiencing how I felt in my early experience with them, and that your mental model for how to use them effectively is still embryonic. I've found that the primary benefit for subagents is context/focus management. For example, I'm doing auth using Stytch. What I absolu…

I'm unsure if this also qualifies as incompetence/embryonic understanding, though I've used LLMs for hundreds of hours on development tasks and have also found that sub-agents are not good at programming. They're more suitable for research tasks to provide informed context to the parent agent while isolating it from the token consumption which retrieving that context cost.

Zooming out, my findings on LLMs with programming is that they work well in specific patterns and quickly go to shit when completely unsupervised by a SME.

  * Prototyping

  * Scaffolding (i.e. write an endpoint that does X that I'll refine into a sustainable implementation myself)

  * Questions on the codebase that require open-ended searching 
 
  * Specific programming questions (i.e. "How do I make an HTTP call in ___ ?")

  * Idea generation ("List three approaches for how you'd ____" or "How would you refactor this package to separate concerns?")
The LLMs all fuck up on something in every task that they perform due to the intersection of operating on assumptions and working on large problem spaces. The amount of effort it takes to completely eliminate the presence of assumptions in the agent make the process slower than writing the code yourself. So people try to find the balance they're comfortable with.

Re: How to use Claude Code subagents to parallelize development

#103

That sounds crazy to me, Claude Code has so many limitations. Last week I asked Claude Code to set up a Next.js project with internationalization. It tried to install a third party library instead of using the internationalization method recommended for the latest version of Next.js (using Next's middleware) and could not produce of functional version of the boilerplate site. There are some specific cases where agent…

I have seen it doing incredible stuff. One shotted adding a feature that included modifications to a proprietary backoffice system, db schema updates, defining new api models, implementing changes on the backend and then on the frontend.

I've also seen seen it choking when tasked to add a simple result count on a search.

The short answer is, it's cheap to let it try.

Re: How to use Claude Code subagents to parallelize development

#104

Earlier quoted context omitted.

You don't need subagent, I shared this on ClaudeCode sub as well https://www.reddit.com/r/ClaudeCode/s/barbpBxG78 Subagents do not work well for coding at all

> Subagents do not work well for coding at all Subagents can work very well, especially for larger projects. Based on this statement, I think you're experiencing how I felt in my early experience with them, and that your mental model for how to use them effectively is still embryonic. I've found that the primary benefit for subagents is context/focus management. For example, I'm doing auth using Stytch. What I absolu…

You didn't not bother reading my actual criticism against subagent model: https://www.reddit.com/r/ClaudeCode/s/weQIbVtAtG

Let me say it again, subagent model does not work for things which most developer do 90% of their time they want to implement a feature in their app.

Re: How to use Claude Code subagents to parallelize development

#105

I am sceptical if these persona based agents really make that much of a difference, and more "appear" to make a difference because of their talk style. Underneath is just a system prompt, or more likely a prompt layered on top "You are a frontend engineer, competent in react and Next.js, tailwind-css" - the stack details and project layout, key information is already in the CLAUDE.md. For more stuff the model is goin…

I'm also skeptical partially because I don't like the huge essays generated by any llm. CLAUDE.md/AGENTS.md/README.md that are 5+ pages long are all equally bad imo. I prefer following the idea that if something is too verbose for me to want to get anything useful out of it, then the llm should behave similarly. Even if it's not true, why waste 2 paragraphs explaining something that could be explained in one short se…

One of the main things I put in my instructions is "hey I'm a solo dev and it's just you and me working on this stuff, so I'm looking for all responses to be concise." I think it helps to give your situation so that the output can be in the proximity of "solo dev" content - which is going to be more concise and practical by nature.

Kind of like telling it to generate Ghibli pics. These things are best at imitation.

Re: How to use Claude Code subagents to parallelize development

#106

Earlier quoted context omitted.

> Subagents do not work well for coding at all Subagents can work very well, especially for larger projects. Based on this statement, I think you're experiencing how I felt in my early experience with them, and that your mental model for how to use them effectively is still embryonic. I've found that the primary benefit for subagents is context/focus management. For example, I'm doing auth using Stytch. What I absolu…

You didn't not bother reading my actual criticism against subagent model: https://www.reddit.com/r/ClaudeCode/s/weQIbVtAtG Let me say it again, subagent model does not work for things which most developer do 90% of their time they want to implement a feature in their app.

> You didn't not bother reading my actual criticism against subagent model:

Nope, I did. It's why I was under the impression that you hadn't yet figured out how to use them successfully. That's why I posted a specific example where a subagent is useful and why, hoping you and others might benefit from that.

If the subagent model does not work 90% of the time, why does the workflow model you recommend in another Reddit post you linked to specifically recommend delegating work to sub-agents throughout?

Re: How to use Claude Code subagents to parallelize development

#107

That sounds crazy to me, Claude Code has so many limitations. Last week I asked Claude Code to set up a Next.js project with internationalization. It tried to install a third party library instead of using the internationalization method recommended for the latest version of Next.js (using Next's middleware) and could not produce of functional version of the boilerplate site. There are some specific cases where agent…

I have seen it doing incredible stuff. One shotted adding a feature that included modifications to a proprietary backoffice system, db schema updates, defining new api models, implementing changes on the backend and then on the frontend. I've also seen seen it choking when tasked to add a simple result count on a search. The short answer is, it's cheap to let it try.

Is it cheap? It adds up really quickly. One shot at trying to build an iteration of a simple python app (And this is just the tip of the tip of the iceberg of what even a medium sized startup spends. This is not cheap in any way.

Re: How to use Claude Code subagents to parallelize development

#109
Fun little story I recently had using Subagents in Claude Code:

I was working on a large-ish R analysis. In R, people generally start with loading entire libraries like

library(a)

library(b)

etc., leading to namespace clashes. It's better practice to replace all calls to package-functions with package namespaces, i.e., it's better to do

a::function_a()

b::function_b()

than to load both libraries and then blindly trusting that function_a() and function_b() come from a and b.

I asked Claude Code to take a >1000 LOC R script and replace all function calls with their model-namespace function call. It ran one subagent to look for function calls, identified >40 packages, and then started one subagent per package call for >40 subagents. Cost-wise (and speed-wise!) it was mayhem as every subagent re-read the script. It was far faster and cheaper, but a bit harder to judge, to just copy paste the R script into regular Claude and ask it to carry out the same action. The lesson is that subagents are often costly overkill.

Re: How to use Claude Code subagents to parallelize development

#110
The biggest issue with sub-agents and even the CC Task tool is that they are black boxes, and we can’t see what’s going on inside them and cannot intervene. I’ve instead often found it better to leverage Tmux and have CC send messages to another CLI-agent (could be CC or the other now-surging CC, i.e., Codex-CLI, or of course any other competent CLI-agent) running in another pane. To make this smoother I built this Tmux-cli command that CC can use:

https://github.com/pchalasani/claude-code-tools/tree/main?ta...

If the first CLI-agent just needs a review or suggestions of approaches, I find it helps to have the first agent ask the other CLI-agent to dump its analysis into a markdown file which it can then look at.

Post reply on HN