Learning resourcesReviewed · Anthropic

Use Claude Code features in the SDK

This guide helps Python and TypeScript developers reuse Claude Code features in SDK agents, but disabling filesystem settings does not fully isolate an agent from its host. It explains project instructions, on-demand skills, hooks and the configuration sources that can remain active.

Researched 23 Nov 2026

In short.

This Claude Agent SDK guide teaches Python and TypeScript developers to reuse project instructions, skills and hooks, with the catch that host configuration can remain active even when filesystem settings are disabled. Its most useful distinction is between settings controlled by settingSources and inputs outside that option, including managed policies, global configuration, automatic memory and some connectors. It provides configuration examples and explains feature tradeoffs, but does not establish installation requirements, prices or compatibility with a specific SDK release. The examples were not executed, and runtime behavior and isolation outcomes were not assessed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage is limited to the complete selected page at [https://code.claude.com/docs/en/agent-sdk/claude-code-features.md], including its examples, tables, multi-tenant warning, skill-registration note and language-compatibility note. The documentation index and every linked page are excluded. No code was executed; runtime behavior, performance, security outcomes and compatibility with a specific SDK release were not assessed.

The overview

Resource identity

Use Claude Code features in the SDK is a documentation guide at [https://code.claude.com/docs/en/agent-sdk/claude-code-features.md]. It explains how applications using the Claude Agent SDK can load filesystem features shared with Claude Code.

The resource is a guide rather than an SDK package or a ready-made agent. Its scope includes settingSources, CLAUDE.md and rule files, skills, hooks, and a comparison of related extension mechanisms.

Practical assessment

The guide is useful when an SDK agent needs to follow conventions already used in interactive Claude Code sessions. It gives concrete controls for choosing configuration sources and explains why an agent may behave differently across machines or working directories.

Its strongest practical contribution is the warning that settingSources: [] does not create complete isolation. Treat it as configuration guidance; deployment security, runtime reliability and compatibility with a particular installed release remain unassessed.

Who it helps

The guide fits developers building Python or TypeScript agents, teams sharing project conventions between CLI and application sessions, and developers adding reusable review or refactoring workflows.

Beginners get examples and a feature-selection table, but the page assumes familiarity with asynchronous SDK calls, filesystem paths and tool configuration. Developers building a service for multiple customers should pay particular attention to inherited configuration and per-project memory.

Features explained

The page explains how to load project conventions from CLAUDE.md and rule files, discover filesystem skills, control which skills the main agent can invoke, and combine filesystem hooks with application callbacks.

Filesystem hooks can use shell commands, HTTP requests, MCP tools, prompt evaluation or verifier agents. Programmatic hooks run in the application process and can return structured decisions about tool execution. Both hook approaches also operate within subagents.

The comparison table distinguishes subagents for isolated subtasks, MCP for external service tools, and agent teams for coordinating separate Claude Code instances. Agent teams are described as a CLI feature without direct configuration through SDK options.

Using it

Requirements and prerequisites

The examples import claude_agent_sdk in Python and @anthropic-ai/claude-agent-sdk in TypeScript. Filesystem features require the relevant files to exist in locations the selected setting sources discover. The cwd option, or the process working directory when it is omitted, determines project lookup.

Skills must exist as .claude/skills/<name>/SKILL.md files; the page states that there is no programmatic skill-registration API. When an explicit tools list is supplied, it must include Skill for skill invocation.

Installation commands, supported runtime versions, authentication setup, hardware requirements and a minimum SDK version are not specified on this page.

How configuration is loaded

Omitting settingSources loads user, project and local sources. An explicit list selects among those sources, while an empty list disables them. Python calls the option setting_sources. Project settings.json loads only from <cwd>/.claude/; project instruction and rule discovery also reaches parent directories. Project skills, commands and subagents have their own discovery boundaries, including the repository root and specified additional directories.

CLAUDE.md and rules provide persistent context, while skills expose descriptions at startup and load their full instructions when relevant. Instruction levels are additive: the page gives no hard precedence rule for conflicting user and project instructions.

Managed policies, global ~/.claude.json configuration, automatic memory, some authenticated claude.ai connectors and specified sandbox credential restrictions can remain relevant regardless of settingSources. An empty source list therefore does not mean the process has no inherited configuration.

Configuration approach

Set cwd deliberately and choose settingSources explicitly. For example, selecting user and project sources shares their configuration while leaving local settings out. For project-only conventions, select project and place the appropriate instructions, skills and settings in the documented locations.

Use the skills option to enable all discovered skills, select named skills or disable invocation with an empty list. Omitting the option enables discovered user and project skills. Add application-specific hook callbacks through query() when structured decisions need to run inside the application.

For multiple tenants, the page recommends a separate filesystem for each tenant, settingSources: [], and CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 in env. Managed organization settings can still apply. Passing mcpServers: {} does not suppress claude.ai connectors; the page identifies separate connector controls. These measures were not exercised.

Representative examples

The refactoring example calls query() with user and project sources and specifies Read, Edit and Bash in allowedTools. It is written to print assistant text and a final successful result. This illustrates how an application can reuse conventions and settings already present on disk.

The hook example adds a PreToolUse callback for Bash. It checks whether the command contains rm -rf and returns a structured deny decision when it does; otherwise it returns an empty object so normal permission evaluation continues. This is a narrow illustration of interception, not evidence of comprehensive protection against destructive commands. Neither example was run.

Assessment & evidence

Limits and caveats

Configuration behavior depends on the working directory, parent directories, host files, authentication and managed settings. Project settings.json has no parent-directory fallback, even though instruction files can load from parents. Conflicting instruction files have no guaranteed precedence.

Automatic memory loads at session start unless separately disabled, and saving new memories requires Write or Edit tools. Global configuration remains readable, although its location can be changed with CLAUDE_CONFIG_DIR. Some sandbox credential restrictions also persist when user settings are excluded.

Hook event support differs between languages: the page names SessionStart, SessionEnd, TeammateIdle and TaskCompleted as additional TypeScript events beyond Python. It does not include the complete compatibility table. Performance, failure recovery and isolation guarantees were not assessed.

How to judge fit

Shared filesystem configuration is a practical fit when people want the CLI and SDK to use the same conventions and workflows. The documented defaults also mean behavior can depend on more than the options visible in application code.

For applications that need predictable configuration, explicitly choosing sources and examining inputs outside settingSources follows from those documented dependencies. That is an engineering inference, not a demonstrated isolation result. Keep instructions non-conflicting because the guide does not promise a fixed precedence between instruction levels.

Choosing between mechanisms

Within the documented SDK, use CLAUDE.md for conventions that should persist across sessions, skills for reference material or reusable workflows loaded when relevant, and programmatic systemPrompt context when instructions should come directly from application code.

Use filesystem hooks to share hook behavior with CLI sessions and programmatic hooks for application callbacks and structured decisions. Choose subagents for separate task contexts and MCP for external service tools. The page does not compare competing SDKs or provide evidence for ranking external alternatives.

Evidence and confidence

The evidence is the complete documentation page at [https://code.claude.com/docs/en/agent-sdk/claude-code-features.md], retained as selected-page.txt with SHA-256 8a7292acc99a8ea9e7c03ef0e2e6819e91ba9a5a62f23bb905d41282e51deacc. It contains explanatory text, configuration tables and Python and TypeScript examples.

The page supports statements about documented behavior. It includes no independent measurements or execution receipts establishing that behavior in a particular environment. No code was executed, and linked pages are outside the evidence scope.

Access & freshness

Costs

The page provides no SDK price, model rate, subscription requirement or deployment cost estimate. Financial cost is unknown from this evidence.

It says enabled features consume context and explains that full skill content loads on demand. It supplies no token measurements or quantified savings, and additional cost details are deferred to a linked page outside this scope.

Rights and terms

The selected page contains no explicit documentation license, example-code license or redistribution grant. Reuse and redistribution rights are therefore unknown from this page.

SDK contractual terms, data retention terms and ownership terms for generated output are also not established here. Public availability of the guide does not establish those permissions.

Date and version limits

The documentation capture is dated 2026-11-23 at 04:24:21.718 UTC. That records when the page was captured, not when its features were released or last updated.

The supplied page states no publication date, update date or SDK release number. Compatibility with a specific installed Python or TypeScript SDK version is unknown, particularly for defaults, skill controls and hook event coverage.

Practical next steps

Start by deciding which conventions should be shared with Claude Code. Set cwd and settingSources explicitly, inspect the corresponding instruction files and hooks, and configure the skills and tools needed for the intended task.

Before relying on isolation, account for managed policies, global configuration, automatic memory and authenticated connectors. The page points to deployment guidance at [https://code.claude.com/docs/en/agent-sdk/secure-deployment.md]; its contents are outside this report's scope.

Check the installed SDK's option and hook-event support, then verify configuration loading and permission behavior in an isolated development environment. Runtime results, costs and reuse terms remain unknown until separately established.

Evidence for this report

selected-page.txtselected · checked 2026-11-23