A skill that runs on its own shouldn’t stop to ask you questions. Skills can take tools away from Claude for the length of a run, and it takes one line of frontmatter.
---
name: nightly-cleanup
description: Tidy generated files without asking questions
disallowed-tools: AskUserQuestion
---
The disallowed-tools field lists tools that are removed from Claude’s available pool while the skill is active. The docs use AskUserQuestion for a background loop as their example of a tool an autonomous skill should never call. The value accepts a space- or comma-separated string, or a YAML list.
The restriction is temporary. It clears when you send your next message, so it doesn’t leak into the rest of the conversation. The sibling field allowed-tools behaves the same way, as it grants tools without a prompt only for the turn that invokes the skill.
A caveat: like deny rules, the field can’t remove EndConversation while any other tool remains. The skill name and description in my example are made up, so replace them with your own.
If you want a restriction for the whole session instead of one skill, the command-line flag --disallowedTools does that. Settings files can hold deny rules too.
This looks like the tidier option to me for skills you wire into a schedule or a loop, because the rule lives in the skill file next to the instructions it protects.
Further reading: Claude Code docs: skills frontmatter reference
Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more