Description
When passing a prompt that starts with / (e.g. /eck:new-project) to query(), the SDK returns "Unknown skill" immediately ($0.00 cost, 2ms) instead of resolving the skill from ~/.claude/skills/ or project-level .claude/skills/.
The same skill works correctly when invoked via claude --print -p '/eck:new-project' directly.
Steps to Reproduce
from claude_agent_sdk import ClaudeAgentOptions, query, ResultMessage
async def test():
options = ClaudeAgentOptions(
cwd='/home/tester',
permission_mode='bypassPermissions',
cli_path='/home/tester/.local/bin/claude',
)
async for msg in query(prompt='/eck:new-project', options=options):
if isinstance(msg, ResultMessage):
print(msg.result) # "Unknown skill: eck:new-project"
print(msg.total_cost_usd) # 0.0
Expected Behavior
The SDK should resolve the skill from ~/.claude/skills/eck-new-project/SKILL.md, expand it, and execute the skill instructions — matching the behavior of claude --print -p '/eck:new-project'.
Workaround
Read the SKILL.md file manually and inject the content as system_prompt:
with open(os.path.expanduser('~/.claude/skills/eck-new-project/SKILL.md')) as f:
skill_content = f.read()
options.system_prompt = f"Execute the following skill:\n\n{skill_content}"
query(prompt="Execute the skill workflow now.", options=options)
Environment
- claude-agent-sdk: 0.1.51
- Claude CLI: 2.1.86
- Python: 3.12
- OS: Linux (Docker)
Description
When passing a prompt that starts with
/(e.g./eck:new-project) toquery(), the SDK returns "Unknown skill" immediately ($0.00 cost, 2ms) instead of resolving the skill from~/.claude/skills/or project-level.claude/skills/.The same skill works correctly when invoked via
claude --print -p '/eck:new-project'directly.Steps to Reproduce
Expected Behavior
The SDK should resolve the skill from
~/.claude/skills/eck-new-project/SKILL.md, expand it, and execute the skill instructions — matching the behavior ofclaude --print -p '/eck:new-project'.Workaround
Read the SKILL.md file manually and inject the content as
system_prompt:Environment