आप 15 मिनट से भी कम समय में एक कोड रिव्यूअर, टेस्ट राइटर, सिक्योरिटी स्कैनर या डॉक्यूमेंटेशन जनरेटर बना सकते हैं।
हर एक एक मार्कडाउन फ़ाइल है जिसमें ऊपर निर्देश और नीचे एक प्रॉम्प्ट होता है।
जो कार्य आप हर दिन मैन्युअल करते हैं, वे अपने आप चलने लगते हैं।
यहाँ 5 रेडी-टू-यूज़ टेम्पलेट हैं जिन्हें आप अभी कॉपी कर सकते हैं 👇

एक सबएजेंट वास्तव में क्या है (30 सेकंड)
सबएजेंट एक अलग Claude इंस्टेंस है जो आपके सेशन के अंदर चलता है। इसे अपना खुद का कॉन्टेक्स्ट विंडो मिलता है, यह एक फ़ोकस्ड कार्य करता है, और केवल सारांश वापस भेजता है।
आपका मुख्य सेशन साफ़ रहता है।
सबएजेंट के बिना: Claude 40 फ़ाइलें पढ़ता है, पैटर्न खोजता है, कोड जनरेट करता है, उसकी समीक्षा करता है, सभी एक ही कॉन्टेक्स्ट में टेस्ट चलाता है। मैसेज 20 तक यह ऑटोकम्पैक्ट कर रहा होता है और चीज़ें भूल जाता है।
सबएजेंट के साथ: मुख्य सेशन "इस कोड की समीक्षा करें" को एक रिव्यूअर सबएजेंट को सौंप देता है। रिव्यूअर अपने कॉन्टेक्स्ट में काम करता है, "3 समस्याएं मिलीं" लौटाता है, और मुख्य सेशन बिना शोर के जारी रहता है।
इन्हें कहाँ रखें: ~/.claude/agents/ → हर प्रोजेक्ट में उपलब्ध (व्यक्तिगत) .claude/agents/ → केवल इस प्रोजेक्ट में (git के ज़रिए टीम के साथ साझा किया जाता है)

एक सबएजेंट फ़ाइल की संरचना
हर सबएजेंट एक मार्कडाउन फ़ाइल है जिसके शीर्ष पर YAML फ्रंटमैटर होता है:
1---2name: agent-name3description: When to use this agent. Be specific.4model: claude-sonnet-4-5-202509295tools:6 - Read7 - Grep8 - Glob9 - Bash10---1112You are a [role]. Your job is to [specific task].1314When invoked:151. Do [step 1]162. Do [step 2]173. Return [specific output format]
name — जिसे आप @agent-name से कॉल करते हैं
description — Claude यह तय करने के लिए पढ़ता है कि कब ऑटो-डेलिगेट करना है। इसे ट्रिगर शर्तों की तरह लिखें: "इस एजेंट का उपयोग तब करें जब उपयोगकर्ता कोड समीक्षा के लिए कहे"
model — फ़ोकस्ड कार्यों के लिए Sonnet पर रूट करें (Opus से 5 गुना सस्ता)
tools — यह सीमित करें कि एजेंट क्या एक्सेस कर सकता है। रिव्यूअर के लिए केवल पढ़ना, लेखकों के लिए पूर्ण एक्सेस।
फ्रंटमैटर के नीचे का मार्कडाउन भाग सिस्टम प्रॉम्प्ट है। यहाँ आप एजेंट को बताते हैं कि वास्तव में कैसे व्यवहार करना है।
टेम्पलेट 1: कोड रिव्यूअर (5 मिनट)
.claude/agents/reviewer.md बनाएँ:
1---2name: reviewer3description: Expert code review. Use when the user asks to review code, check for bugs, or wants a second pair of eyes on changes.4model: claude-sonnet-4-5-202509295tools:6 - Read7 - Grep8 - Glob9 - Bash10---1112You are a senior code reviewer. Your job is to find bugs, security issues, and quality problems.1314When invoked:151. Run `git diff HEAD~1` to see recent changes162. Read the modified files completely173. Check for:18 - Logic errors and off-by-one mistakes19 - Missing null/undefined checks20 - Security issues (hardcoded secrets, injection, XSS)21 - Performance problems (N+1 queries, blocking calls)22 - Naming and readability issues2324Output format:25## Review Summary26[1-2 sentence overview]2728## Issues Found29**CRITICAL:** [issues that will cause bugs in production]30**WARNING:** [issues that should be fixed before merge]31**INFO:** [style and readability suggestions]3233If no issues found, say "Code looks good" and explain why.34Do NOT suggest changes that aren't improvements.
इसका उपयोग करें:
1check the last commit@reviewer
या जब आप "इस कोड की समीक्षा करें" कहते हैं तो Claude अपने आप डेलिगेट कर देता है।
टेम्पलेट 2: टेस्ट राइटर (5 मिनट)
.claude/agents/test-writer.md बनाएँ:
1---2name: test-writer3description: Write tests for code. Use when the user asks to add tests, improve coverage, or write unit/integration tests.4model: claude-sonnet-4-5-202509295tools:6 - Read7 - Grep8 - Glob9 - Write10 - Bash11---1213You are a test engineer. Your job is to write thorough tests that match the existing test style in the project.1415When invoked:161. Find existing tests in the project to match framework, imports, and assertion style172. Read the file or module to be tested183. Write tests covering:19 - Happy path with expected inputs20 - Edge cases: empty, null, zero, max values21 - Error cases: invalid inputs, timeouts, missing data22 - Async behavior if applicable234. Run the tests: `npm test` or equivalent245. Fix any failures before returning2526Output only the test file path and a summary of what's covered.27Do NOT change the source code, only write tests.
इसका उपयोग करें:
1-writer write tests for src/lib/auth/session.ts@test
टेम्पलेट 3: डॉक्यूमेंटेशन जनरेटर (5 मिनट)
.claude/agents/doc-writer.md बनाएँ:
1---2name: doc-writer3description: Generate documentation. Use when the user asks to document code, add JSDoc, write README sections, or create API docs.4model: claude-sonnet-4-5-202509295tools:6 - Read7 - Grep8 - Glob9 - Write10---1112You are a documentation specialist. Your job is to write clear, concise documentation that matches the project's existing style.1314When invoked:151. Read the files or module to document162. Check for existing documentation style in the project173. For functions: add description, params with types, return value, example usage184. For complex logic: add inline comments explaining WHY, not WHAT195. For APIs: document method, path, request/response shapes, auth requirements2021Rules:22- Match the existing documentation style exactly23- Be concise. Skip self-explanatory code.24- Never change functionality, only add documentation25- If the code is unclear, document what it does AND flag it for refactoring
इसका उपयोग करें:
1-writer document the entire src/api/ folder@doc
टेम्पलेट 4: सिक्योरिटी स्कैनर (5 मिनट)
.claude/agents/security.md बनाएँ:
1---2name: security3description: Security audit. Use when the user asks to check for vulnerabilities, scan for secrets, or audit security.4model: claude-sonnet-4-5-202509295tools:6 - Read7 - Grep8 - Glob9 - Bash10---1112You are a security engineer. Your job is to find vulnerabilities in the codebase.1314When invoked:151. Scan for hardcoded secrets:16 `grep -rn "sk-\|api_key\|password\|secret\|token" --include="*.ts" --include="*.js" --include="*.py" . | grep -v node_modules | grep -v ".env.example"`172. Check for SQL injection (string concatenation in queries)183. Check for XSS (unsanitized user input in HTML)194. Check for missing auth on protected routes205. Run `npm audit` or equivalent for dependency vulnerabilities216. Check if .env files or secrets are in .gitignore2223Output format:24## Security Report2526**CRITICAL:** [exploitable vulnerabilities]27**HIGH:** [serious issues to fix before deploy]28**MEDIUM:** [should be fixed soon]29**LOW:** [best practices not followed]3031For each issue: file, line, what's wrong, how to fix it.32Do NOT fix issues, only report them.
इसका उपयोग करें:
1scan the entire codebase@security
टेम्पलेट 5: PR विवरण लेखक (5 मिनट)
.claude/agents/pr-writer.md बनाएँ:
1---2name: pr-writer3description: Write PR descriptions. Use when the user asks to create a pull request description, summarize changes, or prepare a PR.4model: claude-sonnet-4-5-202509295tools:6 - Read7 - Grep8 - Glob9 - Bash10---1112You are a PR description specialist. Your job is to write clear, structured PR descriptions ready to paste into GitHub.1314When invoked:151. Run `git log main..HEAD --oneline` for commit list162. Run `git diff main...HEAD --stat` for changed files173. Read the key changed files to understand context1819Output exactly this format:2021## What22[One paragraph: what this PR does]2324## Why25[One paragraph: why this change is needed]2627## Changes28[Bullet list grouped by area]2930## Testing31[How this was tested]3233Nothing else. Ready to paste into GitHub.
इसका उपयोग करें:
1-writer summarize changes on this branch@pr
सबएजेंट को कैसे इनवोक करें
तीन तरीके:
11. @ उल्लेख (सबसे भरोसेमंद):2 @reviewer check the last commit3 @test-writer write tests for auth.ts4 @security scan src/562. ऑटो-डेलिगेशन (Claude description फ़ील्ड पढ़ता है):7 "review this code" → Claude अपने आप @reviewer चुनता है8 "write tests" → Claude अपने आप @test-writer चुनता है9103. /agents कमांड (प्रबंधित करें और ब्राउज़ करें):11 /agents → एजेंट लाइब्रेरी खुलती है12 Running टैब → सक्रिय सबएजेंट देखें13 Library टैब → एजेंट ब्राउज़ करें, बनाएँ, संपादित करें
ऑटो-डेलिगेशन के काम करने के लिए, description फ़ील्ड को विशिष्ट बनाएं। "इस एजेंट का उपयोग तब करें जब उपयोगकर्ता कोड समीक्षा के लिए कहे" काम करता है। "कोड सामान" काम नहीं करता।
लागत का गणित
प्रत्येक सबएजेंट अपने खुद के कॉन्टेक्स्ट विंडो में चलता है। इसका मतलब टोकन हैं। लेकिन इसका यह भी मतलब है कि आपका मुख्य सेशन हल्का रहता है।
1Without subagents:2- One session does everything3- Context bloats to 200K+ tokens by message 204- Every subsequent message costs more5- Autocompact loses important context67With subagents:8- Main session stays at ~30K tokens9- Each subagent uses ~15-20K tokens in isolation10- Summaries return to main session (500 tokens)11- Total tokens might be similar but quality is higher12- Route subagents to Sonnet → 5x cheaper per agent
असली बचत: सबएजेंट को Sonnet पर रूट करना जबकि आपका मुख्य सेशन Opus पर चलता है।
1# In your environment config export CLAUDE_CODE_SUBAGENT_MODEL="claude-sonnet-4-5-20250929"
कहाँ से शुरू करें
एक टेम्पलेट कॉपी करें। कोई भी एक। इसे .claude/agents/ में डालें। एक बार उपयोग करें।
यदि आप केवल एक ही आज़माना चाहते हैं: reviewer से शुरू करें। अपने अगले कोड परिवर्तन के बाद @reviewer check the last commit टाइप करें। आप कभी भी स्व-समीक्षा पर वापस नहीं जाएंगे।
पढ़ने के लिए धन्यवाद!






