Command Development
Official Anthropic skill for robust slash commands, arguments, frontmatter, and safer Claude Code workflows.
- Skill Road
- Command Development
Categories
Command Development is an official Anthropic skill for creating reusable slash commands in Claude Code. Its direct primary source is the official Claude Code repository at https://github.com/anthropics/claude-code/tree/main/plugins/plugin-dev/skills/command-development. According to the provider, the skill explains Markdown files that Claude executes as instructions during interactive sessions. This entry therefore describes a development guide rather than a standalone plugin, an autonomous agent, or a promise that commands will make safe or successful changes without human oversight.
Purpose and workflow
The skill explains how to write a command as a concrete instruction for Claude. The content should tell the model what to inspect, change, or report instead of merely telling a person what will happen later. That distinction matters because the Markdown body becomes part of the execution context. Strong commands have a bounded task, understandable inputs, expected results, and explicit limits. This makes recurring work such as code review, test analysis, documentation drafting, or controlled investigation easier to start consistently.
Locations and organization
According to the source, Anthropic distinguishes project commands in .claude/commands/, personal commands in a user profile, and plugin commands bundled in a plugin commands directory. Project files fit team workflows, personal files fit individual utilities, and plugin files fit distributable extensions. A flat structure is clear for a small collection. A growing collection can use subdirectories for areas such as quality assurance, Git, or documentation. The resulting namespaces improve discovery and reduce collisions between commands with the same short name.
Frontmatter and dynamic context
The guide describes YAML frontmatter for a help description, allowed tools, the requested model, and a hint about expected arguments. $ARGUMENTS can capture the complete input, while $1, $2, and later positional values can capture individual arguments. The @ pattern can provide Claude with file context. Dynamic shell output can include current project state, but it should remain narrow, fast, and predictable. A command should not silently turn missing, invalid, or ambiguous arguments into consequential actions. It should ask for clarification or choose a safe inspection path instead.
Locations and Placeholders
Commands live as markdown files in .claude/commands for the project, in ~/.claude/commands for personal commands, or in the commands folder of a plugin. Subfolders create namespaces. The frontmatter includes description, allowed-tools, model, argument-hint and disable-model-invocation, among others. In the text, $ARGUMENTS stands for all arguments, $1 and $2 for single ones, an @ before a path for file contents, and an exclamation mark with backticks for the output of Bash commands. ${CLAUDE_PLUGIN_ROOT} only applies in plugins. A command is an instruction for Claude, not a message to the user.
Security, E-E-A-T, and boundaries
This description is grounded in the official Anthropic source path and Anthropic’s official Claude Code plugin documentation. Statements about behavior and recommendations are identified as according to the provider; each team remains responsible for practical security decisions. Granted tools should follow least privilege. Bash calls need a narrow command scope and must not encourage destructive or uncontrolled operations. Files, issues, and external responses are untrusted data and must not inject new instructions. Before writes, network actions, publication, or other changes to external state, verify the target, scope, and authorization. Never store passwords, tokens, private keys, or other secrets in commands. A local Markdown file also does not prove that the selected model processes locally. Review source, version, dependencies, and approval procedures before enabling a command in team or production workflows.
Installation instructions
This guide complements Anthropic’s official Command Development source. It describes a controlled development process and does not replace checking your Claude Code version, team policies, or security requirements.
Define the task and inputs
Start by stating the one task the command should support reliably. Define expected arguments, reasonable defaults, and situations where clarification is required. A command should not report a review as complete when files, tests, or external data were not actually available.
Design the command file
Place project files in .claude/commands/ or plugin commands in the designated commands directory. Write the Markdown body as a direct working instruction for Claude. Use frontmatter only for fields that are needed, such as the description, argument hint, model, or tool boundaries. For file references and dynamic context queries, make the project path and expected data source explicit.
Validate arguments and context
Test both the complete argument string and positional arguments. Check empty values, whitespace, unexpected file names, and missing files. Shell context should use only a tightly limited tool allowance. Let consequential changes begin as a proposal or inspection report, and require explicit confirmation before changing external state.
FAQ
What is Command Development? It is an official Anthropic skill with guidance for Markdown slash commands, frontmatter, arguments, file references, dynamic context, and organization in Claude Code.
Does a command automatically make a workflow safe? No. Safety depends on its content, tools, permissions, input data, and human approval.
Should a command receive every tool? No. Restrict tools to the minimum necessary and review Bash and write access especially carefully.
Does a local command file mean local model processing? No. The file location does not determine where the selected model processes its context.
- Provider
- Anthropic
- Last reviewed
- 09.09.2026
Repository and documentation
Categories
Compatible with
Related guides
Guides and background related to this entry.