Skip to contentমূল লেখায় যান

Part 11পর্ব 11 · Extend

Subagents

A subagent is a specialist that works in its own context and sends back only a summary. This page shows how to define a qa-agent and an sdet-agent that can really reach Jira and your test database, how to call them, and how to split testing work across several of them.

11 min read11 মিনিটে পড়া যায় · 8 sections8টি সেকশন · 5 sources5টি সোর্স · updated Nov 2026আপডেট: Nov 2026

Subagents work apart and report backসাবএজেন্ট আলাদা কাজ করে, রিপোর্ট ফেরত দেয়

Send three qa-agents out in parallel and see only short reports reach the main chat.তিনটা qa-agent সমান্তরালে পাঠান আর দেখুন main chat-এ শুধু ছোট রিপোর্ট পৌঁছায়।

2 min2 মিনিট7 steps7টি ধাপ
  • Runningচলছে0 / 20
  • Main context (tokens)মূল কনটেক্সট (টোকেন)2000
Mainমূলconversationকথোপকথনtask: 3 filesকাজ: 3 ফাইলqa-agentqa-agentlogin.jslogin.jsqa-agentqa-agenttoken.jstoken.jsqa-agentqa-agentsession.jssession.jsmain context 2000মূল কনটেক্সট 2000their reads 0ওদের পড়া 0running 0 / 20চলছে 0 / 20limit 20সীমা 20

You’ll learnআপনি শিখবেন

  • A subagent works in its own contextsubagent নিজের কনটেক্সটে কাজ করে
  • Only a short report reaches the main chatmain chat-এ শুধু ছোট রিপোর্ট পৌঁছায়
  • Nesting goes three layers deep by defaultডিফল্টে নেস্টিং তিন স্তর পর্যন্ত
  • At most 20 subagents run at onceএকসাথে সর্বোচ্চ 20টি subagent চলে

What a subagent is

A subagent is a specialized assistant. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. Source 1সোর্স 1

  • Use a subagent when a side task would flood your main conversation with search results, logs, or file contents that you will not need again. Source 1সোর্স 1 Examples: a long test run, a large log file, a sweep of a test folder.
  • A subagent gets only its own system prompt plus basic environment details, such as the working directory. It does not get the Claude Code system prompt. Source 1সোর্স 1
  • Its requests count toward the same usage limits as your main conversation. Source 1সোর্স 1
  • Use the main conversation instead when the task needs frequent back-and-forth or step-by-step refinement. Source 1সোর্স 1

Built-in subagents

SubagentUse
ExploreRead-only Source 1সোর্স 1
PlanRead-only research in plan mode Source 1সোর্স 1
general-purposeAll tools Source 1সোর্স 1

Claude Code also has helper subagents: claude, statusline-setup, claude-code-guide, and web-fetch. Source 1সোর্স 1 Explore and Plan skip your CLAUDE.md files and the git status snapshot. Every other subagent loads both. Source 1সোর্স 1

সহজ English

A subagent is a helper assistant with a special job. Each subagent works in its own context window. It has its own system prompt, its own tools, and its own permissions. Source 1সোর্স 1

  • Use a subagent for a side task that makes a lot of output that you will not need again, such as search results, logs, or file contents. Source 1সোর্স 1 Examples are a long test run, a large log file, or a sweep of a test folder.
  • A subagent gets only its own system prompt and some basic details, such as the working directory. It does not get the Claude Code system prompt. Source 1সোর্স 1
  • The requests of a subagent count toward the same usage limits as your main conversation. Source 1সোর্স 1
  • If the task needs frequent back-and-forth or step-by-step changes, use the main conversation. Source 1সোর্স 1

Claude Code has 3 built-in subagents: Explore (read-only), Plan (read-only research in plan mode), and general-purpose (all tools). Source 1সোর্স 1 It also has the helper subagents claude, statusline-setup, claude-code-guide, and web-fetch. Source 1সোর্স 1 Explore and Plan do not load your CLAUDE.md files or the git status snapshot. All other subagents load both. Source 1সোর্স 1

বাংলা ব্যাখ্যা

