Skip to main content
guidesSource-backedReview first Safety Privacy

Claude Agent Development

Build autonomous agents with the Claude Agent SDK and Claude Code subagents: the query loop, built-in tools, subagent delegation, and permission controls.

by JSONbored·added 2025-10-27·
HarnessClaude Code
Review first review before installing

Open the source and read safety notes before installing.

Citation facts

Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.

Source URLs
https://code.claude.com/docs/en/agent-sdk/overview, https://github.com/JSONbored/awesome-claude/blob/main/content/guides/claude-agent-development-framework.mdx
Safety notes
Agents built with the Agent SDK run real tools (Bash commands, file edits, web fetches) autonomously in your process and on your filesystem; scope capability with allowed_tools/permission_mode and review what each tool and connected MCP server can do before granting it.
Privacy notes
The SDK authenticates with ANTHROPIC_API_KEY (or a third-party provider's credentials); keep the key in an environment variable, never in agent prompts or committed code. Connected MCP servers and the WebFetch/WebSearch tools can send project data to external systems.
Author
JSONbored
Claim status
unclaimed
Last verified
2025-10-27

Decision playbook

Review trust signals before you adopt

Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.

Compare context
Selected

0

Current score

78

Baseline

Delta

No baseline selected

No major trust-signal divergence detected in the current selection.

Source and provenance checks

Complete

Confirm ownership and provenance before trusting install instructions.

  • Source link availableRequired

    Open the canonical repository and verify ownership.

    Done
  • Source provenance statusRequired

    Marked as source-backed.

    Done
  • Metadata reviewed

    Registry metadata indicates a reviewed listing.

    Done

Safety and privacy checks

Complete

Validate risk disclosures before installation or API wiring.

  • Safety notes presentRequired

    Review the listed safety guidance before running commands.

    Done
  • Privacy notes presentRequired

    Review data handling notes before connecting accounts or secrets.

    Done
  • Trust level risk gateRequired

    Trust level does not block evaluation.

    Done

Package and install checks

Needs review

Check package metadata and artifact integrity signals.

  • Install payload available

    Install or copy payload is available for review.

    Done
  • Package verification flag

    No package verification flag provided.

    Pending
  • Checksum metadata

    No checksum provided for downloaded artifact.

    Pending

Compare-driven decision checks

Needs review

Use compare context to validate trade-offs before adoption.

  • Compare tray has multiple entries

    Add at least one more entry to compare trust differences.

    Pending
  • Baseline comparison available

    No baseline peer selected yet.

    Pending
  • Diverging trust signals identified

    No major trust-signal divergence found.

    Pending

Setup at a glance

Copy & paste

Copy-ready — paste the snippet to get started.

Install command

Not provided

Config snippet

Not provided

Copy snippet

Provided

Prerequisites

None

Platforms

1 listed

Difficulty

39/100

Adoption plan

Balanced adoption plan

Current risk score 16/100. Use staged verification before broader rollout.

Risk 16

Pre-adoption checks

Validate source and review signals before any execution.

  • Confirm source provenanceRequired

    Source URL/provenance metadata is present.

    Done
  • Confirm metadata review state

    Listing has review metadata.

    Done
  • Verify install payload

    Install/config payload exists and can be inspected.

    Done

Security checks

Confirm safety, privacy, and package integrity signals.

  • Review safety notesRequired

    Safety notes are present.

    Done
  • Review privacy notesRequired

    Privacy notes are present.

    Done
  • Verify package integrity metadata

    No package verification/checksum metadata.

    Pending

Rollout

Adopt in controlled steps based on the selected plan.

  • Run in isolated sandbox firstRequired

    Use a constrained sandbox and observe behavior across multiple tasks.

    Pending
  • Roll out graduallyRequired

    Roll out to a small cohort before wider usage.

    Pending
  • Set monitoring and fallback

    Define rollback path and monitor errors after adoption.

    Pending

Evidence readiness

Evidence readiness matrix · balanced

Required evidence gates are covered (5/6 signals complete).

Risk 15

Source provenance

Present

Source repository/provenance is listed.

Required in this preset

Metadata review

Present

Review metadata is present.

Required in this preset

Safety notes

Present

Safety notes are present.

Required in this preset

Privacy notes

Present

Privacy notes are present.

Optional in this preset

Package integrity

Missing

Package integrity metadata is missing.

Optional in this preset

Install payload

Present

Install payload is available.

Required in this preset

Required evidence gates are covered for this preset.

Decision timeline

Decision timeline · balanced

5/6 steps complete with no blocking gaps for this preset.

Risk 14

triage

Confirm source provenanceRequired

Source/provenance metadata is available.

Done

triage

Check metadata review statusRequired

Review metadata is available.

Done

verify

Review safety notesRequired

Safety notes are available.

Done

verify

Review privacy notes

Privacy notes are available.

Done

verify

Validate package integrity metadata

Package integrity metadata is missing.

Pending

rollout

Verify install payload and commandsRequired

Install payload is available.

Done

No required blockers for this timeline preset.

Safety & privacy surface

Safety & privacy surface

1 safety and 1 privacy notes across 2 risk areas. Review closely: credentials & tokens, permissions & scopes.

2 areas
  • SafetyPermissions & scopesAgents built with the Agent SDK run real tools (Bash commands, file edits, web fetches) autonomously in your process and on your filesystem; scope capability with allowed_tools/permission_mode and review what each tool and connected MCP server can do before granting it.
  • PrivacyCredentials & tokensThe SDK authenticates with ANTHROPIC_API_KEY (or a third-party provider's credentials); keep the key in an environment variable, never in agent prompts or committed code. Connected MCP servers and the WebFetch/WebSearch tools can send project data to external systems.

Safety notes

  • Agents built with the Agent SDK run real tools (Bash commands, file edits, web fetches) autonomously in your process and on your filesystem; scope capability with allowed_tools/permission_mode and review what each tool and connected MCP server can do before granting it.

Privacy notes

  • The SDK authenticates with ANTHROPIC_API_KEY (or a third-party provider's credentials); keep the key in an environment variable, never in agent prompts or committed code. Connected MCP servers and the WebFetch/WebSearch tools can send project data to external systems.

Schema details

Install type
copy
Reading time
6 min
Difficulty score
39
Troubleshooting
Yes
Breaking changes
No
Skill and platform metadata
Retrieval sources
https://code.claude.com/docs/en/agent-sdk/overviewhttps://code.claude.com/docs/en/agent-sdk/pythonhttps://code.claude.com/docs/en/sub-agents
Full copyable content
## TL;DR

There are two complementary ways to build agents with Claude:

- **The Claude Agent SDK** — a Python and TypeScript library that gives you the same agent loop, built-in tools, and context management that power Claude Code, runnable inside your own application. You call `query()` (or `ClaudeSDKClient`) and Claude autonomously reads files, runs commands, edits code, and searches the web.
- **Claude Code subagents** — specialized assistants defined as Markdown files with YAML frontmatter. Each runs in its own context window with a focused system prompt, restricted tools, and an optional cheaper model. The main agent delegates matching tasks and gets back only a summary.

This guide shows a minimal SDK `query()` loop, the built-in tools you get for free, how to define and delegate to subagents, and how to control models and permissions.

> **Prerequisites**
>
> **Knowledge:** Basic Python or TypeScript and API experience<br />
> **Tools:** An Anthropic API key from the [Console](https://platform.claude.com/); Python 3.10+ for the Python SDK<br />
> **Auth:** `export ANTHROPIC_API_KEY=your-api-key` (the SDK also supports Amazon Bedrock, Google Vertex AI, and Microsoft Azure providers via environment variables)

## What the Agent SDK gives you

The Agent SDK includes built-in tools for reading files, running commands, and editing code, so your agent can start working immediately without you implementing tool execution. This is the key difference from the Anthropic Client SDK, where you send prompts and write the tool-execution loop yourself.

Install it:

```bash
# Python (requires Python 3.10+)
pip install claude-agent-sdk

# TypeScript
npm install @anthropic-ai/claude-agent-sdk
```

The TypeScript SDK bundles a native Claude Code binary for your platform as an optional dependency, so you don't need to install Claude Code separately.

## Step 1: A minimal query loop

`query()` runs a one-off task and yields messages as Claude works. This Python example asks the agent to fix a bug, pre-approving the `Read`, `Edit`, and `Bash` tools:

```python
import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions


async def main():
    async for message in query(
        prompt="Find and fix the bug in auth.py",
        options=ClaudeAgentOptions(allowed_tools=["Read", "Edit", "Bash"]),
    ):
        print(message)  # Claude reads the file, finds the bug, edits it


asyncio.run(main())
```

The TypeScript equivalent uses the same shape:

```typescript
import { query } from "@anthropic-ai/claude-agent-sdk";

for await (const message of query({
  prompt: "Find and fix the bug in auth.ts",
  options: { allowedTools: ["Read", "Edit", "Bash"] }
})) {
  console.log(message); // Claude reads the file, finds the bug, edits it
}
```

For multi-turn conversations that keep context, use `ClaudeSDKClient` instead of `query()`:

```python
async with ClaudeSDKClient() as client:
    await client.query("First question")
    async for message in client.receive_response():
        print(message)

    await client.query("Follow-up question")  # Same session context
    async for message in client.receive_response():
        print(message)
```

## Step 2: Built-in tools

Everything that makes Claude Code powerful is available in the SDK. You enable tools by listing them in `allowed_tools` (Python) / `allowedTools` (TypeScript). Key built-in tools:

| Tool | What it does |
| --- | --- |
| **Read** | Read any file in the working directory |
| **Write** | Create new files |
| **Edit** | Make precise edits to existing files |
| **Bash** | Run terminal commands, scripts, git operations |
| **Glob** | Find files by pattern (`**/*.ts`, `src/**/*.py`) |
| **Grep** | Search file contents with regex |
| **WebSearch** | Search the web for current information |
| **WebFetch** | Fetch and parse web page content |

Beyond tools, the SDK also exposes hooks (`PreToolUse`, `PostToolUse`, `Stop`, `SessionStart`, and more), MCP server connections, sessions you can resume or fork, and Claude Code's filesystem-based configuration (skills, commands, `CLAUDE.md` memory, and plugins) loaded from `.claude/`.

## Step 3: Delegate to subagents

Subagents are specialized AI assistants that handle specific types of tasks. Each runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent's description, it delegates to that subagent, which works independently and returns results.

Subagents help you:

- **Preserve context** by keeping exploration and implementation out of your main conversation
- **Enforce constraints** by limiting which tools a subagent can use
- **Reuse configurations** across projects with user-level subagents
- **Specialize behavior** with focused system prompts for specific domains
- **Control costs** by routing tasks to faster, cheaper models like Haiku

### Define a subagent as a file

Subagents are Markdown files with YAML frontmatter; the body becomes the subagent's system prompt. Save them to `.claude/agents/` (project scope, check into version control) or `~/.claude/agents/` (available across all your projects). Only `name` and `description` are required:

```markdown
---
name: code-reviewer
description: Reviews code for quality and best practices
tools: Read, Glob, Grep
model: sonnet
---

You are a code reviewer. When invoked, analyze the code and provide
specific, actionable feedback on quality, security, and best practices.
```

Claude uses the `description` to decide when to delegate, so write it clearly. You can also create and manage subagents interactively with the `/agents` command, which takes effect without a session restart (files edited directly on disk require a restart).

### Define subagents from the Agent SDK

In the SDK, pass an `agents` map and include `Agent` in `allowed_tools` so subagent invocations are auto-approved:

```python
import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions, AgentDefinition


async def main():
    async for message in query(
        prompt="Use the code-reviewer agent to review this codebase",
        options=ClaudeAgentOptions(
            allowed_tools=["Read", "Glob", "Grep", "Agent"],
            agents={
                "code-reviewer": AgentDefinition(
                    description="Expert code reviewer for quality and security reviews.",
                    prompt="Analyze code quality and suggest improvements.",
                    tools=["Read", "Glob", "Grep"],
                )
            },
        ),
    ):
        if hasattr(message, "result"):
            print(message.result)


asyncio.run(main())
```

Claude Code also ships built-in subagents it uses automatically: **Explore** (a fast, read-only Haiku agent for codebase search), **Plan** (read-only research during plan mode), and **general-purpose** (all tools, for complex multi-step tasks).

## Agent SDK vs subagents: when to use which

| | Agent SDK | Claude Code subagents |
| --- | --- | --- |
| **What it is** | Python/TypeScript library that runs the agent loop in your process | Markdown files that define specialized assistants within a session |
| **Where it runs** | Your application / infrastructure | Inside a Claude Code (or SDK) session, in an isolated context window |
| **Best for** | Custom applications, CI/CD, production automation | Offloading focused side tasks (search, review, debugging) to preserve main context |
| **Configuration** | Code (`ClaudeAgentOptions`, `AgentDefinition`) | YAML frontmatter (`name`, `description`, `tools`, `model`, ...) |
| **Defined by** | `query()` / `ClaudeSDKClient` calls | `.claude/agents/*.md`, `~/.claude/agents/*.md`, `/agents`, or `--agents` JSON |

They are not mutually exclusive: an SDK agent can delegate to subagents, and subagents inherit the same built-in tools.

## Step 4: Choose models and control permissions

**Models.** A subagent's `model` field accepts an alias (`sonnet`, `opus`, `haiku`, `fable`), a full model ID (for example `claude-opus-4-8`), or `inherit`. It defaults to `inherit` (the main conversation's model). Routing inexpensive, high-volume work to Haiku is the documented way to control cost.

**Permissions.** Control exactly which tools an agent can use so it can analyze without modifying, or require approval for sensitive actions. The main levers:

| Field (Python / frontmatter) | Effect |
| --- | --- |
| `allowed_tools` / `tools` | Tools the agent may use (a read-only agent might list only `Read`, `Glob`, `Grep`) |
| `disallowedTools` | Tools to deny, removed from the inherited or specified list |
| `permission_mode` / `permissionMode` | `default`, `acceptEdits`, `plan`, `bypassPermissions`, and more |
| `max_turns` / `maxTurns` | Caps the number of agentic turns before the agent stops |

A read-only reviewer is simply an agent whose tool list contains only `Read`, `Glob`, and `Grep` — it can analyze but cannot edit or run commands.

## Troubleshooting

> **Common issues and fixes**
>
> **`No matching distribution found for claude-agent-sdk`**<br />
> Your Python interpreter is older than 3.10. The Python package requires Python 3.10 or later. Check with `python3 --version` (macOS/Linux) or `py --version` (Windows).
>
> **Subagent edits to a file you didn't expect**<br />
> The subagent inherited all tools because `tools` was omitted. List only the tools it needs (for a reviewer, the read-only set) to enforce least privilege.
>
> **A subagent file isn't picked up**<br />
> Subagents are loaded at session start. If you add or edit a file directly on disk, restart your session. Subagents created through `/agents` take effect immediately.
>
> **Subagent never gets delegated to**<br />
> Claude decides delegation from the `description` field. Make it specific about when the subagent should be used.
>
> **Authentication errors**<br />
> Set `ANTHROPIC_API_KEY` as an environment variable, or configure a supported provider (Amazon Bedrock, Google Vertex AI, or Microsoft Azure) via its environment variables and credentials.

## Safety and privacy

Agents run real tools autonomously. Before granting `Bash`, `Edit`, `Write`, or MCP servers, decide whether the task actually needs them and prefer the narrowest tool set. Keep your API key in an environment variable, never in prompts or committed code, and remember that `WebFetch`, `WebSearch`, and connected MCP servers can send project data to external systems.

## Quick reference

- **Install:** `pip install claude-agent-sdk` / `npm install @anthropic-ai/claude-agent-sdk`
- **Run a task:** `query(prompt=..., options=ClaudeAgentOptions(allowed_tools=[...]))`
- **Multi-turn:** `ClaudeSDKClient` with `client.query()` + `client.receive_response()`
- **Subagent file:** `.claude/agents/<name>.md` with `name` + `description` frontmatter (required), optional `tools` and `model`
- **Manage subagents interactively:** `/agents`
- **Restrict capability:** `allowed_tools` / `disallowedTools` / `permission_mode`

## Next steps

- [Agent SDK overview](https://code.claude.com/docs/en/agent-sdk/overview)
- [Python Agent SDK reference](https://code.claude.com/docs/en/agent-sdk/python)
- [Create custom subagents](https://code.claude.com/docs/en/sub-agents)

_Sources: Claude Agent SDK overview, Python SDK reference, and Create custom subagents (code.claude.com)._

About this resource

TL;DR

There are two complementary ways to build agents with Claude:

  • The Claude Agent SDK — a Python and TypeScript library that gives you the same agent loop, built-in tools, and context management that power Claude Code, runnable inside your own application. You call query() (or ClaudeSDKClient) and Claude autonomously reads files, runs commands, edits code, and searches the web.
  • Claude Code subagents — specialized assistants defined as Markdown files with YAML frontmatter. Each runs in its own context window with a focused system prompt, restricted tools, and an optional cheaper model. The main agent delegates matching tasks and gets back only a summary.

This guide shows a minimal SDK query() loop, the built-in tools you get for free, how to define and delegate to subagents, and how to control models and permissions.

Prerequisites

Knowledge: Basic Python or TypeScript and API experience
Tools: An Anthropic API key from the Console; Python 3.10+ for the Python SDK
Auth: export ANTHROPIC_API_KEY=your-api-key (the SDK also supports Amazon Bedrock, Google Vertex AI, and Microsoft Azure providers via environment variables)

What the Agent SDK gives you

The Agent SDK includes built-in tools for reading files, running commands, and editing code, so your agent can start working immediately without you implementing tool execution. This is the key difference from the Anthropic Client SDK, where you send prompts and write the tool-execution loop yourself.

Install it:

# Python (requires Python 3.10+)
pip install claude-agent-sdk

# TypeScript
npm install @anthropic-ai/claude-agent-sdk

The TypeScript SDK bundles a native Claude Code binary for your platform as an optional dependency, so you don't need to install Claude Code separately.

Step 1: A minimal query loop

query() runs a one-off task and yields messages as Claude works. This Python example asks the agent to fix a bug, pre-approving the Read, Edit, and Bash tools:

import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions


async def main():
    async for message in query(
        prompt="Find and fix the bug in auth.py",
        options=ClaudeAgentOptions(allowed_tools=["Read", "Edit", "Bash"]),
    ):
        print(message)  # Claude reads the file, finds the bug, edits it


asyncio.run(main())

The TypeScript equivalent uses the same shape:

import { query } from "@anthropic-ai/claude-agent-sdk";

for await (const message of query({
  prompt: "Find and fix the bug in auth.ts",
  options: { allowedTools: ["Read", "Edit", "Bash"] }
})) {
  console.log(message); // Claude reads the file, finds the bug, edits it
}

For multi-turn conversations that keep context, use ClaudeSDKClient instead of query():

async with ClaudeSDKClient() as client:
    await client.query("First question")
    async for message in client.receive_response():
        print(message)

    await client.query("Follow-up question")  # Same session context
    async for message in client.receive_response():
        print(message)

Step 2: Built-in tools

Everything that makes Claude Code powerful is available in the SDK. You enable tools by listing them in allowed_tools (Python) / allowedTools (TypeScript). Key built-in tools:

Tool What it does
Read Read any file in the working directory
Write Create new files
Edit Make precise edits to existing files
Bash Run terminal commands, scripts, git operations
Glob Find files by pattern (**/*.ts, src/**/*.py)
Grep Search file contents with regex
WebSearch Search the web for current information
WebFetch Fetch and parse web page content

Beyond tools, the SDK also exposes hooks (PreToolUse, PostToolUse, Stop, SessionStart, and more), MCP server connections, sessions you can resume or fork, and Claude Code's filesystem-based configuration (skills, commands, CLAUDE.md memory, and plugins) loaded from .claude/.

Step 3: Delegate to subagents

Subagents are specialized AI assistants that handle specific types of tasks. Each runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent's description, it delegates to that subagent, which works independently and returns results.

Subagents help you:

  • Preserve context by keeping exploration and implementation out of your main conversation
  • Enforce constraints by limiting which tools a subagent can use
  • Reuse configurations across projects with user-level subagents
  • Specialize behavior with focused system prompts for specific domains
  • Control costs by routing tasks to faster, cheaper models like Haiku

Define a subagent as a file

Subagents are Markdown files with YAML frontmatter; the body becomes the subagent's system prompt. Save them to .claude/agents/ (project scope, check into version control) or ~/.claude/agents/ (available across all your projects). Only name and description are required:

---
name: code-reviewer
description: Reviews code for quality and best practices
tools: Read, Glob, Grep
model: sonnet
---

You are a code reviewer. When invoked, analyze the code and provide
specific, actionable feedback on quality, security, and best practices.

Claude uses the description to decide when to delegate, so write it clearly. You can also create and manage subagents interactively with the /agents command, which takes effect without a session restart (files edited directly on disk require a restart).

Define subagents from the Agent SDK

In the SDK, pass an agents map and include Agent in allowed_tools so subagent invocations are auto-approved:

import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions, AgentDefinition


async def main():
    async for message in query(
        prompt="Use the code-reviewer agent to review this codebase",
        options=ClaudeAgentOptions(
            allowed_tools=["Read", "Glob", "Grep", "Agent"],
            agents={
                "code-reviewer": AgentDefinition(
                    description="Expert code reviewer for quality and security reviews.",
                    prompt="Analyze code quality and suggest improvements.",
                    tools=["Read", "Glob", "Grep"],
                )
            },
        ),
    ):
        if hasattr(message, "result"):
            print(message.result)


asyncio.run(main())

Claude Code also ships built-in subagents it uses automatically: Explore (a fast, read-only Haiku agent for codebase search), Plan (read-only research during plan mode), and general-purpose (all tools, for complex multi-step tasks).

Agent SDK vs subagents: when to use which

Agent SDK Claude Code subagents
What it is Python/TypeScript library that runs the agent loop in your process Markdown files that define specialized assistants within a session
Where it runs Your application / infrastructure Inside a Claude Code (or SDK) session, in an isolated context window
Best for Custom applications, CI/CD, production automation Offloading focused side tasks (search, review, debugging) to preserve main context
Configuration Code (ClaudeAgentOptions, AgentDefinition) YAML frontmatter (name, description, tools, model, ...)
Defined by query() / ClaudeSDKClient calls .claude/agents/*.md, ~/.claude/agents/*.md, /agents, or --agents JSON

They are not mutually exclusive: an SDK agent can delegate to subagents, and subagents inherit the same built-in tools.

Step 4: Choose models and control permissions

Models. A subagent's model field accepts an alias (sonnet, opus, haiku, fable), a full model ID (for example claude-opus-4-8), or inherit. It defaults to inherit (the main conversation's model). Routing inexpensive, high-volume work to Haiku is the documented way to control cost.

Permissions. Control exactly which tools an agent can use so it can analyze without modifying, or require approval for sensitive actions. The main levers:

Field (Python / frontmatter) Effect
allowed_tools / tools Tools the agent may use (a read-only agent might list only Read, Glob, Grep)
disallowedTools Tools to deny, removed from the inherited or specified list
permission_mode / permissionMode default, acceptEdits, plan, bypassPermissions, and more
max_turns / maxTurns Caps the number of agentic turns before the agent stops

A read-only reviewer is simply an agent whose tool list contains only Read, Glob, and Grep — it can analyze but cannot edit or run commands.

Troubleshooting

Common issues and fixes

No matching distribution found for claude-agent-sdk
Your Python interpreter is older than 3.10. The Python package requires Python 3.10 or later. Check with python3 --version (macOS/Linux) or py --version (Windows).

Subagent edits to a file you didn't expect
The subagent inherited all tools because tools was omitted. List only the tools it needs (for a reviewer, the read-only set) to enforce least privilege.

A subagent file isn't picked up
Subagents are loaded at session start. If you add or edit a file directly on disk, restart your session. Subagents created through /agents take effect immediately.

Subagent never gets delegated to
Claude decides delegation from the description field. Make it specific about when the subagent should be used.

Authentication errors
Set ANTHROPIC_API_KEY as an environment variable, or configure a supported provider (Amazon Bedrock, Google Vertex AI, or Microsoft Azure) via its environment variables and credentials.

Safety and privacy

Agents run real tools autonomously. Before granting Bash, Edit, Write, or MCP servers, decide whether the task actually needs them and prefer the narrowest tool set. Keep your API key in an environment variable, never in prompts or committed code, and remember that WebFetch, WebSearch, and connected MCP servers can send project data to external systems.

Quick reference

  • Install: pip install claude-agent-sdk / npm install @anthropic-ai/claude-agent-sdk
  • Run a task: query(prompt=..., options=ClaudeAgentOptions(allowed_tools=[...]))
  • Multi-turn: ClaudeSDKClient with client.query() + client.receive_response()
  • Subagent file: .claude/agents/<name>.md with name + description frontmatter (required), optional tools and model
  • Manage subagents interactively: /agents
  • Restrict capability: allowed_tools / disallowedTools / permission_mode

Next steps

Sources: Claude Agent SDK overview, Python SDK reference, and Create custom subagents (code.claude.com).

Source citations

Add this badge to your README

Show that Claude Agent Development is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/guides/claude-agent-development-framework.svg)](https://heyclau.de/entry/guides/claude-agent-development-framework)

How it compares

Claude Agent Development side by side with 2 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

2 trust signals differ across this comparison (Source provenance, Submitter).

Field

Build autonomous agents with the Claude Agent SDK and Claude Code subagents: the query loop, built-in tools, subagent delegation, and permission controls.

Open dossier

Delegate repository maintenance to Claude Code subagents: docs drift scans, dependency report triage, README sync checks, and stale issue grooming with scoped tools, read-first policies, and human merge gates.

Open dossier

A source-backed review workflow for pull requests that include AI-generated code. Treat generated diffs as untrusted implementation work, verify behavior in CI, inspect security-sensitive paths first, and merge only after a reviewer-owned checklist passes.

Open dossier
Next steps
Trust
Review statusReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewed
Package trustPackage not verifiedPackage not verifiedPackage not verified
Source provenanceDiffersSource-backedSubmission linkedSource submissionSource-backed
SubmitterDifferskiannidevMkDev11
Install riskReview firstReview firstReview first
Notes Safety Privacy Safety Privacy Safety Privacy
Brand
Categoryguidesguidesguides
Sourcesource-backedsource-backedsource-backed
AuthorJSONboredkiannidevMkDev11
Added2025-10-272026-06-162026-06-04
Platforms
Claude Code
Claude Code
Claude Code
Source repo
Safety notesAgents built with the Agent SDK run real tools (Bash commands, file edits, web fetches) autonomously in your process and on your filesystem; scope capability with allowed_tools/permission_mode and review what each tool and connected MCP server can do before granting it.Maintenance subagents can propose file edits and shell commands—start read-only and add write tools only after review policy exists. Parallel subagents multiply tool calls; cap concurrent maintenance runs on large monorepos to control cost and noise. Dependency upgrade suggestions require human verification against semver, license, and security advisories before merge.Treat AI-generated changes as untrusted code until a human reviewer verifies behavior, security impact, and rollback risk. Block merge when the PR changes authentication, authorization, data deletion, payment, networking, serialization, or release automation without focused tests. Do not accept generated explanations as proof; require CI output, reproducible commands, or links to authoritative project docs. Inspect package manifests, lockfiles, package-manager configuration, and dependency choices before installing from an untrusted branch. Run install, build, and test commands for untrusted PRs in a disposable sandbox or container, with package-manager lifecycle scripts disabled unless the changed scripts and packages have been reviewed and approved.
Privacy notesThe SDK authenticates with ANTHROPIC_API_KEY (or a third-party provider's credentials); keep the key in an environment variable, never in agent prompts or committed code. Connected MCP servers and the WebFetch/WebSearch tools can send project data to external systems.Maintenance scans read internal docs, issue titles, dependency manifests, and CI configuration that may describe unreleased features. Subagent transcripts may retain file paths and package names from private forks; avoid pasting customer data into maintenance prompts. External MCP connectors can expose additional metadata—document what each maintenance subagent may read.Do not paste private code, secrets, customer data, logs, or incident details into external AI review tools unless your organization has approved that workflow. Keep review notes in the pull request or internal tracker so security decisions remain auditable.
Prerequisites— none listed
  • Claude Code with subagents available for your account and project.
  • Recurring maintenance work that benefits from separate specialist context.
  • Documented human owners for merges, label changes, and dependency upgrades.
  • Optional MCP or GitHub integrations scoped to maintenance repositories only.
  • Access to the pull request diff and the branch's CI results.
  • Permission to request changes or block merge when evidence is missing.
  • Project-specific test commands for the touched package or service.
  • Secret scanning, code scanning, or equivalent local checks for risky repositories.
Install
Config
Citations
ClaimUnclaimedUnclaimedUnclaimed
Open 3 picks in the interactive comparison tool

Related guides

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.