fix(claude): add settingSources to load Skills, Commands, and CLAUDE.md#1290
fix(claude): add settingSources to load Skills, Commands, and CLAUDE.md#1290murataslan1 wants to merge 1 commit intopingdotgg:mainfrom
Conversation
The Claude Agent SDK does not load filesystem settings by default. Without settingSources, Skills, slash commands, and CLAUDE.md memory files are silently ignored. Fixes pingdotgg#1283
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can disable poems in the walkthrough.Disable the |
There was a problem hiding this comment.
Pull request overview
This PR updates the Claude Agent SDK integration so that Claude Code filesystem-based features (Skills, slash commands, and CLAUDE.md memory) are discovered by explicitly enabling SDK settingSources.
Changes:
- Pass
settingSources: ["user", "project"]in the Claude Agent SDKqueryOptionsso filesystem settings are loaded.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| includePartialMessages: true, | ||
| canUseTool, | ||
| env: process.env, | ||
| settingSources: ["user", "project"], |
There was a problem hiding this comment.
settingSources changes the Claude SDK session behavior, but there’s no test assertion that createQuery receives the expected sources. Please add/extend a unit test (e.g. in ClaudeAdapter.test.ts) to verify createInput.options.settingSources is set, so regressions don’t silently disable Skills/Commands/CLAUDE.md again.
| includePartialMessages: true, | ||
| canUseTool, | ||
| env: process.env, | ||
| settingSources: ["user", "project"], |
There was a problem hiding this comment.
Hard-coding settingSources: ["user", "project"] means the server process will load host-level ~/.claude/* settings and project .claude/* files for every session. In web mode (where the server can bind to non-loopback), this can unintentionally apply/possibly expose host-specific CLAUDE.md memory, Skills, or slash commands to any authenticated client. Consider making settingSources configurable (e.g. via providerOptions.claudeAgent) and/or defaulting to a safer value (like only "project", or only enabling "user" in desktop mode).
|
Can confirm after using this branch this does fix the issue and the claude adapter pulls in proper skills and memory. |
Summary
Adds
settingSources: ["user", "project"]to Claude Agent SDK query options so that filesystem-based Claude Code features are loaded:.claude/skills/and~/.claude/skills/).claude/commands/and~/.claude/commands/)Per the SDK docs, the SDK does not load any filesystem settings by default —
settingSourcesmust be explicitly configured.Test plan
~/.claude/skills/and verify it's available in t3code Claude sessionsCLAUDE.mdin a project directory and verify Claude reads it.claude/commands/Fixes #1283
Note
Add
settingSourcesto Claude query options to load Skills, Commands, and CLAUDE.mdAdds
settingSources: ["user", "project"]to thequeryOptionsobject constructed inmakeClaudeAdapterin ClaudeAdapter.ts. This tells the Claude API to load user and project-level settings, enabling Skills, Commands, and CLAUDE.md to be picked up during queries.Macroscope summarized eaaa088.