Subagent হলো একটি বিশেষ কাজের assistant। প্রতিটি subagent নিজের context window-এ চলে। এর নিজের custom system prompt, নির্দিষ্ট tool access এবং আলাদা permission থাকে। Source 1সোর্স 1

  • কোনো পাশের কাজ যদি আপনার main conversation-কে search result, log বা file content দিয়ে ভরে দেয়, আর সেগুলো আপনার আর না লাগে, তখন subagent ব্যবহার করুন। Source 1সোর্স 1 যেমন: একটি লম্বা test run, একটি বড় log file, বা একটি test folder পুরোটা দেখা।
  • Subagent শুধু নিজের system prompt আর working directory-এর মতো কিছু basic environment তথ্য পায়। এটি Claude Code system prompt পায় না। Source 1সোর্স 1
  • এর request-গুলো আপনার main conversation-এর একই usage limit-এর মধ্যে গোনা হয়। Source 1সোর্স 1
  • কাজে যদি বারবার আলোচনা বা ধাপে ধাপে refinement লাগে, তাহলে main conversation-ই ব্যবহার করুন। Source 1সোর্স 1

Built-in subagent তিনটি: Explore (read-only), Plan (plan mode-এ read-only research) এবং general-purpose (সব tool)। Source 1সোর্স 1 এ ছাড়া helper subagent আছে: claude, statusline-setup, claude-code-guide এবং web-fetch। Source 1সোর্স 1 Explore আর Plan আপনার CLAUDE.md file এবং git status snapshot load করে না। বাকি সব subagent দুটোই load করে। Source 1সোর্স 1

Create a subagent

A subagent is a Markdown file with YAML frontmatter. The body of the file is the subagent's system prompt. Source 1সোর্স 1

LocationScopePriority
Managed settingsOrganization1 (highest) Source 1সোর্স 1
--agents CLI flagCurrent session2 Source 1সোর্স 1
.claude/agents/Current project3 Source 1সোর্স 1
~/.claude/agents/All your projects4 Source 1সোর্স 1
Plugin agents/ folderWhere the plugin is enabled5 (lowest) Source 1সোর্স 1

Common mistake: creating subagents with /agents

In current versions, /agents only prints a reminder to ask Claude or to edit .claude/agents/ and ~/.claude/agents/ directly. The interactive wizard existed in Claude Code v2.1.197 and earlier. Source 1সোর্স 1 Source 2সোর্স 2 The shell command claude agents is a different tool: it opens agent view, to monitor and dispatch parallel background sessions. Source 3সোর্স 3 To create a subagent, ask Claude to write the file, or write it yourself.

সহজ English

A subagent is a file that tells Claude how to act as a helper. The text in the file body is its instructions. Source 1সোর্স 1

Claude Code looks for these files in five places. The first has the highest priority:

  1. Managed settings Source 1সোর্স 1
  2. The --agents CLI flag Source 1সোর্স 1
  3. .claude/agents/ Source 1সোর্স 1
  4. ~/.claude/agents/ Source 1সোর্স 1
  5. The agents/ folder of a plugin Source 1সোর্স 1

বাংলা ব্যাখ্যা

Subagent হলো YAML frontmatter-সহ একটি Markdown file। File-এর body-টিই subagent-এর system prompt। Source 1সোর্স 1 File রাখার 5টি জায়গা আছে। সবচেয়ে বেশি priority থেকে সবচেয়ে কম: managed settings, --agents CLI flag, .claude/agents/, ~/.claude/agents/ এবং plugin-এর agents/ folder। Source 1সোর্স 1

  • .claude/agents/ commit করুন, যাতে পুরো QA team একই subagent ব্যবহার করে। Source 1সোর্স 1
  • শুধু name আর description বাধ্যতামূলক। এর কোনো একটি না থাকলে Claude Code file-টি কোনো message ছাড়াই skip করে। কারণ দেখতে --debug দিয়ে চালান। Source 1সোর্স 1
  • এখনকার version-এ /agents শুধু একটি reminder দেখায়। Source 1সোর্স 1 Source 2সোর্স 2 Subagent বানাতে Claude-কে file-টি লিখতে বলুন, অথবা নিজেই লিখুন।

Tools and MCP access

Don'tকরবেন না: Built-in tools only, then MCP calls in the body

tools: Read, Grep, Glob, Bash

The body tells the agent to read Jira and query the database. With this tools list, the subagent cannot use any MCP tools. Source 1সোর্স 1

Doকরুন: Name the MCP servers in tools

