anthropics / anthropics/claude-agent-sdk-python

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

Aberta
#814 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
8.1k
Forks
1.3k
Merge médio
2d 31min
PRs com merge (30d)
1

Descrição

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.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.