Podcasts पर वापस जाएंClaude
Claude Code subagents
सबएजेंट बनाना
In the previous video, we covered what sub aents are and how they work.
पिछले वीडियो में, हमने देखा कि sub-agents क्या होते हैं और वे कैसे काम करते हैं।
Cloud code includes built-in sub aents, but you can also create your own sub aents that specialize in certain tasks.
Claude Code में built-in sub-agents शामिल हैं, लेकिन आप अपने खुद के sub-agents भी बना सकते हैं जो विशेष कार्यों में माहिर हों।
Custom sub aents are markdown files with YAML front matter.
Custom sub-agents YAML front matter के साथ Markdown फ़ाइलें होती हैं।
These markdown files contain configuration that helps claude understand when to use the sub aent and provides directions to the sub aent itself.
इन Markdown फ़ाइलों में ऐसी configuration होती है जो Claude को यह समझने में मदद करती है कि sub-agent का उपयोग कब करना है और sub-agent को खुद निर्देश देती है।
Now, the easiest way to create a sub agent is with the / agents command.
Sub-agent बनाने का सबसे आसान तरीका /agents कमांड है।
This panel is the main interface for managing your sub aents.
यह पैनल आपके sub-agents प्रबंधित करने का मुख्य इंटरफ़ेस है।
Once here, select create new agent.
यहाँ, Create New Agent चुनें।
You'll then be asked if you want to create a sub aent for the current project or a sub aent that will be shared between all the projects on your machine.
आपसे पूछा जाएगा कि क्या आप मौजूदा project के लिए sub-agent बनाना चाहते हैं या एक ऐसा sub-agent जो आपकी मशीन के सभी projects में shared हो।
Next, you can create a sub aent manually, but we recommend using claw code to automatically generate it for you.
आप sub-agent manually बना सकते हैं, लेकिन हम Claude Code का उपयोग करके इसे automatically generate करने की सलाह देते हैं।
Our first sub aent will be a code reviewer.
हमारा पहला sub-agent एक code reviewer होगा।
I'll ask Claude to make a sub agent that reviews code quality and security issues.
मैं Claude से एक ऐसा sub-agent बनाने के लिए कहूँगा जो code quality और security issues की समीक्षा करे।
Claude will use your input to generate a name, description, and system prompt for the sub agent.
Claude आपके input का उपयोग करके sub-agent के लिए एक नाम, description और system prompt generate करेगा।
We'll see those in a moment, but before we do, we get the opportunity to customize the tools that this sub agent has access to.
हम उन्हें थोड़ी देर में देखेंगे, लेकिन उससे पहले हमें उन tools को customize करने का मौका मिलता है जिन तक यह sub-agent पहुँच सकता है।
Now, given that our sub agent is only responsible for reviewing code, you might decide to disallow tools for editing, but I'll leave an execution to allow the sub agent to more easily identify pending changes.
चूँकि हमारा sub-agent केवल code review के लिए है, आप editing tools को disallow करना चाह सकते हैं, लेकिन मैं sub-agent को pending changes आसानी से पहचानने देने के लिए execution को रहने दूँगा।
Next, you'll be prompted to select the model that powers this sub agent.
इसके बाद, आपसे उस model को चुनने के लिए कहा जाएगा जो इस sub-agent को power करेगा।
And finally, a color.
और अंत में, एक रंग।
This color is used in the UI to help you better identify the sub agent.
इस रंग का उपयोग UI में sub-agent को बेहतर ढंग से पहचानने में मदद के लिए किया जाता है।
And it also just adds a little bit of personal flare.
और यह थोड़ी personal पहचान भी जोड़ता है।
Now at the summary window, we see that the sub aent config file will be saved into my current project at this path.
Summary window पर, हम देखते हैं कि sub-agent config file इस path पर मेरे current project में save होगी।
Now let's open up that file to get a better idea of what's going on.
अब चलिए उस file को खोलते हैं ताकि बेहतर समझ सकें कि क्या हो रहा है।
The name field is a unique identifier.
Name field एक unique identifier है।
This is how you reference the sub agent either by asking claw directly or using at agent code quality reviewer in your message.
इस प्रकार आप sub-agent को reference करते हैं, चाहे Claude से directly पूछें या अपने message में @agent code quality reviewer का उपयोग करें।
The description controls when cla decides to use the sub aent.
Description यह नियंत्रित करती है कि Claude sub-agent का उपयोग कब करे।
The description must be on a single line.
Description एक ही line पर होनी चाहिए।
Notice that there are escaped new line characters in there.
ध्यान दें कि वहाँ escaped new line characters हैं।
If you want Claude to use the sub agent automatically more often, add in the word proactively to the description.
यदि आप चाहते हैं कि Claude sub-agent का उपयोग अधिक बार automatically करे, तो description में proactively शब्द जोड़ें।
You can also add example conversations to help Claude understand when it should be using the sub agent.
आप example conversations भी जोड़ सकते हैं जिससे Claude को समझने में मदद मिले कि sub-agent का उपयोग कब करना चाहिए।
The tools field lists which tools the sub agent can access.
Tools field यह सूचीबद्ध करती है कि sub-agent किन tools तक पहुँच सकता है।
The list of tools will match the tools we granted access to during the agent generation, but you can further edit the list of tools in this file if you want.
Tools की सूची agent generation के दौरान दी गई access से मेल खाएगी, लेकिन आप चाहें तो इस file में tools की सूची आगे edit कर सकते हैं।
The model field specifies which claw model to use.
Model field यह specify करता है कि कौन सा Claude model उपयोग करना है।
Sonnet, opus, haiku or inherit.
Sonnet, Opus, Haiku या inherit।
Use haiku for fast tasks.
तेज़ कार्यों के लिए Haiku उपयोग करें।
Opus for complex analysis and sonnet if you need something between the two.
जटिल विश्लेषण के लिए Opus और दोनों के बीच कुछ चाहिए तो Sonnet।
Inherit will use the same model as your main conversation.
Inherit आपकी main conversation के समान model उपयोग करेगा।
The body of the file contains the system prompt that is given to the sub aent.
File का body sub-agent को दिया गया system prompt होता है।
The system prompt will provide guidance to the sub agent, helping it understand how to complete its task and how it should return information back to the main agent.
System prompt sub-agent को guidance देता है, जिससे वह समझ सके कि अपना कार्य कैसे पूरा करना है और main agent को जानकारी कैसे लौटानी है।
Now for the fun part.
अब मज़ेदार हिस्सा।
After creating your sub agent, test it by making some code changes and asking claw to review them.
Sub-agent बनाने के बाद, कुछ code changes करके Claude से review करने को कहकर उसे test करें।
If the sub agent isn't being used when you expect, check your description.
यदि sub-agent तब उपयोग नहीं हो रहा जब आप उम्मीद करते हैं, तो अपनी description जाँचें।
Adding more specific examples helps Claude understand when to delegate.
अधिक specific examples जोड़ने से Claude को यह समझने में मदद मिलती है कि कब delegate करना है।