
How to Disable Automatic Agent Skill Invocation
By default, an AI agent can select a relevant skill based on its description. That is usually convenient: ask for a summary, and the agent finds the right instructions and follows them.
When I say automatic invocation, I do not mean running the skill when the application starts. I mean implicit invocation: the agent sees the skill description and can select it in response to a matching request.
Some workflows, though, I want to start manually. Examples include generating a daily log, handing context off between sessions, or running a retrospective. They create files, read a lot of context, or change the state of the workflow. I do not want the agent deciding when to run them.
This is not a security mechanism. The setting prevents automatic skill invocation, but it does not take away the agent's access to files, the shell, or the network. If you need a hard boundary, use the client's permissions, sandbox, or hooks.
Claude Code and Pi
In Claude Code and Pi, add one field to the SKILL.md frontmatter:
---
name: daily-log
description: Generate a daily work log.
disable-model-invocation: true
---
The skill remains available for manual use, but the model can no longer select it automatically.
In Claude Code, invoke it with:
/daily-log
In Pi:
/skill:daily-log
If the command is unavailable in Pi, make sure skill commands are enabled with enableSkillCommands: true.
There is a small bonus: Claude Code and Pi do not add the description of this skill to the initial context. The description and instructions are loaded only after explicit invocation.
In Claude Code, this setting goes a little further. It also prevents the skill from being preloaded into a subagent's context or from running when a scheduled task uses it as the prompt. Keep that in mind if you later decide to automate a manual workflow.
Codex
Codex uses a different mechanism. Create agents/openai.yaml next to SKILL.md:
daily-log/
├── SKILL.md
└── agents/
└── openai.yaml
Its contents:
policy:
allow_implicit_invocation: false
After that, Codex will no longer select the skill automatically. To invoke it explicitly, use:
$daily-log
You can keep disable-model-invocation in SKILL.md. Codex does not use it to control invocation. It follows the policy in agents/openai.yaml instead. This lets the same skill directory work across several agents.
Unlike Claude Code and Pi, the Codex documentation only guarantees that implicit invocation is disabled. Do not assume that the skill description will also disappear from the initial context.
This Isn't Part of the Shared Standard
Invocation control is not yet unified in the Agent Skills specification. The base standard defines the directory structure and core SKILL.md fields. Each environment adds its own invocation policy.
To make the same skill work in all three environments, I use both settings:
my-skill/
├── SKILL.md # Claude Code and Pi
└── agents/
└── openai.yaml # Codex
How to Verify the Setting
After making the change, start a new session. This is especially important in Pi because it scans skill directories at startup. Then run two checks:
- Give the agent a request that clearly matches the skill's
description. The skill should not activate. - Invoke the same skill manually. It should work as usual.
Claude Code usually detects changes to SKILL.md without a restart. Codex also watches for changes, but restart it if the new policy does not take effect.
When to Disable Automatic Invocation
Use this approach for workflows with side effects or strict timing: deployments, publishing, reports, digests, session handoffs, and memory maintenance. Cheap, reversible workflows with no external actions — documentation lookup, summaries, or Obsidian operations — can stay automatic.
My rule is simple: if a workflow is safe and reversible, the agent can select it automatically. If it changes external state, consumes significant resources, or must start at a specific time, keep it behind an explicit command.
Last checked. These settings were verified against the documentation on July 31, 2026.
Links: