Tool Deep DivesClaude Code

Claude Code slash commands: a complete guide — built-ins, custom commands, MCP / SDK integration

Slash commands turn Claude Code into a programmable shell for your codebase. This guide covers every built-in, the .claude/commands directory format, MCP-exposed commands, and the SDK SlashCommand tool — with examples you can copy verbatim.

中澤 圭志

中澤 圭志

@keishi_nakazawa

Sales Claw maintainer

·15 min
Claude Code slash commands: a complete guide — built-ins, custom commands, MCP / SDK integration
This English article is a concise version of the original. For the full Japanese deep-dive, see the Japanese original.

Key Facts

Coverage

Built-ins / custom / MCP / SDK

Targets

Claude Code 2.1+, including 2.1.142 features

"Which Claude Code slash commands should I actually use for what?" This article answers from the official docs plus a Sales Claw maintainer's field observations.

As of May 2026, Claude Code ships roughly 81 built-in slash commands and bundled skills. /init, /agents, /goal, /plan, /batch, /compact — opening the list for the first time feels "do I have to learn all of these?" In practice, if you group them into 5 categories and master 10 of them, you'll handle 90% of AI sales automation.

A major 2025–2026 change: custom slash commands have merged into Skills. The old .claude/commands/*.md format still works, but the new .claude/skills/<name>/SKILL.md format adds auxiliary files, YAML frontmatter, and subagent context — making it possible to package complex AI sales automation workflows as reusable distributions.

Primary sources: Claude Code official Docs (Commands / Skills / Sub-agents / Hooks / Permissions / Goal) and anthropics/claude-code GitHub Releases. We don't cite personal X posts or secondary outlets; JSON-LD citations are all primary.

1. What Claude Code slash commands are

Slash commands in Claude Code are strings starting with / that you type at the beginning of a prompt during a session. They invoke model switching, context management, subagent spawning, parallel batch execution, code diff viewing, and more. Mid-conversation, "just type /compactand it summarizes" — these act as control points that get long sessions across the finish line.

The official Docs "Commands" page lists about 81 commands as of May 2026. Display varies by platform / plan / environment — not all appear in everyone's / menu. /desktop is macOS / Windows only; /upgrade shows only on Pro / Max plans.

Two kinds — built-in commands and bundled skills

Of the 81, built-in commands are coded into the CLI (C++/Rust side) — /init, /clear, /model. Bundled skills are skill-type commands handed to Claude as prompts (/simplify, /batch, /debug, /loop, /claude-api, /fewer-permission-prompts — six). Bundled skills use the same mechanism as user-written skills, so Claude may even invoke them automatically when relevant.

Distribution of Claude Code slash commands across 5 categories plus auxiliary. Startup 5, during-task 8, parallel execution 4, pre-ship 4, between sessions 6, troubleshooting 5, other (help/config/usage/theme/skills etc.) 49 — totaling ~81. Source: code.claude.com/docs/en/commands
Figure: Figure 1: Distribution of Claude Code slash commands across 5 categories plus auxiliary (~81 total, as of May 2026)

2. The official categorization and the Skills merge

Hand-drawn whiteboard diagram organizing Claude Code slash commands into 5 categories by workflow. Startup (/init /memory /mcp /agents /permissions), during task (/plan /model /effort /context /compact), parallel (/agents /tasks /background /batch), pre-ship (/diff /simplify /review /security-review), troubleshooting (/rewind /doctor /debug /feedback). Representative commands per category.
Figure: Figure 2: Slash command organization across 5 categories (Sales Claw reorganization of the official Docs Commands reference)

Cheat sheet — 6 workflow phases

PhaseCommandsRole
Startup/init /memory /mcp /agents /permissionsCreate CLAUDE.md skeleton, connect MCP servers, configure subagents, build permission rules
During task/plan /model /effort /context /compact /btwPlan creation, model switching, reasoning-effort adjustment, context visibility and compression
Parallel/agents /tasks /background /batchSubagent management, background tasks, multi-worktree parallelism (batch)
Pre-ship/diff /simplify /review /security-reviewDiff viewing, quality review, security review
Between sessions/clear /resume /branch /teleport /remote-controlNew session, resume, branch, multi-device link-up
Troubleshooting/rewind /doctor /debug /feedback /heapdumpRewind, diagnostics, debug logs, memory leak investigation

Custom commands × Skills merge

Four-layer placement matrix for custom Skills: Project (.claude/skills/<name>/SKILL.md, repo only); Personal (~/.claude/skills/<name>/SKILL.md, all projects); Plugin (<plugin>/skills/<name>/SKILL.md, plugin-enabled environments); Enterprise (managed-settings, forced for all users in the org). Precedence: Enterprise > Personal > Project, with Plugin in a separate namespace. AI sales automation usage notes per layer.
Figure: Figure 3: Four-layer Skills placement — Project / Personal / Plugin / Enterprise

3. The 10 essential commands for AI sales automation (Sales Claw perspective)

As a Sales Claw maintainer, out of ~81 commands, the 10 below are the ones I touch daily in production. When onboarding new team members, mastering these 10 first means everything else is "filter with /when you need it."

The 10 essentials and their roles

  1. /init — generates a CLAUDE.md skeleton in the first session of a repo. For AI sales automation, write the banned-phrase list, do-not-contact detection rules, and audit-log retention policy here.
  2. /agents — opens the subagent management UI. Use this to separate per-industry pipelines (form submit / call / LinkedIn) as subagents.
  3. /goal— set autonomous goals that keep the session running until a completion condition. Compose conditions like "100 submissions complete AND 0 CAPTCHA detected."
  4. /plan — enter plan mode. Lock down which forms to run, how many, retry conditions, and stop conditions before sending.
  5. /batch — bundled skill. Splits codebase-wide changes into 5–30 units executed in parallel. Use it to generate 100 A/B copy templates in parallel across worktrees.
  6. /compact— summarize conversation history and release context. Sales Claw's operational rule: run it once when an AI sales automation session crosses 130k tokens.
  7. /rewind — revert to the prior checkpoint. When a form submission gets stuck in awaiting_approval, rewind code and conversation a few turns and try a different path.
  8. /permissions— manage allow / ask / deny. For form-submit agents: "at most 5 POSTs per session per domain," "immediately stop when banned terms detected," etc.
  9. /hooks— review and configure hooks against tool events. Hard-code "always run the do-not-contact detector before a form-submit" as a PreToolUse hook.
  10. /skills — Skills list. Inspect and toggle the form-copy generation, compliance-footer insertion, and do-not-contact detection skills you built.
Hand-drawn whiteboard 7-step flow for designing AI sales automation agents with Claude Code slash commands. /init for startup → /agents to split pipelines → /goal for completion conditions → /plan for pre-send planning → /batch for parallel execution → /compact for context cleanup → /rewind on failure. The /rewind step is emphasized in red marker.
Figure: Figure 4: AI sales automation 7-step workflow (Sales Claw design pattern)

4. Sales Claw integration sketch

Sales Claw is OSS designed to lower misfire and policy-violation risk through policy control, pre-send checks, do-not-contact detection, CAPTCHA-on-detect stop, rate limits, audit logging, and automatic stop conditions. Running this design on Claude Code lays out the commands like this:

Command order in the first session

# 1. Initialize CLAUDE.md (banned-term list / compliance policy)
/init

# 2. Open subagent settings to split per-industry pipelines (SaaS / manufacturing / professional services)
/agents

# 3. Connect required MCP servers (Playwright MCP / Notion / Slack)
/mcp

# 4. Build permissions with minimal grants
/permissions
#   → allow: Read, Edit, Bash(npm test), MCP(form-submit:dry-run)
#   → ask:   Bash(git push), MCP(form-submit:real)
#   → deny:  Bash(rm -rf *), Bash(curl http://example-spam.com/*)

Parallel execution in the send loop

# 1. Plan creation (which of 100 companies to prioritize, stop conditions)
/plan Today, submit to the top 100 SaaS companies; stop after 5 CAPTCHA detections

# 2. Autonomous goal until completion
/goal 100 submissions completed AND 0 awaiting_approval items AND 0 banned-term detections

# 3. Four industry pipelines in parallel batch
/batch SaaS 25 / Manufacturing 25 / Professional services 25 / Retail 25 — each in its own worktree

# 4. Tidy context after each batch
/compact Keep only submission history and CAPTCHA encounter points as a summary

# 5. Rewind on failure
/rewind Roll back to the prior submission logic change (5 turns ago) and try another path

If you're running AI sales automation on Claude Code, start with command design.

無料・MIT ライセンス。インストールせずにライブデモも試せます。

5. Context window and the /compact strategy — cost estimate

Assumptions

  • Targets: 100 companies / session (1 turn = 1 form submission, average 3.3 companies / turn processed)
  • Judging model: Claude Sonnet 4.6, $3 / MTok in / $15 / MTok out
  • Worker model: Claude Haiku 4.5 (form-copy generation)
  • FX: 1 USD = 150 JPY
  • Exclusion: ~12% CAPTCHA / ~8% do-not-contact / ~18% no-form
  • Per-turn tokens: ~7,500 in / ~1,000 out (~8,500 total)
  • Variance: ±25% (site structure and form complexity)
  • Validation: Sales Claw internal 100 × 3 sample (300 total), based on field observation
Comparison chart of context-window usage for AI sales automation sessions. Without /compact, ~8.5k tokens accumulate per turn and the 200k limit is hit around turn 24. With /compact at turns 11 and 21, 30 turns complete in one session. Assumes ~8.5k tokens per turn based on Sales Claw internal validation, ±25% variance.
Figure: Figure 5: Effect of the /compact strategy on context release (1 session ~30 turns = 100 submissions)

Cost breakdown (estimate)

ItemRate (USD)VolumeSubtotal (JPY=150)
Sonnet 4.6 input (7.5k × 30 turns)$3 / MTok225k tokens¥101
Sonnet 4.6 output (1k × 30 turns)$15 / MTok30k tokens¥67
Haiku 4.5 copy generation (66 companies × ~800 tok)$0.8 / MTok out52k tokens¥6
Total (1 session = 100 processed = 66 submitted)¥174

Comparison vs. outsourcing services

項目Sales Claw on Claude Code (estimate)Sales-outsourcing SaaS (typical monthly)
Cost per 100 companiesRoughly ¥174 (API only, labor excluded)Typically ¥30K–¥200K per 100
Pre-send checkForced via PreToolUse hookService-dependent
On CAPTCHA detectAuto-stop + awaiting_approvalSome services auto-bypass (terms-violation risk)
Audit logStored as action-log.json (offline)On platform (lost on cancellation)
Do-not-contact detectionLocal regex + LLM before submitService-side filter
CustomizationSkills for form copy / footer / etc.Within template range only

Cost numbers from Sales Claw internal 300-sample validation. SaaS figures are public price-list ranges; industry, contract shape, and minimums vary the result significantly. Always sample ~100 companies in your own Sales Claw local environment before scaling.

6. Policy-controlled autonomous operation: risks and safe-by-design

Embedding Claude Code slash commands into AI sales automation means autonomous goals and parallel batches become routine — "processing continues while no human is watching." Sales Claw is OSS built for this mode of operation: policy control, pre-send checks, audit logging, and automatic stop conditions structurally reduce risk. We don't claim "safe" — we lower risk.

  • Japan's Specified Electronic Mail Act: auto-append sender info (name / address / phone / contact email) via preferences.complianceFooter: true
  • Per-site terms: auto-skip forms marked "no sales" (do-not-contact detection rules)
  • No CAPTCHA bypass: stop into awaiting_approval, log on detect; only humans resume
  • Rate limit: at most 5 POSTs per session per domain (enforced via /permissions)
  • Opt-out: auto-insert "no reply needed" in copy

Automatic stop conditions to prevent runaway

Residual risks and maintainer observations

These can't be fully eliminated by automated checks. Notes from running Sales Claw across multiple industries:

  • Missed detection of new CAPTCHA variants: behavioral-analysis types (e.g., Cloudflare Turnstile) may slip past until rules are added
  • Lag in tracking terms changes: legal info needs manual updates — audit CLAUDE.md quarterly
  • Industry regulation: BFSI / healthcare / legal services need domain-specific footers via /skills
  • Enterprise Skill overrides: managed-settings Enterprise Skills can't be overridden at the project level — confirm before launch if org policies might collide
  • Parallel-batch subagent runaway: workers in /batch have independent contexts, so global send counts are easily missed. Aggregate centrally via Hooks

7. Pre-production checklist

Before starting policy-controlled autonomous operation

  • Wrote banned-term list and compliance policy into CLAUDE.md via /init
  • Added deny rules in /permissions: Bash(rm -rf *), Bash(curl http://example-spam.com/*)
  • Set ask rules in /permissions: Bash(git push), MCP(form-submit:real)
  • Forced do-not-contact and CAPTCHA detection via /hooks PreToolUse
  • /goal termination ANDs volume cap, elapsed cap, and turn cap
  • /batch parallelism is 4 or fewer (to stay within rate limits)
  • Documented running /compact at turn 11 and turn 21
  • Specified rewind-checkpoint intervals (every 5 turns)
  • action-log.json saving is enabled (offline auditable)
  • Compliance footer enabled (preferences.complianceFooter: true)
  • Opt-out is auto-inserted into copy
  • Ran one round of Sales Claw internal validation on 100 companies
  • In enterprise environments, checked for collisions with managed-settings Enterprise Skills

8. Bottom line

~81 slash commands sound like a lot, but organize them into 6 workflow phases and the daily-use 10 for AI sales automation come into focus: /init, /agents, /goal, /plan, /batch, /compact, /rewind, /permissions, /hooks, /skills. The 2025–2026 "custom commands → Skills merge" also makes it easier to package and version your internal know-how as distributable Skills.

From Sales Claw operations, composing those 10 in order — "startup → pipeline split → completion → planning → parallel → context cleanup → rewind" — runs a policy-controlled autonomous loop safely with pre-send checks, audit logging, and automatic stop conditions.

Next action: type /skills in your Claude Code right now and see what Skills are already available. To try Sales Claw's distributed Skills (form-copy / compliance footer / do-not-contact), download from Sales Claw. For the broader Claude Code quickstart, start from Quick start.

Read this. Then run.

無料・MIT ライセンス。インストールせずにライブデモも試せます。

この記事の著者

中澤 圭志

中澤 圭志

Sales Claw maintainer

Sales Claw の設計・開発を担当。BtoB 営業自動化と AI 活用の実践者として、現場目線で情報発信中。

Share this article