disable-model-invocation: the flag that keeps my deploy skills out of Claude's hands
- context-engineering
- agent-ops
disable-model-invocation: true is one line in a Claude Code skill's frontmatter.
It stops Claude from running that skill on its own. You can still run it by typing
/skill-name. The default is false, so a new skill is open to the model until
you say otherwise.
---
name: send-newsletter
description: Send the weekly newsletter to the full list
disable-model-invocation: true
---
Put the line on any skill with side effects. Mine are deploys, email sends and ad
spend. Anthropic's own examples are /commit, /deploy and /send-slack-message.
Updated November 2026. Copilot CLI and opencode 2 now read the flag, so their rows in the agent table changed. In October the short answer moved to the top. On 28 September I added why a changed flag does not take effect. On 30 August the flag count here moved from 0 to 8. The docs gained two budget settings. A new section covers Cursor, VS Code Copilot, Zed, Codex and opencode.
There is a frontmatter field in Claude Code skills that decides something more
interesting than it sounds: whether the model is allowed to run a skill on its own,
or whether it fires only when a human types the command. It is called
disable-model-invocation, it defaults to false, and when I first audited my own
setup I could report a number that should worry anyone with an operational skill
library: out of 54 skills on this machine, the count with the flag set was zero.
Including the one that spends ad budget.
- What the flag does. One line,
disable-model-invocation: true, closes every model-driven path to a skill. It still works when you type/name. - Who it is for, and where. The docs name the category outright: workflows with side effects, like commit, deploy, or sending a message. Cursor, Zed and VS Code Copilot, Copilot CLI and opencode 2 read the same line. Codex does the job elsewhere.
- The audit. 55 skills with a SKILL.md on this machine today, 18 of them touch something live: deploys, email sends, ad spend, production panels. Flags set at the first audit: 0. Flags set now: 8, added in one sitting.
- The criterion. Not how often a skill runs. The blast radius of the one time it runs when you did not mean it to.
- The limit. The flag controls skill invocation, not capability. It is not a security boundary. Treating it as one is a mistake. That mistake gets its own section below.
The setup this audit ran against lives in Claude Code, the same config whose 26 shouted rules I sorted in the CLAUDE.md audit two days earlier. This flag is the natural next move after that sort, which is exactly why it got the next slot.
What does disable-model-invocation actually do?
By default either side can invoke any skill. You type /skill-name. The model decides the skill matches your request. The official docs keep the restriction short. Set disable-model-invocation: true and only you can invoke the skill. Their examples are commit, deploy, and send-slack-message, with a
sentence I would frame and hang above every agent workstation: you do not want
Claude deciding to deploy because your code looks ready.
---
name: deploy
description: Deploy the application to production
disable-model-invocation: true
---
The flag reaches further than the current session. Per the docs it also keeps the skill from being preloaded into subagents, and since v2.1.196 it stops the skill from running when a scheduled task fires with the skill as its prompt. The mechanism is a blockade, not a blindfold. The docs describe the flagged state as "description not in context, full skill loads when you invoke". Elsewhere they say the line removes the skill from Claude's context entirely. What if the model tries the Skill tool anyway? The runtime refuses the call. So the line does not mean "ask me first". It means the model-driven paths to this skill are closed, with one honest caveat covered in its own section below.
There is a mirror field, user-invocable: false. It covers the opposite case. Think of background knowledge the model should load when relevant. Nobody would type it as a command. Together the two fields give me three lanes. Some skills either of us can trigger. Some only I trigger. Some only the model triggers. Set both and nothing can start the skill. Claude Code's docs do
not spell out that fourth cell; VS Code's docs do, and call it a disabled skill.
user-invocable vs disable-model-invocation: which one hides what?
The two names invite the wrong guess, and the docs now carry a note written for
exactly that guess: with user-invocable: false you cannot invoke the skill, but
Claude still can. To keep Claude from invoking it through the Skill tool, you set
disable-model-invocation: true. The note is there for a reason. In January 2026 someone filed a documentation issue about this trap. They called it a shadow tool. The command is gone from your / menu. The model can still run it on its own.
The docs table sums it up best. With disable-model-invocation: true you can invoke the skill and Claude cannot. Its description stays out of context. user-invocable: false is the reverse. You cannot invoke the skill. Claude can. The description is always in context. The first flag is about safety and budget. The
second is a UI setting that hides a command from humans.
One find from my own disk: of the 55 skills, one installed diagram skill carries
user_invocable: true, underscore instead of hyphen. The documented key uses a
hyphen. Nothing warned me, and since true is the default anyway, the typo changes
nothing. Had it been false, the author would believe the skill was hidden while
it sat in my / menu. Cheap check, one grep: frontmatter keys with underscores
where the docs use hyphens.
How skill listings spend your context budget
The flag has a second effect that has nothing to do with safety, and it is the one that surprised me in the docs. Claude Code loads a listing of skill names and descriptions into context so the model knows what exists. That listing has a budget: it scales at 1 percent of the model's context window. Every skill name is always listed, but when the descriptions overflow the budget, Claude Code starts dropping them, least-used skills first, and a skill without its description is a skill the model can no longer match well.
Which means every operational skill sitting in the auto-invocable lane is not just
a risk, it is also crowding the listing that the skills the model should invoke
depend on. At the first audit all 54 of my skills rode in that listing. Today the
eight flagged ones are out of it, and I measured what that removed: 1,745
characters of descriptions, between 153 and 333 per skill. /doctor reports the
listing's context cost and its biggest contributors, which makes this measurable
instead of theoretical. The other live gauge is the
status line, which shows the window's
used_percentage after every message. The same budget logic applies one layer out, to tools: every
connected server puts its tool descriptions into the same window, which is why
the eight MCP servers I keep connected are eight and not
eighty.
Two levers the docs added since I first wrote this. The budget itself is now a
setting, skillListingBudgetFraction (0.02 means 2 percent), or a fixed character
count through the SLASH_COMMAND_TOOL_CHAR_BUDGET environment variable. And each
entry is capped at 1,536 characters of description plus when_to_use regardless
of budget, configurable with skillListingMaxDescChars, so the key use case belongs
in the first sentence. For skills that are rare but harmless there is still the
dedicated lever for pure trimming, skillOverrides set to name-only, which drops
a description without touching invocation. The flag is for side effects; name-only
is for noise.
The audit: 55 skills, 18 with side effects, zero flags, then eight
The same grep-first method as the CLAUDE.md sort, and the same embarrassing first result. A word on the count. The CLAUDE.md audit reported 55 skills on disk. The first version of this post counted 54 with a SKILL.md and one empty shell. Today all 55 directories carry a SKILL.md. So the base is 55. I read the frontmatter descriptions and sorted for side effects. A side effect here means the skill's happy path changes something outside my repo. That covers a deploy, an email or message to a human, and ad spend. It also covers a write to a production panel or tracker, and publishing a tag container.
That bucket holds 18 skills. Among them: one that operates a platform which spends
real ad budget, one that mutates campaigns in a live tracker, one that publishes
tag manager containers to production, several that operate admin panels of paid
services, and one that can send email. At the first audit every single one was
model-invocable, because disable-model-invocation appeared in exactly zero of my
files.
In fairness to past me: most of those 18 have their own internal guardrails, read-only defaults, explicit confirmation steps written into the skill body. But those guardrails live in prose the model is supposed to obey after loading the skill. The flag sits one layer earlier. It is structural. The runtime refuses the invocation before any prose gets a vote.
Two weeks later eight of the 18 carry the flag. I added all eight the same afternoon. The file timestamps agree to the second. The eight are the two ad
platform operators, a third ad-buying platform, the email platform, the CRM that
sends campaigns, the site deploy that also publishes a tag container, a production
panel operator, and a bridge that ships data to an outside analysis service. Ten
are still in the auto lane, including the live tracker operator from the list
above. That is the next block. When it lands, this paragraph goes stale again. I cannot report a /doctor before-and-after. I did not run it before the flags went in. So the reclaimed budget above comes from the files, not from the command.
Which skills get the flag: the blast-radius test
Frequency is the first criterion that comes to mind. It is also the wrong one. Picture a deploy skill you run daily. Now picture a domain-transfer skill you touch twice a year. Both belong in the manual lane. The test is not how often the skill runs. It is what the worst mistimed invocation costs.
The sort I ran, in the order the questions eliminate skills:
- Does the happy path mutate anything outside the repo? Money, messages, production state, DNS, live campaigns. Yes: flag it. This caught my 18.
- Is the skill a procedure I would want to schedule or chain someday? The flag also blocks scheduled-task triggers and subagent preloading. A subagent cannot load a flagged skill via the model-driven Skill tool either. So a skill that needs to run from a cron trigger, be preloaded into a subagent, or be invoked by the model inside a subagent needs the flag off, with a real permission or hook gate in its place.
- Everything else stays auto-invocable. Here the flag's second effect kicks in. With all 18 out of the listing, the other 37 keep fuller descriptions when the budget gets tight. Today the count is 8 out and 47 in.
The 18 in my case: every deploy and publish path, everything that touches ad platforms, everything that can send to a human, and the panel operators for paid services. Knowledge bases, research helpers, formatters and read-only reporters stay in the model's hands. They earn their keep there.
What does "cannot be used with Skill tool due to disable-model-invocation" mean?
That sentence is the runtime doing its job. The Skill tool refused a model-driven invocation of a flagged skill. The full line reads Error: Skill <name> cannot be used with Skill tool due to disable-model-invocation. Three situations produce it.
The first is the intended one. The model decided a flagged skill matched your request and reached for it. Blocked, correctly, and the model is left to do the work another way or ask you.
The second is a subagent. Inside a subagent, the model-driven Skill tool cannot load a flagged skill, even when the parent agent named it explicitly; a bug report from April 2026 (Claude Code 2.1.92) describes this, though the report being closed as not planned isn't proof of deliberate design. The exception is when the user manually invokes a skill with context: fork in the main session: Claude Code then runs that skill in a new subagent. If a flagged skill needs to be loaded by the model inside an already-running subagent, the flag comes off and a real gate goes in.
The third is the one that will annoy you. An open report from July 2026 describes
flagged skills disappearing from the listing so completely that typing /name
yourself is sometimes treated as an unknown command. The reporter's read is that
the listing omission collides with the model's instruction to only use listed
skills, and they noted the skill loads fine when the Skill tool is called with the
name directly. Plugin skill sets hit the same message and filed their own issues,
linked in the sources below. If you see the error after typing the command
yourself, you are looking at that report, not at a misconfiguration on your side.
Does disable-model-invocation work in Cursor, Copilot, Codex, opencode and Zed?
Someone reached this post by searching for opencode together with this flag, so here is the answer for the agents I could verify from their own documentation on 30 August 2026, not from memory. I rechecked Copilot CLI and opencode on 12 November 2026. The field is a Claude Code extension of the Agent Skills standard, not part of it: a proposal to standardize it has sat open since March 2026, with a maintainer noting that the specification "currently doesn't dictate activation conditions".
| Agent | Reads the line? | What its docs say |
|---|---|---|
| Claude Code | Yes | Originator. Also blocks subagent preloading and, since v2.1.196, scheduled-task triggers. |
| Cursor | Yes | "The skill is only included when explicitly invoked via /skill-name." Migrated slash commands get the flag automatically. No user-invocable. |
| VS Code (Copilot) | Yes | Both fields: disable-model-invocation defaults to false, user-invocable to true. A two-by-two matrix, and both set to disable means the skill is disabled. |
| Copilot CLI | Yes | The command reference lists both fields. disable-model-invocation will "Prevent the agent from automatically invoking this skill", default false. user-invocable defaults to true. |
| Zed | Yes | Add the line "to stop the agent from picking it up autonomously". The skill still appears as a slash command and an @-mention. |
| Codex | No, different mechanism | A policy.allow_implicit_invocation: false entry in a sidecar agents/openai.yaml. Explicit $skill still works. |
| opencode | Yes, in opencode 2 | The V2 docs give it "the same effect as" metadata.opencode/autoinvoke: false. The skill leaves the model's list but can still be loaded by ID, and opencode/autoinvoke wins if both are set. The 1.x docs still say "Unknown frontmatter fields are ignored." |
| Gemini CLI | No | A community support matrix from July 2026 finds a discovery flow but no documented suppression field. |
Two caveats from Cursor's community forum, both bug reports rather than docs: in
March 2026 plugin-delivered skills with the flag vanished from the / palette
entirely, and a later thread reports the flag ignored for skills under
.agents/skills/. The same support matrix credits Factory's Droid CLI and pi with
faithful implementations and lists Amp and Roo Code as having no equivalent. Do you share one skill folder across agents? Then the line is safe to leave in. Agents that do not read it ignore it. Agents that do read it agree on what it means.
Why disable-model-invocation changes do not take effect
If you flip the flag and Claude still invokes the skill, check three things before you file a bug.
First, which file actually has the edit. Skills resolve by location before name:
with a skill of the same name in both ~/.claude/skills/ and a project's
.claude/skills/, the personal one wins, per Claude Code's official docs.
Editing a project copy while a personal copy of the same name exists changes
nothing, because the personal one is the copy that resolves. My own setup has this
exact shape, the kind of location mix-up the CLAUDE.md audit ran into as well:
a personal skill and a separate vault mirror carry the same SHA-256, confirmed by
direct file comparison. That check only establishes the two copies match today. It
does not test which one Claude loads, whether either was reloaded, or how many
flags are set, so I am not using it to claim anything about invocation.
Second, frontmatter position. Per the docs, "Claude Code reads the frontmatter only
when the opening --- is the file's first line. Otherwise it treats the whole
file, --- markers included, as skill content." A leading blank line or comment
above the --- means disable-model-invocation is never parsed as a field at all,
regardless of what it says.
Third, whether the skill is already loaded. Per the docs, invoked skill content "enters the conversation as a single message and stays there across later turns," and "Claude Code does not re-read the skill file on later turns." If the skill was invoked earlier in the session, that copy of its instructions is already in context; the flag governs new invocations, not content already loaded. This is about the skill's instructions, not the flag's own effect on future Skill tool calls, which the runtime does check per invocation as the earlier section on the error message describes.
When in doubt, start a fresh session after editing, and confirm with ls -la or
equivalent which of the resolution locations the loaded
skill came from.
For a local creation and loading check, follow the Codex skills creation and discovery walkthrough.
What the flag does not protect
Here is the section that keeps this post honest. disable-model-invocation
controls whether the model can invoke a skill. It has no say over what the model can do. Say the model has shell access and your deploy is three commands. The model can still type those three commands and never touch the skill. The flag removes the paved road. The terrain stays.
So the flag is a context-engineering tool with a safety flavor. It is not a security boundary. The real boundaries have not moved. They are permission prompts on dangerous tools and hooks that gate production patterns. The rest are objects that ship paused. And approval steps a human has to click. I keep those as hard production gates, and nothing in this post replaces one of them. What the flag buys is real but narrow: it makes the intended workflow the convenient one, and it takes the "the model helpfully ran my deploy skill" failure mode off the table.
How do I turn off skills in Claude Code?
Three levels, from the docs, depending on how much you want gone.
One skill, without editing its file: the skillOverrides setting. It has four states: on, name-only, user-invocable-only and off. The /skills menu writes it for you. Highlight a skill, press Space to cycle, then Esc to save into .claude/settings.local.json. Use user-invocable-only when a skill lives in a shared repo you should not touch. It gives you the flag's effect. Plugin skills ignore this setting. You manage those through /plugin.
One skill you own: the flag, one line in the frontmatter. This post.
Every skill, for the model: deny the Skill tool in /permissions. Bundled skills go off with disableBundledSkills. The one exception is /doctor. It needs the DISABLE_DOCTOR_COMMAND variable or its own skillOverrides entry. This whole level is blunt. On a machine that only runs scheduled jobs it is sometimes the right answer.
Rules in prose vs flags in frontmatter
In the CLAUDE.md audit I sorted my hard rules into environment facts, gates, and behavior opinions, and landed on a distinction: a rule the setup should enforce does not belong in the prompt as persuasion. This flag is the cleanest example of that distinction I have found since. My config contains sentences instructing the model which operational procedures require explicit human approval. Those sentences are prose the model reads and, with very high probability, obeys. The flag is not prose. It is structure: the runtime refuses the invocation, and no amount of model enthusiasm changes that.
The pattern generalizes: every time you find yourself writing "never run X automatically" in a config file, check whether X has a mechanical switch. The sentence documents intent. The switch enforces it. You want both, but only one of them works when the model has a bad day.
To manage the components around that skill, manage the plugin that supplies the skill, including its installation scope and update path.
Set it in two minutes
The migration is almost insultingly small, which is part of the point.
- List your skills and grep for the flag. Mine, first time: 54 files, 0 hits, one command. Today: 55 files, 8 hits.
- Sort by blast radius, not frequency. Mutates something outside the repo means manual lane.
- Add
disable-model-invocation: trueto that set. It is one line per file. For a file you cannot edit, set the skill touser-invocable-onlyinskillOverridesinstead. - Run
/doctorbefore and after and compare the skill listing cost. The dropped descriptions are your reclaimed budget. I skipped the before. I regret that. - Watch for two regressions: a flagged skill you wanted the model to chain into via the Skill tool, and a flagged skill a child subagent tries to load via the Skill tool. Disabling the flag permits either path, but you still need a real permission or hook gate. A user-invoked
context: forkskill is a separate case and does not require removing the flag.
Steps 3 through 5 are done on eight of my 18, and the remaining ten are the next block. The flag count in this post will be stale again soon after. That is the correct kind of stale.
The verdict
One line of frontmatter turned out to test the whole rules-vs-gates argument. The flag does two unrelated jobs. It keeps side-effect skills out of the model's hands. It also stops their descriptions from crowding a context budget. I did not know that budget had a number until I read the docs. The first audit found zero of 54. Two weeks later it is eight of 55. That took 1,745 characters of descriptions out of the listing. Ten skills are still to go. One part does not change. The flag narrows an entry path. It does not build a wall. The walls are still permissions, hooks, and things that ship paused.
Sources, all read on 30 August 2026: the skills page in
Claude Code's official docs, sections on
invocation control, the listing budget and skillOverrides; the skills docs of
VS Code,
Cursor, Zed,
Codex and
opencode (now under /v1/); the
GitHub Copilot CLI skills page;
the community
support matrix
dated 8 July 2026; the Agent Skills
standardization proposal;
Claude Code issues
#19141,
#43809 and
#78523; and the
plugin-side reports in obra/superpowers
#189,
#222 and
#345. Rechecked on 12 November 2026: the
Copilot CLI command reference
and the opencode 2 skills docs.