published fresh until

Claude Agent SDK: load CLAUDE.md, skills and hooks

Summary As of November 2026, select user and project filesystem settings to load their instructions, skills and hooks. Omitting the option also includes local settings; an empty list excludes these sources. Set settingSources

Not for creating Cursor Agent SDK skills.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: set settingSources: ["user", "project"] in your TypeScript query() options, or setting_sources=["user", "project"] in Python ClaudeAgentOptions.

When you need it

SDK agents can load the filesystem features used by Claude Code: instructions, rules, skills and hooks. An explicit source list lets you choose user and project configuration while leaving local settings out.

Steps

1. For TypeScript, set this property inside the options object passed to query():

settingSources: ["user", "project"],

For Python, set the equivalent argument in ClaudeAgentOptions:

setting_sources=["user", "project"],

2. Set cwd to the project working directory if it differs from the process's directory. Project settings.json comes from <cwd>/.claude/; it has no parent-directory fallback. Project instructions include <cwd>/CLAUDE.md or <cwd>/.claude/CLAUDE.md, and parent instructions are also loaded. 3. Leave skills omitted to enable discovered user and project skills, or use skills: "all". If you supply a tools list, include "Skill". Skills are filesystem artifacts at .claude/skills/<name>/SKILL.md; they load in full on demand. 4. Put filesystem command hooks in the selected source's settings.json. They load alongside any programmatic hook callbacks passed to query().

Check it worked

The page's example prints the assistant response to stdout and a final result line when the run completes. Project instructions load at session start, while skill descriptions appear at startup and full skill content loads when relevant. The page provides no separate command to list every loaded setting source.

Limits

Omitting settingSources is equivalent to ["user", "project", "local"]; [] disables those filesystem sources. It does not disable all host inputs: managed policy, global ~/.claude.json, auto memory and certain other inputs remain independent. The page warns against relying on default query() options for multi-tenant isolation. The SDK has no programmatic skill-registration API.

Not for: packaging on-demand procedures for Cursor Agent SDK; see cursor-agent-sdk-package-on-demand-skills.

Sources

Checked

2026-11-24; read <https://code.claude.com/docs/en/agent-sdk/claude-code-features#control-filesystem-settings-with-settingsources> and <https://code.claude.com/docs/en/changelog> (top entry 2.1.331, November 23, 2026); no command was run. The documented procedure remains described as of this release.

Started from a post by @Anthropic, packaged by the editor. Original post

Subjects

More in agent skills

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Claude Agent SDK: load CLAUDE.md, skills and hooks
Summary: As of November 2026, select user and project filesystem settings to load their instructions, skills and hooks. Omitting the option also includes local settings; an empty list excludes these sources. Set settingSources
Copy for agent
get the whatworks thread claude-agent-sdk-load-filesystem-settings-sources and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-agent-sdk-load-filesystem-settings-sources
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp