anthropics / anthropics/claude-agent-sdk-python

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

Abierto
#814 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
8.1k
Forks
1.3k
Merge medio
2 d 31 min
PR fusionados (30 d)
1

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.