Volver a PodcastsClaude
Claude Code subagents
Uso eficaz de los subagentes
You know how to create sub agents and design them well.
Ya sabes cómo crear sub agents y diseñarlos bien.
Now, let's cover when they actually help and when they get in the way.
Ahora veamos cuándo realmente ayudan y cuándo estorban.
Simply put, the difference comes down to whether the intermediate work matters to your main thread.
En pocas palabras, todo depende de si el trabajo intermedio importa a tu hilo principal.
When exploration is separate from execution, sub agents shine.
Cuando la exploración está separada de la ejecución, los sub agents destacan.
When each step depends on what the previous step discovered, well, information gets lost in the handoff process.
Cuando cada paso depende de los hallazgos del paso anterior, la información se pierde en el traspaso.
Sub agents excel at research tasks where you just need an answer, not the journey.
Los sub agents sobresalen en tareas de investigación donde solo necesitas una respuesta, no el recorrido.
Consider investigating how authentication works in an unfamiliar code base.
Imagina que investigas cómo funciona la autenticación en un código base desconocido.
Well, the main thread might need to know where is the JWT validated, but doesn't need to see every file that was searched.
El hilo principal solo necesita saber dónde se valida el JWT, no ver cada archivo consultado.
A research sub agent can read dozens of files, trace through function calls, and explore different code paths.
Un sub agent de investigación puede leer docenas de archivos, rastrear llamadas a funciones y explorar distintos caminos.
All that exploration stays in the sub agent's context.
Toda esa exploración permanece en el contexto del sub agent.
Your main thread receives JWT validation happens in middleware/auth.js at line 42, called from the Express router and route/api.js, or something like that.
Tu hilo principal recibe: la validación JWT ocurre en middleware/auth.js en la línea 42, llamado desde el enrutador Express y route/api.js, algo así.
Claude reviews work more effectively when the code is presented as being authored by someone else.
Claude revisa el trabajo más eficazmente cuando el código se presenta como escrito por alguien más.
If you build a feature over many turns with your main thread, asking the main thread to then review it often doesn't give the best feedback.
Si construyes una funcionalidad durante muchos turnos con tu hilo principal, pedirle luego que la revise normalmente no da el mejor resultado.
Claude was involved in creating it, so it has trouble seeing it with fresh eyes.
Claude participó en su creación, por lo que le cuesta verlo con ojos frescos.
A reviewer sub agent sees the changes in a separate context.
Un sub agent revisor ve los cambios en un contexto separado.
It runs get diff, reads the modified files, and applies its specialized review criteria without the history of how the code was written.
Ejecuta git diff, lee los archivos modificados y aplica sus criterios de revisión especializados sin el historial de cómo se escribió el código.
And this separation also lets you encode project-specific review standards in the sub agent system prompt, ensuring consistent review criteria across the team.
Esta separación también te permite codificar estándares de revisión específicos del proyecto en el system prompt del sub agent, garantizando criterios coherentes en todo el equipo.
Claude Code's default system prompt emphasizes concise, code-focused response.
El system prompt por defecto de Claude Code enfatiza respuestas concisas y centradas en código.
And this works great for coding, but not for everything.
Esto funciona genial para programar, pero no para todo.
So, one is a copywriting sub-agent with instructions about tone, audience, and style.
Por ejemplo, un sub agent de copywriting con instrucciones sobre tono, audiencia y estilo puede ser muy útil.
This will produce better marketing text than the main thread would.
Producirá mejor texto de marketing que el hilo principal.
Claude Code's default prompt tends towards concise, technical writing, which really isn't what you want for a landing page or email campaign, unless you want to put your customers to sleep.
El prompt por defecto de Claude Code tiende hacia la escritura técnica concisa, que no es lo que quieres para una página de destino o campaña de email, a menos que quieras aburrir a tus clientes.
A copywriting sub-agent can have completely different instructions about voice and structure.
Un sub agent de copywriting puede tener instrucciones completamente distintas sobre voz y estructura.
A styling sub-agent that at mentions your design system files will apply consistent CSS patterns.
Un sub agent de estilos que referencia tus archivos de sistema de diseño aplicará patrones CSS coherentes.
When the sub-agent runs, those files load into the context automatically, so it knows your color variables, spacing conventions, and component patterns before it even starts writing any CSS.
Cuando el sub agent se ejecuta, esos archivos se cargan automáticamente al contexto, así que ya conoce tus variables de color, convenciones de espaciado y patrones de componentes antes de escribir cualquier CSS.
Sub-agents that claim expertise rarely help.
Los sub agents que afirman tener experiencia rara vez ayudan.
Prompts like, "You are a Python expert." or "You are a Kubernetes specialist." add no value because Claude already has that knowledge.
Prompts como "Eres un experto en Python" o "Eres un especialista en Kubernetes" no aportan valor porque Claude ya tiene ese conocimiento.
The overhead of launching a sub-agent, losing visibility into its work, and compressing its findings into a summary only makes sense when the sub-agent does something that the main thread can't.
El costo de lanzar un sub agent, perder visibilidad sobre su trabajo y comprimir sus hallazgos en un resumen solo tiene sentido cuando hace algo que el hilo principal no puede.
Like applying a custom system prompt or keeping exploratory work isolated.
Como aplicar un system prompt personalizado o mantener el trabajo exploratorio aislado.
Sequential sub-agent pipelines create problems.
Los pipelines secuenciales de sub agents generan problemas.
Consider a three-agent flow.
Considera un flujo de tres agentes.
One to reproduce a bug, one to debug it, and one to fix it.
Uno para reproducir el bug, uno para depurarlo y uno para corregirlo.
Pipelines work when tasks are truly independent.
Los pipelines funcionan cuando las tareas son verdaderamente independientes.
They fail when each step depends on discoveries from the previous step.
Fallan cuando cada paso depende de los hallazgos del paso anterior.
Test runner sub-agents tend to hide information you need.
Los sub agents ejecutores de tests tienden a ocultar la información que necesitas.
When tests fail, you want the full output to diagnose issues.
Cuando los tests fallan, necesitas la salida completa para diagnosticar los problemas.
A sub-agent that returns a test failed forces you to create additional debug scripts to get details that would have been visible in direct output.
Un sub agent que solo devuelve "test fallido" te obliga a crear scripts de depuración adicionales para obtener detalles que habrían sido visibles en la salida directa.
Testing has showed that the test runner pattern performed worse among all configurations.
Las pruebas mostraron que el patrón ejecutor de tests tuvo el peor rendimiento entre todas las configuraciones.
Across the series, we covered how sub-agents work as isolated threads that return summaries.
A lo largo de la serie, vimos cómo los sub agents funcionan como hilos aislados que devuelven resúmenes.
How to create them with the /agents command, and how to design them with structured outputs and specific descriptions.
Cómo crearlos con el comando /agents, y cómo diseñarlos con salidas estructuradas y descripciones específicas.
Use them for research, reviews, and tasks needing custom system prompts.
Úsalos para investigación, revisiones y tareas que requieran system prompts personalizados.
But, avoid them for expert claims, multi-step pipelines, and test runners.
Pero evítalos para afirmaciones de expertise, pipelines de múltiples pasos y ejecutores de tests.
The key question, does the intermediate work matter?
La pregunta clave: ¿importa el trabajo intermedio?
If not, then delegate it.
Si no, entonces delégalo.