tools: Read, Grep, Glob, mcp__atlassian

mcp__atlassian allows every tool of the server named atlassian. Source 1সোর্স 1 Or omit tools to inherit all tools. Source 1সোর্স 1

To give a subagent an MCP server that the main conversation does not have, define the server inline in mcpServers. The server connects when the subagent starts and disconnects when it finishes. Its tool descriptions do not use context in the main conversation. Source 1সোর্স 1 Example: a browser-testing subagent with the Playwright server values from the docs. Source 1সোর্স 1

mcpServers:
  - playwright:
      type: stdio
      command: npx
      args: ["-y", "@playwright/mcp@latest"]

Permissions and autonomy

  • permissionMode takes default, acceptEdits, auto, dontAsk, bypassPermissions, plan, or manual (an alias for default). Source 1সোর্স 1
  • If the main conversation is in bypassPermissions, acceptEdits, or auto mode, the subagent runs in that same mode. Claude Code ignores the subagent's permissionMode. Source 1সোর্স 1
  • A subagent runs in bypassPermissions only when the main conversation does (v2.1.267 or later). Source 1সোর্স 1 So a subagent file cannot raise its own autonomy above yours.

The Permission Modes page explains each mode.

Memory

memory gives a subagent its own memory folder. The value sets the scope: Source 1সোর্স 1

ValueFolder
user~/.claude/agent-memory/<name>/ Source 1সোর্স 1
project.claude/agent-memory/<name>/ Source 1সোর্স 1
local.claude/agent-memory-local/<name>/ Source 1সোর্স 1

With memory on, Claude Code enables the Read, Write, and Edit tools automatically, so the subagent can manage its memory files. The first 200 lines or 25KB of its MEMORY.md load into its prompt. Source 1সোর্স 1 The CLAUDE.md & Memory page covers memory in general.

সহজ English

বাংলা ব্যাখ্যা

  • tools হলো একটি allowlist। এটি না দিলে subagent-দের জন্য available সব tool subagent পায়, main conversation-এর MCP tool-সহ। Source 1সোর্স 1 tools-এ শুধু built-in tool থাকলে subagent কোনো MCP tool ব্যবহার করতে পারে না। একটি MCP server দিতে tools-এ mcp__<server> লিখুন। Source 1সোর্স 1
  • disallowedTools হলো একটি denylist। Source 1সোর্স 1
  • Main conversation bypassPermissions-এ থাকলেই কেবল subagent bypassPermissions-এ চলে (v2.1.267 বা পরের version)। Source 1সোর্স 1 তাই একটি subagent file নিজের autonomy আপনার চেয়ে বেশি বাড়াতে পারে না।
  • memory subagent-কে নিজের একটি memory folder দেয়, এবং Read, Write ও Edit tool চালু করে। Source 1সোর্স 1

The qa-agent and the sdet-agent

These two subagents are this tutorial's examples. They use the six example skills from Skills & Commands, the Jira server named atlassian, and a read-only database server named db from MCP Servers.

Don'tকরবেন না: Old form

  • tools: Read, Grep, Glob, Bash, but the body calls Jira and database MCP tools. The subagent cannot use any MCP tools. Source 1সোর্স 1
  • A "Skill Usage (MANDATORY)" table tells the agent to read each SKILL.md by hand.
  • The qa-agent "delegates" to the sdet-agent, but Agent is not in its tools list, so it cannot spawn a subagent. Source 1সোর্স 1

Doকরুন: Current form

Example: .claude/agents/qa-agent.md

---
name: qa-agent
description: Senior QA engineer. Analyzes requirements and Jira tickets, finds likely bugs, and designs test cases. Use proactively when the user shares a ticket, a diff, or a feature to test.
tools: Read, Grep, Glob, mcp__atlassian
skills:
  - analyze-requirement
  - find-bug
  - analyze-security
model: sonnet
memory: project
---

You are a senior QA engineer. Scope: sanity testing of the critical path,
high-risk operations, and nearby impact. Not a full regression.

## How to work
- Jira key: read the ticket, then analyze the requirement.
- File or diff: find bugs, then design test cases if behavior changed.
- Auth, payment, or personal data: also review security.

## Rules
- Use real data from the ticket and the code. State your assumptions.
- Do not explain code in depth. Prefer fewer, high-quality findings.

