SwiftRelay

← Todas las notas de sprint

Claude Code Slash Commands That Cut Repeated Typing

Inicio rápido con agentesEN

If you keep typing the same review checklist into Claude Code, turn it into a command. Custom slash commands now share the skills system: existing .claude/commands/ files still work, while skills offer supporting files and invocation controls. This walkthrough starts with a simple command file so you can replace one repeated prompt without redesigning your workflow. ([code.claude.com](https://code.claude.com/docs/en/skills))

1. Check Existing Slash Commands Before Creating One

Start with /help to see available commands. Use /compact when you need to condense conversation context, rather than repeatedly asking Claude to summarize the session. Built-in commands handle session operations; your custom commands should capture the instructions specific to your work. ([code.claude.com](https://code.claude.com/docs/en/commands))

Pick one recurring request. A good first candidate is reviewing a change before opening a pull request. Avoid starting with a command that reviews, rewrites, tests, commits, and publishes everything together. A narrow task is easier to inspect and improve.

2. Save Your Review Checklist as a Command

Create .claude/commands/check-change.md inside your repository. The filename supplies the /check-change command. Alternatively, create .claude/skills/check-change/SKILL.md using the skills directory format; choose one location rather than maintaining duplicate definitions. ([code.claude.com](https://code.claude.com/docs/en/skills))

Put this instruction text in the file:

Review the current Git diff. Identify correctness bugs, missing edge-case tests, and changes that contradict nearby code conventions. Do not edit files. Return actionable findings with file references, explain their impact, and separate confirmed problems from questions. If you find no actionable issues, say so.

This gives your review a repeatable scope and output format. The important detail is not the command name: it is the checklist you no longer have to reconstruct.

3. Add Arguments Instead of Creating Near-Duplicate Commands

Append this sentence to your command file: Give extra attention to this focus: $ARGUMENTS. Claude Code substitutes the text following the command name for $ARGUMENTS. ([code.claude.com](https://code.claude.com/docs/en/skills))

Now try /check-change authentication and session expiry. For another change, use /check-change database migrations and rollback safety. Keep the review procedure fixed while changing only the focus.

Write an explicit fallback into the prompt: if no focus is supplied, perform the general review checklist. Avoid making the command depend on information that you routinely forget to provide.

4. Test the Command Against a Familiar Change

Run the command on a small diff you understand. Compare its response with what you would expect from a careful manual review. Check whether findings are relevant, whether uncertainty is labeled, and whether the response stays within your requested scope.

  • If findings are vague, require an explanation of the failing scenario.
  • If output is noisy, request actionable defects before stylistic suggestions.
  • If context is missing, tell the command which project guidance to consult.

Change one instruction at a time. Otherwise, you will struggle to tell which edit improved the result.

5. Separate Review, Testing, and Pull Request Drafting

Once /check-change is useful, consider two additional commands: /test-plan for proposing targeted checks, and /pr-draft for preparing a pull request description. Give each its own file and a distinct responsibility.

For /pr-draft, specify the sections you want: purpose, behavior changes, verification performed, and remaining risks. Require it to distinguish tests actually run from tests merely recommended. Do not let a convenient template turn assumptions into evidence.

6. Share Project Commands Without Sharing Secrets

Keep repository-specific workflows in the project. Personal skills can live under ~/.claude/skills/ for use across your local projects. For a skill you want to trigger only yourself, set disable-model-invocation: true in its YAML frontmatter. ([code.claude.com](https://code.claude.com/docs/en/skills))

Review command files before committing them. Keep credentials, private customer examples, and environment secrets out. Treat changes to shared prompts as changes to team tooling: review their scope and test their behavior.

7. Pair Reusable Commands With SwiftRelay

If you want pay-as-you-go access for this workflow, SwiftRelay supports Claude Code and bills per token. Sign up for SwiftRelay to try your reusable commands with the small gift credit available to new accounts.

Keep the first milestone modest: one dependable command that replaces a paragraph you used to type repeatedly. Expand your command library only when another repeated task has a clear scope, useful inputs, and an output you can verify.

Sigue leyendo

¿Listo para otra vuelta?Iniciar sesión