Claude Agent SDK Reference

Build autonomous AI agents with the Claude Agent SDK.

3|2|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/AeyeOps/aeo-skill-marketplace --skill claude-agent-sdk-reference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Claude Agent SDK Reference
Source: https://github.com/AeyeOps/aeo-skill-marketplace/tree/main/aeo-claude/skills/claude-agent-sdk
Command: npx skills add https://github.com/AeyeOps/aeo-skill-marketplace --skill claude-agent-sdk-reference

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a structured reference for building autonomous AI agents using the Claude Agent SDK, enabling developers to design, test, and deploy complex multi-turn workflows with secure permissions and tool orchestration.

Core Features & Use Cases

  • GTVR workflow support: Implement Gather, Take Action, Verify, and Repeat patterns for reliable agent behavior.
  • Persistent and stateless modes: Use both stateless query() and stateful ClaudeSDKClient for multi-turn dialogues and context retention.
  • Tooling and MCP integration: Create custom tools with @tool, expose them via MCP servers, and compose agents from modular skills.
  • Streaming vs batch: Support real-time streaming of responses or batch-style interactions to fit UI needs.
  • Deployment patterns: Outline authentication, permission modes, and logging for production-grade agents.

Quick Start

Install the CLAUDE Agent SDK package and run the included examples to begin building agents. Examples show how to create a client, run a sample query, and extend tools with MCP servers.

Frequently Asked Questions about Claude Agent SDK Reference

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build autonomous AI agents with the Claude Agent SDK?

To build autonomous AI agents with the Claude Agent SDK, use Python to implement multi-turn workflows, custom tools, and streaming responses. It requires installing the claude-agent-sdk package and structuring context with a YAML frontmatter in SKILL.md.

What is the GTVR pattern for agent workflows?

The GTVR pattern for agent workflows stands for Gather, Take Action, Verify, and Repeat. Implementing GTVR with the Claude Agent SDK ensures reliable behavior in autonomous multi-turn agents by structuring task execution and validation loops.

How do I retain context in multi-turn agent dialogues?

You retain context in multi-turn dialogues by using the stateful ClaudeSDKClient API instead of the stateless query() function. This stateful client manages persistent state, enabling continuous multi-turn interactions with the Claude Agent SDK.

Can I integrate custom tools with Claude agents via MCP?

Yes, you can integrate custom tools with Claude agents via MCP servers. The Claude Agent SDK allows you to define functions using the @tool decorator and expose them through Model Context Protocol servers for modular agent composition.

Does the Claude Agent SDK support real-time streaming for Python applications?

Yes, the Claude Agent SDK supports real-time streaming for Python applications. It provides streaming APIs to deliver responses incrementally, alongside batch-style interactions, allowing you to fit the output method to your UI needs.

What are the limitations of stateless queries in agent workflows?

Stateless queries using the query() function do not retain conversation context between calls, limiting their use in continuous multi-turn workflows. For persistent context and stateful multi-turn agent behavior, you must use the ClaudeSDKClient instead.