The qa-agent does not preload test-design. That skill sets disable-model-invocation: true, and such skills cannot be preloaded. Source 1সোর্স 1 Run /test-design yourself after the bug review.

Example: .claude/agents/sdet-agent.md

---
name: sdet-agent
description: Senior SDET. Explains code flow, finds the root cause of failures from logs and errors, and reviews security risks. Use proactively when the user pastes a stack trace or a log.
tools: Read, Grep, Glob, Bash, mcp__db
skills:
  - explain-code
  - analyze-rootcause
  - analyze-security
model: sonnet
maxTurns: 30
---

You are a senior SDET.

## How to work
- File or commit: explain the code flow.
- Log or error: read the log, check the data with the database server,
  and rank the likely root causes.
- Security question: review the code for real, exploitable issues.

## Rules
- Do not write test cases. State your assumptions.

সহজ English

The 2 example subagents, the qa-agent and the sdet-agent, use the 6 example skills from Skills & Commands, the Jira server atlassian, and a read-only database server db.

The old form of these agents had 3 problems:

  • The tools list had only built-in tools, so the agent could not use the Jira and database MCP tools. Source 1সোর্স 1
  • A table told the agent to read each SKILL.md by hand.
  • The qa-agent did not have Agent in tools, so it could not start the sdet-agent. Source 1সোর্স 1

In the current form, tools names the MCP servers, and skills: loads the full skill content when the agent starts. Source 1সোর্স 1 The main conversation calls each subagent.

  • The qa-agent cannot preload the test-design skill, because that skill sets disable-model-invocation: true. Source 1সোর্স 1 Run /test-design yourself after the bug review.
  • With memory: project, the qa-agent also gets Write and Edit. Source 1সোর্স 1 If the agent must stay read-only, remove memory.
  • Point the db server at a read-only database user.

বাংলা ব্যাখ্যা

এই tutorial-এ দুটি example subagent আছে: qa-agent আর sdet-agent। এরা Skills & Commands-এর ছয়টি example skill, atlassian নামের Jira server এবং db নামের একটি read-only database server ব্যবহার করে।

পুরোনো form-এ তিনটি সমস্যা ছিল:

  • tools-এ শুধু built-in tool ছিল, তাই agent Jira আর database-এর MCP tool ব্যবহার করতে পারত না। Source 1সোর্স 1
  • একটি table agent-কে প্রতিটি SKILL.md হাতে পড়তে বলত।
  • qa-agent-এর tools-এ Agent ছিল না, তাই এটি sdet-agent-কে spawn করতে পারত না। Source 1সোর্স 1

এখনকার form-এ tools-এ MCP server-এর নাম থাকে, আর skills: startup-এ পুরো skill content আগে থেকেই load করে। Source 1সোর্স 1 Main conversation প্রতিটি subagent-কে call করে।

  • qa-agent Jira ticket ও requirement analyze করে, bug খোঁজে এবং test case design করে। sdet-agent code flow ব্যাখ্যা করে এবং log ও error থেকে failure-এর root cause খোঁজে।
  • qa-agent test-design skill preload করে না, কারণ ওই skill disable-model-invocation: true set করে, আর এমন skill preload করা যায় না। Source 1সোর্স 1 Bug review-এর পরে /test-design নিজে চালান।
  • maxTurns-এর মান যত, তত agentic turn-এর পরে subagent থামিয়ে দেয়। Source 1সোর্স 1
  • memory: project থাকলে qa-agent Write আর Edit tool-ও পায়। Source 1সোর্স 1 Agent-কে read-only রাখতে হলে memory সরিয়ে দিন।
  • db server-টি একটি read-only database user-এর দিকে point করুন।

Call a subagent

Claude delegates on its own. It matches your request to the description of each subagent. A phrase such as "use proactively" in the description encourages delegation. Source 1সোর্স 1

There are three ways to call a subagent yourself: Source 1সোর্স 1

  1. Name it in your prompt. For example: Use the qa-agent to find bugs in src/payment.js.

  2. @-mention it. An @-mention makes sure that this subagent runs. Source 1সোর্স 1 The docs show this form: Source 1সোর্স 1

    @"code-reviewer (agent)" look at the auth changes

    You can also type @agent-<name>, for example @agent-qa-agent. Source 1সোর্স 1

  3. Run the whole session as the agent. Source 1সোর্স 1

    claude --agent sdet-agent

    The main thread then uses that agent's system prompt, tool limits, and model. The choice survives a resume. Source 1সোর্স 1 A custom agent's system prompt replaces the default Claude Code system prompt, but CLAUDE.md and project memory still load. Source 1সোর্স 1

