In a Claude Code SKILL.md, how do disable-model-invocation: true and user-invocable: false differ, and which keeps a /deploy skill from running on its own?
answer
- two opposite switches
- who may start the skill
- is the description in context
- menu visibility is not a lock
- what Claude Code does when Claude tries
basics
~20 sdisable-model-invocation: true stops Claude invoking the skill and drops its description from context, while you can still type /deploy. user-invocable: false only hides it from you; Claude can still load it. /deploy needs the first.
solid answer
~40 sBy default both you and Claude can invoke a skill. `disable-model-invocation: true` makes it manual-only: Claude cannot invoke it on its own, its description is not in Claude's context, and the full content loads only when you type `/deploy`. If Claude tries anyway, Claude Code blocks the Skill call and tells Claude not to reproduce the steps another way, so it suggests you run `/deploy`. `user-invocable: false` is the opposite: it hides the skill from the `/` menu and typing `/name` does not run it, but Claude still sees the description and can load it. It suits background knowledge, never a guard. For a deploy that must never start by itself, set `disable-model-invocation: true`.
code
yaml · 13 lines---
name: deploy
description: Deploy the current branch to an environment
disable-model-invocation: true
argument-hint: "[environment]"
---
Deploy to $ARGUMENTS:
1. Run the test suite
2. Build the application
3. Push to the deployment target
4. Verify the deployment succeededgo deeper
Recall that by default both you and Claude can invoke a skill, and that disable-model-invocation: true is the switch for skills only you should start.
Explain the full table: who can invoke under each field, whether the description sits in Claude's context, and what Claude Code does when Claude tries a manual-only skill.
Show you know where the field stops: it blocks the Skill call, not the shell commands the skill describes, so a real deploy guard also needs permission rules or a hook.
Frame which team workflows should be manual-only at all, trading convenience against side effects, and how to apply that to shared repository skills without editing them.
## The default: both of you can invoke it A skill in Claude Code can start in two ways. **You** invoke it by typing `/name` at the start of a message. **Claude** invokes it through the `Skill` tool when the skill's description matches the work in front of it. With no invocation fields set, both paths are open: the description sits in Claude's context so it knows the skill exists, and the full `SKILL.md` body loads only when the skill is invoked. Two frontmatter fields close one path each. They look alike, and confusing them is the classic mistake. ## `disable-model-invocation: true` — only you can start it This field is for workflows with **side effects** or where you want to control the timing: a deploy, a commit, a message sent to a team channel. You do not want Claude deciding to deploy because the code looks ready. - Claude **cannot invoke the skill on its own**. Its default is `false`. - The skill's **description is not in Claude's context**, so Claude is not even prompted to consider it. The full content loads when you type `/deploy`. - If Claude tries anyway, **Claude Code blocks the Skill call** and instructs Claude not to reproduce the deploy steps another way. Expect Claude to suggest that you run `/deploy` yourself. - The skill is also **not preloaded into subagents** that list it. - You still see it in the `/` menu and can run it with arguments, as in `/deploy staging`. ## `user-invocable: false` — only Claude can start it This field is for **background knowledge** that is not a meaningful action for a person to take, such as a skill that explains how a legacy system works. - Claude Code **hides it from the `/` menu**, and typing `/name` does not run it. Its default is `true`. - Claude **still sees its description** and can load it whenever it is relevant. - It is **not a security control**. The docs say so explicitly: with `user-invocable: false` you cannot invoke the skill, but Claude still can; to keep Claude from invoking it, set `disable-model-invocation: true`. ## Side by side | Frontmatter | You can invoke | Claude can invoke | Description in Claude's context | |---|---|---|---| | (default) | Yes | Yes | Always | | `disable-model-invocation: true` | Yes | Not on its own | No, until you invoke it | | `user-invocable: false` | No | Yes | Always | ## Choosing for a `/deploy` skill, and where the field stops 1. Put `disable-model-invocation: true` in the deploy skill's frontmatter. This is the answer to the question. 2. If the skill lives in a shared repository and you do not want to edit its file, the `skillOverrides` setting with the value `"user-invocable-only"` is the settings-side counterpart: Claude doesn't see the skill, and you can still type it. 3. Remember what the field governs: Claude's **Skill tool call**. The instruction not to repeat the steps another way is exactly that, an instruction. If the deploy is a script Claude could run directly through Bash, only permission rules on that command, or a hook, decide whether the command itself can run. The permission-rule material covers writing those. Point 3 is the senior part of the answer. Claude Code enforces the invocation block; it does not turn the skill's body into a lock on every command the body mentions. ## When the field silently does nothing A manual-only setting that never took effect is worse than none, because everyone believes it is there: - **Misspelled field names are ignored without an error.** Field names must match the table exactly, hyphens included, so `disable_model_invocation: true` leaves the skill model-invocable. - **Unparseable YAML drops every field.** If the frontmatter between the `---` markers does not parse, the skill still loads with no fields set, so `/deploy` works and Claude can invoke it again. Run with `--debug` to see the parse error. - **Frontmatter must start on line one.** If the opening `---` is not the file's first line, the whole file, markers included, is treated as skill content. A quick check after editing: type `/` and confirm the skill is listed for you, then ask Claude which skills are available and confirm a manual-only skill's description is not among what it sees. ## Why interviewers ask it The two names read like synonyms, and the wrong one fails silently. A team that sets `user-invocable: false` on its deploy skill believing it made the skill safe has done the reverse: removed the human path and kept the automatic one. Candidates who reason from the table, rather than from the field names, get this right.
- Claude decides a deploy is needed, but the deploy skill has disable-model-invocation: true. What happens?Claude Code blocks the Skill call and instructs Claude not to reproduce the deploy steps another way, so Claude typically suggests you run `/deploy` yourself. The block covers the Skill call only; whether Claude could run the same shell commands directly is up to your permission rules.
- The deploy skill is checked into a shared repository and you cannot change its frontmatter. How do you get the same effect?Set it to `"user-invocable-only"` in the `skillOverrides` setting. Claude no longer sees the skill, and you can still type `/deploy`. The `/skills` menu writes this for you into `.claude/settings.local.json` when you cycle the skill's state.
- Why is the description's place in context part of the difference between the two fields?The description is how Claude learns a skill exists. With `disable-model-invocation: true` it is left out, so Claude is not prompted to use the skill and it costs nothing in the listing. With `user-invocable: false` it stays in context, because the whole point is that Claude can still load the skill when relevant.
- user-invocable: false stops Claude from running the skill on its own.
- disable-model-invocation: true also hides the skill from the / menu.
- A description saying 'never run automatically' is enough to keep Claude from invoking it.
- disable-model-invocation stops Claude running the deploy script through Bash as well.
- A new skill with no invocation fields can only be run by typing /name.