Claude Code skills

Skills package specialized workflows so Claude Code can follow a known procedure without reloading the full instructions from a prompt every time.

Last verified
Applies to
Claude Code 2.1.x. CLI spellings were checked on local version 2.1.198; official docs may describe newer 2.1.x behavior.
Verification method
Current skill layout, invocation controls, dynamic context, tool preapproval, and command migration were reviewed in official docs. No skill was loaded into a real project or invoked against a model.
Official sources
SkillsCommands referenceChangelog

Reproducible practice

Build a read-only skill and test its discovery boundary

Package a repeated repository-status procedure with explicit invocation and least-privilege tools.

Prerequisites

  • A unique temporary repository.
  • A procedure that is repeated and longer than a durable fact.
  • No untrusted command substitution or secret-bearing fixture.

Steps

  1. Create the skill fixture

    Use project scope and disable automatic model invocation while evaluating it.

    Step 1
    SKILL_LAB=$(mktemp -d "${TMPDIR:-/tmp}/claude-skill.XXXXXX")
    printf '%s\n' "$SKILL_LAB"
    cd "$SKILL_LAB" && git init -q
    mkdir -p .claude/skills/status-audit
    printf '%s\n' '---' 'description: Summarize repository status without editing.' 'disable-model-invocation: true' 'allowed-tools: Bash(git status --short)' '---' '' 'Run git status --short and report only observed changes.' > .claude/skills/status-audit/SKILL.md
  2. Check static structure

    Confirm frontmatter, filename, and command name before starting Claude.

    Step 2
    sed -n '1,12p' .claude/skills/status-audit/SKILL.md
    git status --short
  3. Inspect discovery

    Open `/help` and confirm `/status-audit`; optional interactive behavior was not tested in this audit.

  4. Test both invocation paths

    Invoke explicitly first. Enable model invocation only after a natural-language prompt selects the skill reliably and safely.

Expected result

The skill is discoverable by its directory name, can be invoked explicitly, and has no edit tool or automatic invocation during evaluation.

Validation

  • Confirm the allowed tool exactly matches the command used.
  • Compare `git status --short` before and after invocation.
  • Test non-matching prompts to detect over-triggering before enabling model invocation.

Failure handling

Skill does not appear

Check workspace trust, scope, `SKILL.md`, YAML, and description length.

Skill triggers too often

Narrow the description or keep `disable-model-invocation: true`.

Cleanup or rollback

  • Return to the original directory and remove only the printed SKILL_LAB path.
  • Remove a project skill through a reviewed commit; do not delete personal skills broadly.

Boundaries and when not to use it

  • Dynamic context commands execute before Claude sees the skill; treat them as code and review inputs.
  • Allowed tools reduce exposure but do not make untrusted instructions safe by themselves.

When to use a skill

Use a skill when a workflow repeats: code review, release notes, migration checks, incident analysis, design implementation, or repository-specific task handling.

What a skill should contain

A useful skill describes when it applies, what evidence to gather, what commands to run, what files to inspect, and what output shape is expected. It should avoid vague style guidance.

Skills and project memory

Project memory stores durable repository facts. Skills store repeatable procedures. Keeping those separate makes both easier to maintain.

Skill quality

A good skill is short enough to load, specific enough to guide action, and testable through a real task. If it requires many unrelated references, split it into narrower skills.

Minimal SKILL.md frontmatter
---
name: release-notes
description: Draft release notes from merged PRs and changelog entries.
---

# Release notes

1. Read CHANGELOG.md and recent git history.
2. Group changes by user impact.
3. Output a concise release summary.

Bundled and custom skills

Claude Code ships bundled skills such as code review, debug, and batch workflows. Custom skills live in project or user skill directories and behave like reusable slash commands.

/debug

Enable debug logging and analyze the current session log for runtime issues.

Read guide

/batch

Break a large migration into parallel worktree-based units with separate pull requests.

Read guide

Skill checklist

Related topics