-
Notifications
You must be signed in to change notification settings - Fork 329
Description
Summary
Agent Skills are not auto-discovered by the Claude Agent SDK on Linux systems. Investigation reveals the SDK is looking for skills using hardcoded
macOS paths (/Users/...) instead of using the environment's actual home directory.
Environment
- OS: Linux (Arch, kernel 6.17.2-arch1-1)
- Python: 3.10+
- Agent SDK: claude-agent-sdk (latest)
- Model: claude-sonnet-4-5-20250929
- Home Directory: /home/slzatz
Expected Behavior
According to the https://www.anthropic.com/news/skills:
"You can also manually install skills by adding them to ~/.claude/skills. The Claude Agent SDK provides the same Agent Skills support for building
custom agents."
Skills placed in ~/.claude/skills/ should be auto-discovered and loaded by the Agent SDK.
Actual Behavior
- Skills in ~/.claude/skills/sonos-control/ are not auto-discovered
- The <available_skills> section remains empty
- When explicitly asked to check for skills, the agent searches incorrect paths:
- /Users/chriscohoat/.claude/skills/ (appears to be Anthropic dev's machine)
- /Users/slzatz/.claude/skills/ (correct username, wrong path format)
- Never checks: /home/slzatz/.claude/skills/ (correct Linux path)
Evidence
When asked "Did you look at the sonos-control skill that is in ~/.claude/skills?", the agent attempted:
🔧 [TOOL] Glob(pattern='**/.claude/skills/sonos-control*')
🔧 [TOOL] Read(file_path='/Users/chriscohoat/.claude/skills/sonos-control.md')
🔧 [TOOL] Read(file_path='/Users/slzatz/.claude/skills/sonos-control/SKILL.md')
However, echo $HOME correctly returns /home/slzatz, showing the agent knows the correct home directory but doesn't use it for skills.
Reproduction Steps
- Create a skill at ~/.claude/skills/my-skill/SKILL.md:
name: Test Skill
description: A test skill for reproduction
Test content
- Create Agent SDK client with setting_sources=["user"]:
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions
options = ClaudeAgentOptions(
setting_sources=["user"],
system_prompt="You are a helpful assistant."
)
client = ClaudeSDKClient(options=options)
- Ask the agent to check for skills in ~/.claude/skills/
- Observe: Agent searches macOS paths instead of Linux paths
Configuration Attempts (None Worked)
We tried:
- ✗ cwd=project_root in ClaudeAgentOptions
- ✗ setting_sources=["project"] for project-level skills
- ✗ setting_sources=["user"] for user-level skills
- ✗ Both project location (.claude/skills/) and user location (~/.claude/skills/)
Additional Notes
- The Skill tool exists in the SDK but returns empty when invoked
- Manual file reading of ~/.claude/skills/sonos-control/SKILL.md works when the agent is explicitly told the path
- This suggests the skill infrastructure exists but the discovery mechanism is broken on Linux
- The hardcoded /Users/chriscohoat/ path suggests development environment code leaked into production
Impact
This prevents Linux users from using Agent Skills with the Agent SDK as advertised, despite the announcement stating "The Claude Agent SDK provides the same Agent Skills support for building custom agents."
Suggested Fix
The skills discovery mechanism should use os.path.expanduser('~/.claude/skills') or equivalent cross-platform path resolution instead of hardcoded
macOS paths.