{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/claude-code/command/latest.json",
  "title": "Claude Code Command",
  "description": "Frontmatter schema for Claude Code custom slash commands (`.claude/commands/*.md`). Commands are the **legacy format** for [skills](https://code.claude.com/docs/en/skills) — they support identical frontmatter fields and behavior. New projects should prefer the skill format (`.claude/skills/*/SKILL.md`) for better organization and support for companion files. A file at `.claude/commands/review.md` and a skill at `.claude/skills/review/SKILL.md` both create `/review` and work the same way. If a skill and a command share the same name, the skill takes precedence. Use `$ARGUMENTS`, `$ARGUMENTS[N]`, or `$N` for argument substitution in the body.",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lintel-rs/catalog/master/schemas/claude-code/command.json",
    "sourceSha256": "8514dc467ede5ce6d7252f6adc8ec52314ba2faacd895628e753787c0621e2c8",
    "fileMatch": [
      "**/.claude/commands/*.md",
      ".claude/commands/*.md",
      "**/commands/*.md"
    ],
    "parsers": [
      "markdown"
    ],
    "catalogDescription": "Frontmatter for Claude Code custom slash commands."
  },
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Display name for the command using lowercase letters, numbers, and hyphens only (max 64 characters). This becomes the `/slash-command` name. If omitted, defaults to the file name without extension (e.g. `review.md` creates `/review`).",
      "pattern": "^[a-z0-9][a-z0-9-]*$",
      "maxLength": 64,
      "examples": [
        "deploy",
        "fix-issue",
        "review-pr"
      ]
    },
    "description": {
      "type": "string",
      "description": "Describes what the command does and when to use it. Claude uses this to decide when to automatically load the command, so write it as a **triggering guide** — include concrete examples of user requests that should activate it. Command descriptions are always loaded into Claude's context so it knows they exist, but full command content only loads when invoked. If omitted, defaults to the first paragraph of the markdown body. Note: descriptions share a context budget (2% of the context window, minimum 16KB). Override with the `SLASH_COMMAND_TOOL_CHAR_BUDGET` environment variable.",
      "examples": [
        "Deploy the application to a target environment.",
        "Fix a GitHub issue by number. Use when the user provides an issue number.",
        "Review a pull request for quality and correctness."
      ]
    },
    "argument-hint": {
      "type": "string",
      "description": "Hint shown during `/` autocomplete to indicate expected arguments. Purely cosmetic — does not enforce argument structure. Arguments are accessed via `$ARGUMENTS`, `$ARGUMENTS[N]`, or `$N` in the markdown body.",
      "examples": [
        "[environment]",
        "[issue-number]",
        "[pr-number]"
      ]
    },
    "model": {
      "type": "string",
      "description": "Which [Claude model](https://code.claude.com/docs/en/model-config) to use when this command is active. If omitted, inherits from the current session.",
      "examples": [
        "sonnet",
        "opus",
        "haiku"
      ]
    },
    "allowed-tools": {
      "description": "Tools Claude can use **without asking permission** when this command is active. Built-in tools: `Read`, `Write`, `Edit`, `Bash`, `Glob`, `Grep`, `WebFetch`, `WebSearch`, `Task`, `Skill`. Supports patterns like `Bash(git *)` to allow only specific subcommands, or `Skill(commit)` to allow invoking a specific skill. MCP tools use the pattern `mcp__<server>__<tool>`. If omitted, all tools are available with normal [permission prompts](https://code.claude.com/docs/en/permissions). This field only grants auto-approval — it does **not** override denials.",
      "oneOf": [
        {
          "type": "string",
          "description": "Comma-separated list of tool names. Supports patterns like `Bash(git *)`."
        },
        {
          "type": "array",
          "items": {
            "$ref": "https://catalog.lintel.tools/schemas/claude-code/permission/latest.json"
          },
          "description": "Array of tool names."
        }
      ],
      "examples": [
        "Read, Grep, Glob, Bash",
        "Bash, Read",
        [
          "Read",
          "Grep",
          "Glob"
        ]
      ]
    },
    "disable-model-invocation": {
      "type": "boolean",
      "description": "When `true`, prevents Claude from automatically loading this command based on its description — the command's description is **not** included in Claude's context, so Claude will never know it exists unless the user invokes it. The command can only be triggered manually via its `/slash-command`. Use for manual-only workflows like `/deploy` or `/commit`.",
      "default": false,
      "examples": [
        true
      ]
    },
    "user-invocable": {
      "type": "boolean",
      "description": "When `false`, hides the command from the `/` autocomplete menu so users cannot invoke it directly. The command can still be loaded automatically by Claude based on its description. Use for background knowledge that Claude should apply silently.",
      "default": true,
      "examples": [
        false
      ]
    },
    "context": {
      "type": "string",
      "description": "Set to `fork` to run the command in an isolated [subagent](https://code.claude.com/docs/en/sub-agents) context instead of inline. When forked, the command's markdown body becomes the subagent's **task prompt**. The subagent runs in a separate conversation fork with its own context window — it does **not** have access to the main conversation history.",
      "enum": [
        "fork"
      ],
      "examples": [
        "fork"
      ]
    },
    "agent": {
      "type": "string",
      "description": "Which subagent type to use when `context` is set to `fork`. Built-in types: `Explore`, `Plan`, `general-purpose`. Can also be the name of a custom agent defined in `.claude/agents/`. Ignored if `context` is not `fork`. Defaults to `general-purpose`. See [built-in subagents](https://code.claude.com/docs/en/sub-agents#built-in-subagents).",
      "examples": [
        "Explore",
        "Plan",
        "general-purpose"
      ]
    },
    "hooks": {
      "$ref": "https://catalog.lintel.tools/schemas/claude-code/hooks/latest.json",
      "description": "Lifecycle [hooks](https://code.claude.com/docs/en/hooks) scoped to this command. Hooks defined here only fire when this command is active and are cleaned up when the command is unloaded. See [hooks in skills and agents](https://code.claude.com/docs/en/hooks#hooks-in-skills-and-agents)."
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