To make an agent the default for a project, set "agent": "sdet-agent" in .claude/settings.json. The --agent flag overrides the setting. Source 1সোর্স 1

For one-off or CI runs, --agents takes a JSON object of subagents for that session only. Source 1সোর্স 1 In non-interactive mode it also takes the path to a JSON file (v2.1.281 or later). Source 1সোর্স 1

সহজ English

Claude can give a task to a subagent on its own. It compares your request with the description of each subagent. Words such as "use proactively" in the description make this more likely. Source 1সোর্স 1

You can also call a subagent yourself in 3 ways: Source 1সোর্স 1

  1. Name the subagent in your prompt, for example Use the qa-agent to find bugs in src/payment.js.
  2. Type an @-mention, for example @agent-qa-agent. An @-mention makes sure that this subagent runs. Source 1সোর্স 1
  3. Start the whole session as the agent with claude --agent sdet-agent. The session then uses the system prompt, tool limits, and model of that agent. Source 1সোর্স 1 CLAUDE.md and project memory still load. Source 1সোর্স 1

To make an agent the default for a project, set "agent": "sdet-agent" in .claude/settings.json. The --agent flag overrides this setting. Source 1সোর্স 1

For one-off or CI runs, give --agents a JSON object of subagents. These subagents are for that session only. Source 1সোর্স 1

বাংলা ব্যাখ্যা

Claude নিজে থেকেই কাজ subagent-কে দেয়। এটি আপনার request-কে প্রতিটি subagent-এর description-এর সাথে মেলায়। Description-এ "use proactively"-এর মতো কথা থাকলে delegation-এর সম্ভাবনা বাড়ে। Source 1সোর্স 1

নিজে subagent call করার তিনটি উপায় আছে: Source 1সোর্স 1

  1. Prompt-এ এর নাম লিখুন, যেমন Use the qa-agent to find bugs in src/payment.js।
  2. @-mention করুন, যেমন @agent-qa-agent। @-mention নিশ্চিত করে যে এই subagent-টিই চলবে। Source 1সোর্স 1
  3. পুরো session-টি agent হিসেবে চালান: claude --agent sdet-agent। তখন main thread ওই agent-এর system prompt, tool limit এবং model ব্যবহার করে। Resume করলেও এই choice থাকে। Source 1সোর্স 1 এই agent-এর system prompt default prompt-এর জায়গায় বসে, তবুও CLAUDE.md আর project memory load হয়। Source 1সোর্স 1

কোনো project-এ একটি agent-কে default করতে .claude/settings.json-এ "agent": "sdet-agent" set করুন। --agent flag এই setting-কে override করে। Source 1সোর্স 1

One-off বা CI run-এর জন্য --agents একটি JSON object নেয়, যার subagent-গুলো শুধু ওই session-এর জন্য। Source 1সোর্স 1

Parallel work and nesting

Where fork mode is on, as it is by default in an interactive session, Claude Code runs spawned subagents in the background. Source 1সোর্স 1 To get parallel work, ask for separate subagents. A pattern from the docs: Source 1সোর্স 1

Research the authentication, database, and API modules in parallel using separate subagents

Example for QA:

Use separate qa-agent subagents in parallel to find bugs in
src/auth/login.js, src/auth/token.js, and src/auth/session.js.
Then combine the findings into one report.

A chain also works: "Use the code-reviewer subagent to find performance issues, then use the optimizer subagent to fix them". Source 1সোর্স 1

Who can spawn a subagent

The main conversation spawns subagents with the Agent tool. Source 1সোর্স 1 In a subagent file, Agent in tools lets that subagent spawn its own subagents. Source 1সোর্স 1 To stop a subagent from spawning, omit Agent from its tools list or add it to disallowedTools. Source 1সোর্স 1 The tools lists of the qa-agent and the sdet-agent above do not include Agent, so the main conversation calls both. This is the simplest correct design.

  • By default, a subagent can spawn subagents up to three layers below the main conversation. CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH changes the depth, and 1 turns nesting off. Source 1সোর্স 1
  • At most 20 subagents run at the same time by default. One more fails with Concurrent subagent limit reached. CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS changes the limit. Source 1সোর্স 1
  • Many subagents that each return detailed results can use a lot of the main context. Source 1সোর্স 1 Ask each one for a short report.
  • /tasks lists background work, including subagents. Source 2সোর্স 2 Press Ctrl+B to send a running task to the background. Source 1সোর্স 1

সহজ English

In an interactive session, fork mode is on by default. When fork mode is on, Claude Code runs the subagents that it starts in the background. Source 1সোর্স 1 To get parallel work, ask for separate subagents. Source 1সোর্স 1 A chain also works: one subagent finds the problems, and the next one fixes them. Source 1সোর্স 1

The main conversation starts subagents with the Agent tool. Source 1সোর্স 1 If Agent is in the tools list of a subagent, that subagent can start its own subagents. To stop this, leave Agent out of tools or add it to disallowedTools. Source 1সোর্স 1 The qa-agent and the sdet-agent do not have Agent, so the main conversation calls both.

বাংলা ব্যাখ্যা

Interactive session-এ fork mode default হিসেবে চালু থাকে। Fork mode চালু থাকলে Claude Code spawn করা subagent-গুলো background-এ চালায়। Source 1সোর্স 1 Parallel কাজ পেতে আলাদা আলাদা subagent চান। Source 1সোর্স 1 যেমন, src/auth/login.js, src/auth/token.js আর src/auth/session.js-এর প্রতিটির জন্য আলাদা qa-agent subagent চান, তারপর সব finding মিলিয়ে একটি report। Chain-ও কাজ করে: একটি subagent সমস্যা খোঁজে, পরেরটি সেগুলো ঠিক করে। Source 1সোর্স 1

Main conversation Agent tool দিয়ে subagent spawn করে। Source 1সোর্স 1 কোনো subagent file-এর tools-এ Agent থাকলে ওই subagent নিজের subagent spawn করতে পারে। এটি বন্ধ করতে tools থেকে Agent বাদ দিন, অথবা disallowedTools-এ যোগ করুন। Source 1সোর্স 1 qa-agent আর sdet-agent-এর tools-এ Agent নেই, তাই main conversation দুটোকেই call করে।

  • Default-এ একটি subagent main conversation-এর তিন layer নিচ পর্যন্ত subagent spawn করতে পারে। CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH এই depth বদলায়, আর 1 দিলে nesting বন্ধ হয়। Source 1সোর্স 1
  • Default-এ একসাথে সর্বোচ্চ 20টি subagent চলে। আরও একটি চালালে সেটি Concurrent subagent limit reached message দিয়ে fail করে। CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS এই limit বদলায়। Source 1সোর্স 1
  • অনেক subagent বিস্তারিত result ফেরত দিলে main context-এর অনেকটা খরচ হতে পারে। Source 1সোর্স 1 প্রতিটির কাছে ছোট report চান।
  • /tasks subagent-সহ background কাজের list দেখায়। Source 2সোর্স 2 চলমান task background-এ পাঠাতে Ctrl+B চাপুন। Source 1সোর্স 1

Guardrails

The Hooks page shows how to write a blocking hook.

See it in practice

The case study has a read-only reviewer subagent that gates bug reports, in Bug Hunting with a Review Gate. It also has a test-executor subagent that preloads a skill, in Design, Execute, Fix, Retest.

সহজ English

The Hooks page shows how to write a hook that blocks. The case study shows a read-only reviewer subagent that gates bug reports, and a test-executor subagent that preloads a skill.

বাংলা ব্যাখ্যা

Blocking hook কীভাবে লিখতে হয়, তা Hooks page-এ আছে। Case study-তে একটি read-only reviewer subagent আছে, যা bug report gate করে, আর একটি test-executor subagent আছে, যা একটি skill preload করে।

Reference

Frontmatter fields

