anthropics / anthropics/claude-agent-sdk-typescript

skillOverrides "off" blocks invocation but doesn't hide skills from the model's skill listing

Aperta
#291 0 commenti 5 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Shell
Stelle
1.8k
Fork
226
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Summary

Setting `skillOverrides: { "": "off" }` (via the `--settings` CLI flag or the SDK `settings` option) correctly **blocks invocation** of the named skill at runtime, but **does not remove the skill from the listing** injected into the model's system prompt every turn.

The documented behavior is `"off" hides it from both [model and user]` (see `Settings.skillOverrides` JSDoc in `sdk.d.ts`), but only the invocation-time check honors it. The listing pass ignores the overrides, so:

- The model is told these skills exist, but any attempt to use them fails with `Skill is disabled`, which is confusing.
- There's currently no way to actually remove built-in skills from the listing.

## Environment

- `@anthropic-ai/claude-agent-sdk`: **0.2.114** (latest; `next` dist-tag also points here)
- Bundled `claude` binary: **0.2.114-darwin-arm64**
- OS: macOS (darwin-arm64)

## Reproduction

```ts
import { query } from '@anthropic-ai/claude-agent-sdk';

for await (const message of query({
prompt: 'List every skill available to you verbatim.',
options: {
settingSources: [],
permissionMode: 'bypassPermissions',
allowDangerouslySkipPermissions: true,
settings: {
skillOverrides: {
simplify: 'off',
review: 'off',
'security-review': 'off',
init: 'off',
'claude-api': 'off',
loop: 'off',
schedule: 'off',
'update-config': 'off',
'keybindings-help': 'off',
'fewer-permission-prompts': 'off',
},
},
},
})) {
console.log(message);
}
```

## Expected

The model reports no available skills (all 10 built-ins were set to "off").

## Actual

The model lists all 10 built-in skills (simplify, review, security-review, init, claude-api, loop, schedule, update-config, keybindings-help, fewer-permission-prompts) as available. Verified via a system-reminder block sent on first turn:

The following skills are available for use with the Skill tool:

- simplify: ...
- review: ...
- security-review: ...
(etc.)

If Claude then tries to invoke one, the invocation **is** correctly rejected with Skill is disabled — so the override is being read, just not applied consistently.

## Evidence (from bundled claude binary, 0.2.114)

The lookup function reads skillOverrides from flagSettings (i.e. the --settings flag):

```js
// simplified from the minified bundle
h6("flagSettings")?.skillOverrides?.[name];
if (K) return { value: K, source: "flag" };
// ... then policySettings, author disableModelInvocation, project, user
```

The invocation guard correctly honors "off":

```js
if (value === "off" || (value === "user-invocable-only" && !isUserInvoked(...))) {
return { result: false, message: `Skill ${name} is disabled` };
}
```

But the listing generator (internally d75 / By) filters only on:
1. Whether the Skill tool is in allowedTools, and
2. Dedup of skills already announced in prior turns.

It **never** calls the override resolver before adding a skill to the listing, which is why disabled skills still surface.

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.