What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a Claude Code skill when you want reusable instructions that can be invoked by name or selected automatically; use a .claude/commands/ file for a lightweight slash command you already rely on. For unattended scripts, use Claude Code’s -p mode with deliberate tool permissions. For GitHub events, configure Claude Code GitHub Actions—the slash command by itself does not create a CI workflow.

This guide answers how to create a custom slash command, how skills differ from commands, and how to automate Claude Code in GitHub Actions. Documentation changes frequently; details below were checked against Anthropic’s documentation on October 3, 2026. Confirm the current reference and your installed Claude Code version before adopting version-specific behavior.

Choose the right Claude Code automation method

These options solve different problems. A skill or command gives Claude reusable instructions; CLI print mode runs a non-interactive prompt; GitHub Actions connects Claude Code to repository events or a configured prompt.

Method Reuse scope How it starts Best fit
Skill in ~/.claude/skills/ Personal Named slash invocation or automatic selection, depending on its description and invocation controls A reusable personal workflow, especially one with supporting files
Skill in .claude/skills/ Project or team, when committed Named slash invocation or automatic selection, depending on its description and invocation controls Shared project instructions and repeatable workflows
File in .claude/commands/ Project command convention Slash command A simple prompt file or an existing lightweight command workflow
claude -p Whatever script or automation invokes it Non-interactive CLI call Shell scripts and other unattended jobs that need a prompt response
Claude Code GitHub Actions Repository and configured workflow Supported GitHub mention-triggered or prompt-driven operation Automation tied to GitHub activity or a configured repository workflow

For a practical decision, consider four things: who should reuse the workflow, whether it should run only when named or may be selected automatically, whether it needs a prompt alone or supporting resources, and whether it runs in an interactive terminal, a script, or response to a GitHub event. No one method is universally best.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How Claude Code skills differ from commands

A skill is organized around a SKILL.md file. That file contains YAML frontmatter between --- markers and Markdown instructions. The skill name—or its directory name—becomes its slash-command name, while its description helps Claude decide whether to load it for a task. A skill directory can also contain supporting files. Anthropic describes the format this way: “Every skill needs a SKILL.md file with two parts: YAML frontmatter between --- markers that tells Claude when to use the skill, and markdown content with the instructions Claude follows when the skill runs.” Read the current Claude Code skills documentation for the supported frontmatter and invocation controls.

Skills support both explicit invocation, such as /summarize-changes, and automatic selection when the skill description matches a task. Automatic selection is not a guarantee for every loosely related request: the description and invocation settings influence when Claude uses a skill. Where predictable triggering matters, configure the documented invocation controls, including disable-model-invocation, and invoke the skill by name when appropriate.

Custom command files in .claude/commands/ remain supported. They offer a simpler way to define slash commands; a skill adds frontmatter and a directory for related resources. If a skill and a command file use the same name, the skill takes precedence. Existing command files are therefore useful for a lightweight convention, but they are not required for new workflows that benefit from skill behavior.

Create a reusable skill

Personal skill

  1. Create a directory such as ~/.claude/skills/summarize-changes/.
  2. Inside it, create SKILL.md. Add YAML frontmatter with a useful name and description, then write clear Markdown instructions for the task. Follow the current skills reference for valid fields and controls.
  3. Add supporting resources in the skill directory if the workflow needs them; refer to them from the instructions.
  4. Start Claude Code in a context where the skill is available, then invoke it with /summarize-changes. If you intend to rely on automatic selection, make the description specific and verify the behavior in your installed version.

Project or team skill

  1. Create .claude/skills/<skill-name>/SKILL.md in the repository.
  2. Write the frontmatter and instructions as for a personal skill, using a name that makes the resulting slash command clear.
  3. Commit the skill and any supporting files so collaborators can use the shared workflow.
  4. Review and trust shared project configuration as appropriate before using it. Claude Code also has project settings with different sharing scopes; use .claude/settings.local.json for personal project-level overrides rather than putting user-specific settings in the shared .claude/settings.json.

Skills also have enterprise and additional-directory locations documented by Anthropic. Discovery can depend on the session’s starting directory, nested project structure, trust state, and Claude Code version. In particular, a skill in a nested project directory may not appear when a session starts above that directory; it can become discoverable when Claude enters the directory or you add it. Monorepos and worktrees have additional rules, so consult the skills reference for your setup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create a simple custom slash command

For a small command that does not need a skill directory or its richer frontmatter, create a Markdown command file in .claude/commands/ and write the reusable prompt in it. Keep the file’s name aligned with the slash command you want to use, then invoke it in Claude Code as a slash command. The official skills documentation describes how command files relate to skills, including the name-collision precedence rule; check it for current command-file details rather than assuming every skill feature applies to command files.

Use the project command location when the command belongs to that repository. If a similarly named skill exists, the skill takes precedence, so avoid relying on the command file to run under a duplicate name.

Run Claude Code from scripts with -p

For an unattended shell or script workflow, use Claude Code’s non-interactive print mode, for example:

claude -p "Summarize the changes in this repository"

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Anthropic says the --print (or -p) flag is useful for scripting and automation because responses can be parsed programmatically. A non-interactive invocation is not the same as installing a slash command: the script supplies a prompt to the CLI. Configure permissions deliberately for the job, including restricting tool use with options such as --allowedTools where appropriate. Consult the current CLI reference for exact syntax and available options.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Automate Claude Code in GitHub Actions

Use the documented Claude Code GitHub Actions integration when work should be triggered by GitHub activity or a configured prompt. Anthropic documents mention-triggered operation as well as prompt-supplied automation. Setting it up requires a workflow configuration, a suitable credential method—such as an eligible token or federation method—and repository permissions appropriate to the actions the workflow will perform.

  1. Follow the current Claude Code GitHub Actions setup for the supported workflow configuration.
  2. Choose and configure an eligible credential or federation method, then grant only the repository permissions the workflow needs.
  3. Decide whether the job should respond to a supported mention-triggered interaction or run from a prompt supplied in the workflow.
  4. Review the workflow’s tool access and repository permissions before enabling it, then validate the behavior in the intended repository and event context.

A local slash command alone does not establish GitHub credentials, permissions, event triggers, or a workflow file. Treat those as separate integration requirements and use Anthropic’s current setup and security guidance for the exact configuration.

Settings and discovery to check when something is missing

  • Scope: Personal skills belong under ~/.claude/skills/; project skills belong under .claude/skills/. Shared .claude/settings.json can be committed, while .claude/settings.local.json is for personal project-level overrides and is normally kept out of commits by Claude Code’s handling.
  • Starting directory: A skill in a nested directory may not be visible at session startup if Claude Code starts above it. Enter the directory or add it as appropriate, and check the documentation for monorepo and worktree behavior.
  • Invocation: A skill can be explicitly named or selected automatically, but automatic selection depends on its description and settings. Use documented controls when you need predictable triggering.
  • Version: Skill discovery and built-in workflow details may be version-gated. Verify the installed Claude Code version and current documentation before copying version-specific instructions.
  • Automation permissions: For scripts and GitHub jobs, check the configured tool restrictions, credentials, and repository permissions rather than assuming a reusable prompt grants access.

For settings precedence and file scopes, see Anthropic’s settings files and precedence reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.