anthropics / anthropics/claude-agent-sdk-python

Inconsistent behavior of disable-model-invocation: true between Claude Code and Agent SDK

Aperta
#814 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
8.1k
Fork
1.3k
Merge medio
2g 31m
PR unite (30g)
1

Descrizione

I have observed a discrepancy in how `disable-model-invocation: true` is handled in custom Skills slash command. When using the same command configuration in the Claude Code, it executes as expected. However, when triggering the same command via the Claude Agent SDK, the command fails to invoke or produces no result.

It appears the SDK enforces the `disable-model-invocation` flag strictly, preventing the agent from triggering the skill, whereas Claude Code seems to have an alternative execution path for these commands.

**Environment:**
- SDK Version: 0.1.58
- OS: macOS 26.1
- Python version: 3.12.9

**Reproduction Steps:**
1. Create a custom skill file (e.g., `.claude/skills/test-cmd/SKILL.md`).
2. Add the following YAML frontmatter:
```yaml
---
disable-model-invocation: true
---
# Content here
```
3. Attempt to call this skill via the SDK using the `query` method.
4. Observe that the command does not execute or returns an error/no result, whereas running `/test-cmd` in Claude Code works correctly.

**Expected Behavior:**
The SDK should handle commands with `disable-model-invocation: true` consistently with Claude Code, or there should be a supported way to trigger these commands via the SDK without model invocation interference.

**Actual Behavior:**
The command is effectively disabled or ignored in the SDK context.

Thanks for helping.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.