In Claude Code, how do skillOverrides and a Skill(deploy) deny rule differ when you must keep Claude from invoking a shared repo's /deploy skill?
answer
- visibility versus permission
- four override states
- typable but unseen
- exact name or prefix with arguments
- plugins are out of reach
basics
~20 sskillOverrides changes what is listed: user-invocable-only hides /deploy from Claude while you can still type it, and off hides it everywhere. A Skill(deploy) deny rule is a permission rule that blocks Claude's Skill tool call itself.
solid answer
~40 sThey work at different layers. `skillOverrides` is a settings map from skill name to a visibility state: `"user-invocable-only"` (shown as user-only in `/skills`) removes the skill from Claude's listing but keeps `/deploy` typable, and `"off"` hides it from Claude and from the `/` menu. The `/skills` menu writes it to `.claude/settings.local.json`, and it never applies to plugin skills. A deny rule such as `Skill(deploy *)` is a permission rule on the `Skill` tool: Claude's call is refused whatever the listing shows. `Skill(name)` matches exactly and `Skill(name *)` is a prefix match with any arguments; since v2.1.260 a deny on the unqualified name also covers a nested `apps/web:deploy`, and `Skill(skill:deploy)` matches the skill under any of its names. Use the override for your own view, the deny rule when a team policy must hold.
code
json · 9 lines{
"skillOverrides": {
"deploy": "user-invocable-only",
"legacy-context": "off"
},
"permissions": {
"deny": ["Skill(deploy *)"]
}
}go deeper
Recall that settings can hide a skill from Claude without editing its file, and that the /skills menu does it for you.
Explain the four skillOverrides states and what each does to Claude's listing and to the / menu.
Show you choose the layer deliberately: a visibility override for personal preference, a Skill deny rule in shared or managed settings for team policy, with exact-versus-prefix matching right.
Decide how far skill policy should be centralised in managed settings versus left to developers, given plugin skills sit outside skillOverrides altogether.
## Two layers that look alike When a skill is checked into a shared repository, you often cannot edit its `SKILL.md` to add `disable-model-invocation: true`. Claude Code offers two settings-side controls, and they answer different questions: - **`skillOverrides`** decides **what Claude and the `/` menu see**. It is visibility. - **`Skill(...)` permission rules** decide **whether Claude's call to the `Skill` tool is allowed**. They are permissions. ## `skillOverrides`: visibility from settings Each key is a skill name and each value is one of four states: | Value | Listed to Claude | In the `/` menu | |---|---|---| | `"on"` | Name and description | Yes | | `"name-only"` | Name only | Yes | | `"user-invocable-only"` | Hidden | Yes | | `"off"` | Hidden | Hidden | - A skill absent from the map is treated as `"on"`. `"name-only"` exists to save listing space and is not an invocation control. - `"user-invocable-only"`, labelled **user-only** in the `/skills` menu, is the settings-side counterpart of `disable-model-invocation: true`: Claude does not see the skill, and you can still type `/deploy`. - `"off"` also hides the skill from the command lists offered to Remote Control clients and Agent SDK callers. Invoking a hidden skill by its full name returns the `skillOverrides` error instead of running it. - You rarely write it by hand. In `/skills`, highlight a skill, press `Space` to cycle its state, and `Esc` to save to `.claude/settings.local.json`. - **Plugin skills are not affected**; manage those through `/plugin`. - In user, project and local settings, entries match **skill names only**. An entry for `review` there does not reach the bundled `/code-review` through its `/review` alias. Alias keys apply only in managed settings or a file passed with `--settings`, and only ever to restrict. ## `Skill(...)` rules: permission on the Skill tool Claude invokes skills through the `Skill` tool, so ordinary permission rules apply to it: 1. `Skill` on its own, as a deny rule, stops Claude invoking any skill. 2. `Skill(deploy)` matches the name exactly; `Skill(deploy *)` is a prefix match that covers any arguments. The docs use the prefix form in their deny example. 3. Since **v2.1.260**, a deny rule on an unqualified name also blocks a nested skill listed as `apps/web:deploy`. 4. The parameter form `Skill(skill:deploy)` matches the skill under **any** of its names, including an alias and a display name. 5. Allow rules match only the skill's own name and the name in Claude's call. To approve a skill synced from claude.ai, name it inside its namespace, as in `Skill(anthropic-skills:pdf)`. Because a deny rule is a permission rule, the usual settings-scope behaviour applies, including that a deny in any scope wins; the permission-rule material covers that precedence. ## Choosing between them - **A personal preference** ("I don't want Claude reaching for this"): set `"user-invocable-only"` through `/skills`. It is local, reversible, and keeps `/deploy` one keystroke away. - **A team or organisation policy** ("Claude must not start deploys"): add `Skill(deploy *)` as a deny rule in shared or managed settings. `skillOverrides` is accepted in any settings file too, but it changes what Claude is shown; the deny rule is a permission check on the call itself, and its alias and nested-name coverage is spelled out in the docs. - **A hard stop on the deploy itself**: neither control governs the shell commands a skill describes. Permission rules on those commands, or a hook, do that. ## Verifying what is in effect 1. Open `/skills` and find the skill: the state you set shows next to it, with `"user-invocable-only"` shown as user-only. 2. Type `/` and confirm whether the skill is still offered to you; under `"off"` it is not. 3. Open `/permissions` and check that the `Skill(deploy *)` deny rule sits in the scope you intended, since that dialog lists rules by scope. 4. Ask Claude which skills are available and confirm `deploy` is not among them. ## Traps - Expecting `"user-invocable-only"` to stop you typing the command; it hides the skill only from Claude. - Expecting `skillOverrides` to hide a plugin's `deploy` skill; plugin skills are outside it. - Setting a `skillOverrides` entry for `review` in project settings and expecting the bundled `/code-review` to disappear; overrides there match skill names only, while a `Skill(review)` deny rule does block `/code-review` through its `/review` alias.
- You set deploy to "off" in skillOverrides, yet Claude still uses a deploy skill from a plugin. Why?`skillOverrides` does not apply to plugin skills; plugin skills are managed through `/plugin`. They are also namespaced, as `/plugin-name:deploy`, so they are a different skill from the repository's `deploy`. A `Skill` deny rule on its namespaced name is the settings-side way to refuse the call.
- Does a Skill(deploy) deny rule cover a nested skill listed as apps/web:deploy?Yes, from v2.1.260: a deny rule on an unqualified name also blocks the directory-qualified nested skill. Before that it did not. `Skill(skill:deploy)` goes further and matches the skill under any of its names, including an alias or display name.
- "user-invocable-only" also stops you typing /deploy.
- skillOverrides hides plugin skills the same way it hides project skills.
- skillOverrides has to be written into settings.json by hand.
- A skillOverrides entry for review in project settings also hides the bundled /code-review.
- A visibility override and a Skill deny rule are interchangeable layers for team policy.
Assumes Claude Code 2.1.286; since v2.1.260 an unqualified Skill deny rule covers nested directory-qualified skills, and managed skillOverrides keys on a bundled skill's alias apply.