FieldWhat it does
name, descriptionRequired. Identity, and the text that Claude matches for delegation. Source 1সোর্স 1
tools, disallowedToolsAllowlist and denylist. Comma-separated string or YAML list. Source 1সোর্স 1
modelsonnet, opus, haiku, fable, a full model ID such as claude-opus-5-5, or inherit Source 1সোর্স 1
permissionModePermission mode of the subagent Source 1সোর্স 1
skillsSkills to preload. Claude Code reads the first 32 names. Source 1সোর্স 1
memoryuser, project, or local Source 1সোর্স 1
mcpServersServer names, or inline server definitions Source 1সোর্স 1
maxTurnsMaximum agentic turns. At the limit, the output is marked partial. Source 1সোর্স 1
backgroundtrue keeps the subagent in the background. Source 1সোর্স 1
colorred, blue, green, yellow, purple, orange, pink, or cyan Source 1সোর্স 1
hooks, effort, isolation, omitClaudeMd, initialPrompt, experimentalOther fields. isolation: worktree gives a temporary git worktree. Source 1সোর্স 1

Field names are camelCase and must match exactly. Claude Code ignores an unknown field and reports no error. Source 1সোর্স 1

Plugin subagents ignore hooks, mcpServers, and permissionMode. To use those fields, copy the file into .claude/agents/. Source 1সোর্স 1

Model order

Claude Code picks the subagent's model in this order: Source 1সোর্স 1

  1. The model parameter of one invocation
  2. The model field in the frontmatter
  3. The CLAUDE_CODE_SUBAGENT_MODEL environment variable
  4. The model of the main conversation

Other facts

সহজ English

This section lists the frontmatter fields of a subagent file and some other facts.

Claude Code selects the model of a subagent in this order: the model parameter of one call, then the model field in the frontmatter, then the CLAUDE_CODE_SUBAGENT_MODEL environment variable, and last the model of the main conversation. Source 1সোর্স 1

বাংলা ব্যাখ্যা

এই অংশে subagent file-এর frontmatter field-গুলো আর আরও কিছু তথ্য আছে।

  • name আর description বাধ্যতামূলক। Delegation-এর সময় Claude description মেলায়। Source 1সোর্স 1
  • tools আর disallowedTools একটি comma-separated string অথবা YAML list নেয়। Source 1সোর্স 1
  • model নেয় sonnet, opus, haiku, fable, claude-opus-5-5-এর মতো একটি full model ID, অথবা inherit। Source 1সোর্স 1
  • skills-এর প্রথম 32টি নাম Claude Code পড়ে। maxTurns-এর limit-এ পৌঁছালে output partial হিসেবে mark হয়। Source 1সোর্স 1
  • Field-এর নাম camelCase, এবং হুবহু মিলতে হবে। অজানা field Claude Code কোনো error ছাড়াই ignore করে। Source 1সোর্স 1
  • Plugin subagent hooks, mcpServers আর permissionMode ignore করে। এগুলো ব্যবহার করতে file-টি .claude/agents/-এ copy করুন। Source 1সোর্স 1

Claude Code subagent-এর model এই ক্রমে বাছে: একটি invocation-এর model parameter, তারপর frontmatter-এর model field, তারপর CLAUDE_CODE_SUBAGENT_MODEL environment variable, শেষে main conversation-এর model। Source 1সোর্স 1

  • v2.1.63-এর আগে Agent tool-এর নাম ছিল Task। Settings আর agent file-এ Task(...) এখনও alias হিসেবে কাজ করে। Source 1সোর্স 1
  • আপনার নিজের subagent-গুলোর description মিলিয়ে 15,000 token-এর বেশি হলে Claude Code startup-এ warning দেখায়। Source 1সোর্স 1
  • Background subagent সব MCP tool রাখে, কিন্তু built-in tool-এর শুধু একটি ছোট set পায়। Source 1সোর্স 1
  1. [1]
    Create custom subagents

    Anthropic (Claude Code docs) · accessed 2026-10-10দেখা হয়েছে: 2026-10-10

  2. [2]
    Commands

    Anthropic (Claude Code docs) · accessed 2026-10-10দেখা হয়েছে: 2026-10-10

  3. [3]
    CLI reference

    Anthropic (Claude Code docs) · accessed 2026-10-10দেখা হয়েছে: 2026-10-10

  4. [4]
    Hooks reference

    Anthropic (Claude Code docs) · accessed 2026-10-10দেখা হয়েছে: 2026-10-10

  5. [5]
    Extend Claude with skills

    Anthropic (Claude Code docs) · accessed 2026-10-10দেখা হয়েছে: 2026-10-10