caruso 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +41 -0
- data/impl.md +111 -0
- data/lib/caruso/adapter.rb +16 -96
- data/lib/caruso/adapters/base.rb +102 -0
- data/lib/caruso/adapters/command_adapter.rb +88 -0
- data/lib/caruso/adapters/dispatcher.rb +83 -0
- data/lib/caruso/adapters/hook_adapter.rb +222 -0
- data/lib/caruso/adapters/markdown_adapter.rb +23 -0
- data/lib/caruso/adapters/skill_adapter.rb +87 -0
- data/lib/caruso/cli.rb +22 -6
- data/lib/caruso/config_manager.rb +30 -28
- data/lib/caruso/fetcher.rb +137 -29
- data/lib/caruso/remover.rb +73 -13
- data/lib/caruso/version.rb +1 -1
- data/package-lock.json +6 -0
- data/reference/claude_code_create_marketplaces.md +511 -0
- data/reference/claude_code_hooks.md +1137 -0
- data/reference/claude_code_plugins.md +769 -0
- data/reference/claude_code_slash_commands.md +515 -0
- data/reference/cursor_commands.md +90 -0
- data/reference/cursor_hooks.md +467 -0
- data/reference/cursor_modes.md +105 -0
- data/reference/cursor_rules.md +246 -0
- data/reference/steering_docs.md +57 -0
- data/tasks.md +22 -0
- metadata +20 -3
- data/reference/plugins_reference.md +0 -376
- /data/reference/{marketplace.md → claude_code_marketplaces.md} +0 -0
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
# Slash commands
|
|
2
|
+
|
|
3
|
+
> Control Claude's behavior during an interactive session with slash commands.
|
|
4
|
+
|
|
5
|
+
## Built-in slash commands
|
|
6
|
+
|
|
7
|
+
| Command | Purpose |
|
|
8
|
+
| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------- |
|
|
9
|
+
| `/add-dir` | Add additional working directories |
|
|
10
|
+
| `/agents` | Manage custom AI subagents for specialized tasks |
|
|
11
|
+
| `/bashes` | List and manage background tasks |
|
|
12
|
+
| `/bug` | Report bugs (sends conversation to Anthropic) |
|
|
13
|
+
| `/clear` | Clear conversation history |
|
|
14
|
+
| `/compact [instructions]` | Compact conversation with optional focus instructions |
|
|
15
|
+
| `/config` | Open the Settings interface (Config tab) |
|
|
16
|
+
| `/context` | Visualize current context usage as a colored grid |
|
|
17
|
+
| `/cost` | Show token usage statistics. See [cost tracking guide](/en/costs#using-the-cost-command) for subscription-specific details. |
|
|
18
|
+
| `/doctor` | Checks the health of your Claude Code installation |
|
|
19
|
+
| `/exit` | Exit the REPL |
|
|
20
|
+
| `/export [filename]` | Export the current conversation to a file or clipboard |
|
|
21
|
+
| `/help` | Get usage help |
|
|
22
|
+
| `/hooks` | Manage hook configurations for tool events |
|
|
23
|
+
| `/ide` | Manage IDE integrations and show status |
|
|
24
|
+
| `/init` | Initialize project with `CLAUDE.md` guide |
|
|
25
|
+
| `/install-github-app` | Set up Claude GitHub Actions for a repository |
|
|
26
|
+
| `/login` | Switch Anthropic accounts |
|
|
27
|
+
| `/logout` | Sign out from your Anthropic account |
|
|
28
|
+
| `/mcp` | Manage MCP server connections and OAuth authentication |
|
|
29
|
+
| `/memory` | Edit `CLAUDE.md` memory files |
|
|
30
|
+
| `/model` | Select or change the AI model |
|
|
31
|
+
| `/output-style [style]` | Set the output style directly or from a selection menu |
|
|
32
|
+
| `/permissions` | View or update [permissions](/en/iam#configuring-permissions) |
|
|
33
|
+
| `/plugin` | Manage Claude Code plugins |
|
|
34
|
+
| `/pr-comments` | View pull request comments |
|
|
35
|
+
| `/privacy-settings` | View and update your privacy settings |
|
|
36
|
+
| `/release-notes` | View release notes |
|
|
37
|
+
| `/rename <name>` | Rename the current session for easier identification |
|
|
38
|
+
| `/resume [session]` | Resume a conversation by ID or name, or open the session picker |
|
|
39
|
+
| `/review` | Request code review |
|
|
40
|
+
| `/rewind` | Rewind the conversation and/or code |
|
|
41
|
+
| `/sandbox` | Enable sandboxed bash tool with filesystem and network isolation for safer, more autonomous execution |
|
|
42
|
+
| `/security-review` | Complete a security review of pending changes on the current branch |
|
|
43
|
+
| `/stats` | Visualize daily usage, session history, streaks, and model preferences |
|
|
44
|
+
| `/status` | Open the Settings interface (Status tab) showing version, model, account, and connectivity |
|
|
45
|
+
| `/statusline` | Set up Claude Code's status line UI |
|
|
46
|
+
| `/terminal-setup` | Install Shift+Enter key binding for newlines (iTerm2 and VSCode only) |
|
|
47
|
+
| `/todos` | List current TODO items |
|
|
48
|
+
| `/usage` | For subscription plans only: show plan usage limits and rate limit status |
|
|
49
|
+
| `/vim` | Enter vim mode for alternating insert and command modes |
|
|
50
|
+
|
|
51
|
+
## Custom slash commands
|
|
52
|
+
|
|
53
|
+
Custom slash commands allow you to define frequently used prompts as Markdown files that Claude Code can execute. Commands are organized by scope (project-specific or personal) and support namespacing through directory structures.
|
|
54
|
+
|
|
55
|
+
### Syntax
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
/<command-name> [arguments]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Parameters
|
|
62
|
+
|
|
63
|
+
| Parameter | Description |
|
|
64
|
+
| :--------------- | :---------------------------------------------------------------- |
|
|
65
|
+
| `<command-name>` | Name derived from the Markdown filename (without `.md` extension) |
|
|
66
|
+
| `[arguments]` | Optional arguments passed to the command |
|
|
67
|
+
|
|
68
|
+
### Command types
|
|
69
|
+
|
|
70
|
+
#### Project commands
|
|
71
|
+
|
|
72
|
+
Commands stored in your repository and shared with your team. When listed in `/help`, these commands show "(project)" after their description.
|
|
73
|
+
|
|
74
|
+
**Location**: `.claude/commands/`
|
|
75
|
+
|
|
76
|
+
The following example creates the `/optimize` command:
|
|
77
|
+
|
|
78
|
+
```bash theme={null}
|
|
79
|
+
# Create a project command
|
|
80
|
+
mkdir -p .claude/commands
|
|
81
|
+
echo "Analyze this code for performance issues and suggest optimizations:" > .claude/commands/optimize.md
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### Personal commands
|
|
85
|
+
|
|
86
|
+
Commands available across all your projects. When listed in `/help`, these commands show "(user)" after their description.
|
|
87
|
+
|
|
88
|
+
**Location**: `~/.claude/commands/`
|
|
89
|
+
|
|
90
|
+
The following example creates the `/security-review` command:
|
|
91
|
+
|
|
92
|
+
```bash theme={null}
|
|
93
|
+
# Create a personal command
|
|
94
|
+
mkdir -p ~/.claude/commands
|
|
95
|
+
echo "Review this code for security vulnerabilities:" > ~/.claude/commands/security-review.md
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Features
|
|
99
|
+
|
|
100
|
+
#### Namespacing
|
|
101
|
+
|
|
102
|
+
Use subdirectories to group related commands. Subdirectories appear in the command description but don't affect the command name.
|
|
103
|
+
|
|
104
|
+
For example:
|
|
105
|
+
|
|
106
|
+
* `.claude/commands/frontend/component.md` creates `/component` with description "(project:frontend)"
|
|
107
|
+
* `~/.claude/commands/component.md` creates `/component` with description "(user)"
|
|
108
|
+
|
|
109
|
+
If a project command and user command share the same name, the project command takes precedence and the user command is silently ignored. For example, if both `.claude/commands/deploy.md` and `~/.claude/commands/deploy.md` exist, `/deploy` runs the project version.
|
|
110
|
+
|
|
111
|
+
Commands in different subdirectories can share names since the subdirectory appears in the description to distinguish them. For example, `.claude/commands/frontend/test.md` and `.claude/commands/backend/test.md` both create `/test`, but show as "(project:frontend)" and "(project:backend)" respectively.
|
|
112
|
+
|
|
113
|
+
#### Arguments
|
|
114
|
+
|
|
115
|
+
Pass dynamic values to commands using argument placeholders:
|
|
116
|
+
|
|
117
|
+
##### All arguments with `$ARGUMENTS`
|
|
118
|
+
|
|
119
|
+
The `$ARGUMENTS` placeholder captures all arguments passed to the command:
|
|
120
|
+
|
|
121
|
+
```bash theme={null}
|
|
122
|
+
# Command definition
|
|
123
|
+
echo 'Fix issue #$ARGUMENTS following our coding standards' > .claude/commands/fix-issue.md
|
|
124
|
+
|
|
125
|
+
# Usage
|
|
126
|
+
> /fix-issue 123 high-priority
|
|
127
|
+
# $ARGUMENTS becomes: "123 high-priority"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
##### Individual arguments with `$1`, `$2`, etc.
|
|
131
|
+
|
|
132
|
+
Access specific arguments individually using positional parameters (similar to shell scripts):
|
|
133
|
+
|
|
134
|
+
```bash theme={null}
|
|
135
|
+
# Command definition
|
|
136
|
+
echo 'Review PR #$1 with priority $2 and assign to $3' > .claude/commands/review-pr.md
|
|
137
|
+
|
|
138
|
+
# Usage
|
|
139
|
+
> /review-pr 456 high alice
|
|
140
|
+
# $1 becomes "456", $2 becomes "high", $3 becomes "alice"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Use positional arguments when you need to:
|
|
144
|
+
|
|
145
|
+
* Access arguments individually in different parts of your command
|
|
146
|
+
* Provide defaults for missing arguments
|
|
147
|
+
* Build more structured commands with specific parameter roles
|
|
148
|
+
|
|
149
|
+
#### Bash command execution
|
|
150
|
+
|
|
151
|
+
Execute bash commands before the slash command runs using the `!` prefix. The output is included in the command context. You *must* include `allowed-tools` with the `Bash` tool, but you can choose the specific bash commands to allow.
|
|
152
|
+
|
|
153
|
+
For example:
|
|
154
|
+
|
|
155
|
+
```markdown theme={null}
|
|
156
|
+
---
|
|
157
|
+
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
|
|
158
|
+
description: Create a git commit
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Context
|
|
162
|
+
|
|
163
|
+
- Current git status: !`git status`
|
|
164
|
+
- Current git diff (staged and unstaged changes): !`git diff HEAD`
|
|
165
|
+
- Current branch: !`git branch --show-current`
|
|
166
|
+
- Recent commits: !`git log --oneline -10`
|
|
167
|
+
|
|
168
|
+
## Your task
|
|
169
|
+
|
|
170
|
+
Based on the above changes, create a single git commit.
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
#### File references
|
|
174
|
+
|
|
175
|
+
Include file contents in commands using the `@` prefix to [reference files](/en/common-workflows#reference-files-and-directories).
|
|
176
|
+
|
|
177
|
+
For example:
|
|
178
|
+
|
|
179
|
+
```markdown theme={null}
|
|
180
|
+
# Reference a specific file
|
|
181
|
+
|
|
182
|
+
Review the implementation in @src/utils/helpers.js
|
|
183
|
+
|
|
184
|
+
# Reference multiple files
|
|
185
|
+
|
|
186
|
+
Compare @src/old-version.js with @src/new-version.js
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
#### Thinking mode
|
|
190
|
+
|
|
191
|
+
Slash commands can trigger extended thinking by including [extended thinking keywords](/en/common-workflows#use-extended-thinking).
|
|
192
|
+
|
|
193
|
+
### Frontmatter
|
|
194
|
+
|
|
195
|
+
Command files support frontmatter, useful for specifying metadata about the command:
|
|
196
|
+
|
|
197
|
+
| Frontmatter | Purpose | Default |
|
|
198
|
+
| :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------- |
|
|
199
|
+
| `allowed-tools` | List of tools the command can use | Inherits from the conversation |
|
|
200
|
+
| `argument-hint` | The arguments expected for the slash command. Example: `argument-hint: add [tagId] \| remove [tagId] \| list`. This hint is shown to the user when auto-completing the slash command. | None |
|
|
201
|
+
| `description` | Brief description of the command | Uses the first line from the prompt |
|
|
202
|
+
| `model` | Specific model string (see [Models overview](https://docs.claude.com/en/docs/about-claude/models/overview)) | Inherits from the conversation |
|
|
203
|
+
| `disable-model-invocation` | Whether to prevent `SlashCommand` tool from calling this command | false |
|
|
204
|
+
|
|
205
|
+
For example:
|
|
206
|
+
|
|
207
|
+
```markdown theme={null}
|
|
208
|
+
---
|
|
209
|
+
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
|
|
210
|
+
argument-hint: [message]
|
|
211
|
+
description: Create a git commit
|
|
212
|
+
model: claude-3-5-haiku-20241022
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
Create a git commit with message: $ARGUMENTS
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Example using positional arguments:
|
|
219
|
+
|
|
220
|
+
```markdown theme={null}
|
|
221
|
+
---
|
|
222
|
+
argument-hint: [pr-number] [priority] [assignee]
|
|
223
|
+
description: Review pull request
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
Review PR #$1 with priority $2 and assign to $3.
|
|
227
|
+
Focus on security, performance, and code style.
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Plugin commands
|
|
231
|
+
|
|
232
|
+
[Plugins](/en/plugins) can provide custom slash commands that integrate seamlessly with Claude Code. Plugin commands work exactly like user-defined commands but are distributed through [plugin marketplaces](/en/plugin-marketplaces).
|
|
233
|
+
|
|
234
|
+
### How plugin commands work
|
|
235
|
+
|
|
236
|
+
Plugin commands are:
|
|
237
|
+
|
|
238
|
+
* **Namespaced**: Commands can use the format `/plugin-name:command-name` to avoid conflicts (plugin prefix is optional unless there are name collisions)
|
|
239
|
+
* **Automatically available**: Once a plugin is installed and enabled, its commands appear in `/help`
|
|
240
|
+
* **Fully integrated**: Support all command features (arguments, frontmatter, bash execution, file references)
|
|
241
|
+
|
|
242
|
+
### Plugin command structure
|
|
243
|
+
|
|
244
|
+
**Location**: `commands/` directory in plugin root
|
|
245
|
+
|
|
246
|
+
**File format**: Markdown files with frontmatter
|
|
247
|
+
|
|
248
|
+
**Basic command structure**:
|
|
249
|
+
|
|
250
|
+
```markdown theme={null}
|
|
251
|
+
---
|
|
252
|
+
description: Brief description of what the command does
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
# Command Name
|
|
256
|
+
|
|
257
|
+
Detailed instructions for Claude on how to execute this command.
|
|
258
|
+
Include specific guidance on parameters, expected outcomes, and any special considerations.
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
**Advanced command features**:
|
|
262
|
+
|
|
263
|
+
* **Arguments**: Use placeholders like `{arg1}` in command descriptions
|
|
264
|
+
* **Subdirectories**: Organize commands in subdirectories for namespacing
|
|
265
|
+
* **Bash integration**: Commands can execute shell scripts and programs
|
|
266
|
+
* **File references**: Commands can reference and modify project files
|
|
267
|
+
|
|
268
|
+
### Invocation patterns
|
|
269
|
+
|
|
270
|
+
```shell Direct command (when no conflicts) theme={null}
|
|
271
|
+
/command-name
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
```shell Plugin-prefixed (when needed for disambiguation) theme={null}
|
|
275
|
+
/plugin-name:command-name
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
```shell With arguments (if command supports them) theme={null}
|
|
279
|
+
/command-name arg1 arg2
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## MCP slash commands
|
|
283
|
+
|
|
284
|
+
MCP servers can expose prompts as slash commands that become available in Claude Code. These commands are dynamically discovered from connected MCP servers.
|
|
285
|
+
|
|
286
|
+
### Command format
|
|
287
|
+
|
|
288
|
+
MCP commands follow the pattern:
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
/mcp__<server-name>__<prompt-name> [arguments]
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Features
|
|
295
|
+
|
|
296
|
+
#### Dynamic discovery
|
|
297
|
+
|
|
298
|
+
MCP commands are automatically available when:
|
|
299
|
+
|
|
300
|
+
* An MCP server is connected and active
|
|
301
|
+
* The server exposes prompts through the MCP protocol
|
|
302
|
+
* The prompts are successfully retrieved during connection
|
|
303
|
+
|
|
304
|
+
#### Arguments
|
|
305
|
+
|
|
306
|
+
MCP prompts can accept arguments defined by the server:
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
# Without arguments
|
|
310
|
+
> /mcp__github__list_prs
|
|
311
|
+
|
|
312
|
+
# With arguments
|
|
313
|
+
> /mcp__github__pr_review 456
|
|
314
|
+
> /mcp__jira__create_issue "Bug title" high
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
#### Naming conventions
|
|
318
|
+
|
|
319
|
+
Server and prompt names are normalized:
|
|
320
|
+
|
|
321
|
+
* Spaces and special characters become underscores
|
|
322
|
+
* Names are lowercase for consistency
|
|
323
|
+
|
|
324
|
+
### Managing MCP connections
|
|
325
|
+
|
|
326
|
+
Use the `/mcp` command to:
|
|
327
|
+
|
|
328
|
+
* View all configured MCP servers
|
|
329
|
+
* Check connection status
|
|
330
|
+
* Authenticate with OAuth-enabled servers
|
|
331
|
+
* Clear authentication tokens
|
|
332
|
+
* View available tools and prompts from each server
|
|
333
|
+
|
|
334
|
+
### MCP permissions and wildcards
|
|
335
|
+
|
|
336
|
+
To approve all tools from an MCP server, use either the server name alone or wildcard syntax:
|
|
337
|
+
|
|
338
|
+
* `mcp__github` (approves all GitHub tools)
|
|
339
|
+
* `mcp__github__*` (wildcard syntax, also approves all GitHub tools)
|
|
340
|
+
|
|
341
|
+
To approve specific tools, list each one explicitly:
|
|
342
|
+
|
|
343
|
+
* `mcp__github__get_issue`
|
|
344
|
+
* `mcp__github__list_issues`
|
|
345
|
+
|
|
346
|
+
See [MCP permission rules](/en/iam#tool-specific-permission-rules) for more details.
|
|
347
|
+
|
|
348
|
+
## `SlashCommand` tool
|
|
349
|
+
|
|
350
|
+
The `SlashCommand` tool allows Claude to execute [custom slash commands](/en/slash-commands#custom-slash-commands) programmatically
|
|
351
|
+
during a conversation. This gives Claude the ability to invoke custom commands
|
|
352
|
+
on your behalf when appropriate.
|
|
353
|
+
|
|
354
|
+
To encourage Claude to use the `SlashCommand` tool, reference the command by name, including the slash, in your prompts or `CLAUDE.md` file. For example:
|
|
355
|
+
|
|
356
|
+
```
|
|
357
|
+
> Run /write-unit-test when you are about to start writing tests.
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
This tool puts each available custom slash command's metadata into context up to the character budget limit. You can use `/context` to monitor token usage and follow the operations below to manage context.
|
|
361
|
+
|
|
362
|
+
### `SlashCommand` tool supported commands
|
|
363
|
+
|
|
364
|
+
`SlashCommand` tool only supports custom slash commands that:
|
|
365
|
+
|
|
366
|
+
* Are user-defined. Built-in commands like `/compact` and `/init` are *not* supported.
|
|
367
|
+
* Have the `description` frontmatter field populated. The description is used in the context.
|
|
368
|
+
|
|
369
|
+
For Claude Code versions >= 1.0.124, you can see which custom slash commands
|
|
370
|
+
`SlashCommand` tool can invoke by running `claude --debug` and triggering a query.
|
|
371
|
+
|
|
372
|
+
### Disable `SlashCommand` tool
|
|
373
|
+
|
|
374
|
+
To prevent Claude from executing any slash commands via the tool:
|
|
375
|
+
|
|
376
|
+
```bash theme={null}
|
|
377
|
+
/permissions
|
|
378
|
+
# Add to deny rules: SlashCommand
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
This also removes the SlashCommand tool and command descriptions from context.
|
|
382
|
+
|
|
383
|
+
### Disable specific commands only
|
|
384
|
+
|
|
385
|
+
To prevent a specific slash command from becoming available, add
|
|
386
|
+
`disable-model-invocation: true` to the slash command's frontmatter.
|
|
387
|
+
|
|
388
|
+
This also removes the command's metadata from context.
|
|
389
|
+
|
|
390
|
+
### `SlashCommand` permission rules
|
|
391
|
+
|
|
392
|
+
The permission rules support:
|
|
393
|
+
|
|
394
|
+
* **Exact match**: `SlashCommand:/commit` (allows only `/commit` with no arguments)
|
|
395
|
+
* **Prefix match**: `SlashCommand:/review-pr:*` (allows `/review-pr` with any arguments)
|
|
396
|
+
|
|
397
|
+
### Character budget limit
|
|
398
|
+
|
|
399
|
+
The `SlashCommand` tool includes a character budget to limit the size of command
|
|
400
|
+
descriptions shown to Claude. This prevents token overflow when many commands
|
|
401
|
+
are available.
|
|
402
|
+
|
|
403
|
+
The budget includes each custom slash command's name, arguments, and description.
|
|
404
|
+
|
|
405
|
+
* **Default limit**: 15,000 characters
|
|
406
|
+
* **Custom limit**: Set via `SLASH_COMMAND_TOOL_CHAR_BUDGET` environment variable
|
|
407
|
+
|
|
408
|
+
When the character budget is exceeded, Claude sees only a subset of the available commands. In `/context`, a warning shows "M of N commands".
|
|
409
|
+
|
|
410
|
+
## Skills vs slash commands
|
|
411
|
+
|
|
412
|
+
**Slash commands** and **Agent Skills** serve different purposes in Claude Code:
|
|
413
|
+
|
|
414
|
+
### Use slash commands for
|
|
415
|
+
|
|
416
|
+
**Quick, frequently used prompts**:
|
|
417
|
+
|
|
418
|
+
* Simple prompt snippets you use often
|
|
419
|
+
* Quick reminders or templates
|
|
420
|
+
* Frequently used instructions that fit in one file
|
|
421
|
+
|
|
422
|
+
**Examples**:
|
|
423
|
+
|
|
424
|
+
* `/review` → "Review this code for bugs and suggest improvements"
|
|
425
|
+
* `/explain` → "Explain this code in simple terms"
|
|
426
|
+
* `/optimize` → "Analyze this code for performance issues"
|
|
427
|
+
|
|
428
|
+
### Use Skills for
|
|
429
|
+
|
|
430
|
+
**Comprehensive capabilities with structure**:
|
|
431
|
+
|
|
432
|
+
* Complex workflows with multiple steps
|
|
433
|
+
* Capabilities requiring scripts or utilities
|
|
434
|
+
* Knowledge organized across multiple files
|
|
435
|
+
* Team workflows you want to standardize
|
|
436
|
+
|
|
437
|
+
**Examples**:
|
|
438
|
+
|
|
439
|
+
* PDF processing Skill with form-filling scripts and validation
|
|
440
|
+
* Data analysis Skill with reference docs for different data types
|
|
441
|
+
* Documentation Skill with style guides and templates
|
|
442
|
+
|
|
443
|
+
### Key differences
|
|
444
|
+
|
|
445
|
+
| Aspect | Slash Commands | Agent Skills |
|
|
446
|
+
| -------------- | -------------------------------- | ----------------------------------- |
|
|
447
|
+
| **Complexity** | Simple prompts | Complex capabilities |
|
|
448
|
+
| **Structure** | Single .md file | Directory with SKILL.md + resources |
|
|
449
|
+
| **Discovery** | Explicit invocation (`/command`) | Automatic (based on context) |
|
|
450
|
+
| **Files** | One file only | Multiple files, scripts, templates |
|
|
451
|
+
| **Scope** | Project or personal | Project or personal |
|
|
452
|
+
| **Sharing** | Via git | Via git |
|
|
453
|
+
|
|
454
|
+
### Example comparison
|
|
455
|
+
|
|
456
|
+
**As a slash command**:
|
|
457
|
+
|
|
458
|
+
```markdown theme={null}
|
|
459
|
+
# .claude/commands/review.md
|
|
460
|
+
Review this code for:
|
|
461
|
+
- Security vulnerabilities
|
|
462
|
+
- Performance issues
|
|
463
|
+
- Code style violations
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
Usage: `/review` (manual invocation)
|
|
467
|
+
|
|
468
|
+
**As a Skill**:
|
|
469
|
+
|
|
470
|
+
```
|
|
471
|
+
.claude/skills/code-review/
|
|
472
|
+
├── SKILL.md (overview and workflows)
|
|
473
|
+
├── SECURITY.md (security checklist)
|
|
474
|
+
├── PERFORMANCE.md (performance patterns)
|
|
475
|
+
├── STYLE.md (style guide reference)
|
|
476
|
+
└── scripts/
|
|
477
|
+
└── run-linters.sh
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
Usage: "Can you review this code?" (automatic discovery)
|
|
481
|
+
|
|
482
|
+
The Skill provides richer context, validation scripts, and organized reference material.
|
|
483
|
+
|
|
484
|
+
### When to use each
|
|
485
|
+
|
|
486
|
+
**Use slash commands**:
|
|
487
|
+
|
|
488
|
+
* You invoke the same prompt repeatedly
|
|
489
|
+
* The prompt fits in a single file
|
|
490
|
+
* You want explicit control over when it runs
|
|
491
|
+
|
|
492
|
+
**Use Skills**:
|
|
493
|
+
|
|
494
|
+
* Claude should discover the capability automatically
|
|
495
|
+
* Multiple files or scripts are needed
|
|
496
|
+
* Complex workflows with validation steps
|
|
497
|
+
* Team needs standardized, detailed guidance
|
|
498
|
+
|
|
499
|
+
Both slash commands and Skills can coexist. Use the approach that fits your needs.
|
|
500
|
+
|
|
501
|
+
Learn more about [Agent Skills](/en/skills).
|
|
502
|
+
|
|
503
|
+
## See also
|
|
504
|
+
|
|
505
|
+
* [Plugins](/en/plugins) - Extend Claude Code with custom commands through plugins
|
|
506
|
+
* [Identity and Access Management](/en/iam) - Complete guide to permissions, including MCP tool permissions
|
|
507
|
+
* [Interactive mode](/en/interactive-mode) - Shortcuts, input modes, and interactive features
|
|
508
|
+
* [CLI reference](/en/cli-reference) - Command-line flags and options
|
|
509
|
+
* [Settings](/en/settings) - Configuration options
|
|
510
|
+
* [Memory management](/en/memory) - Managing Claude's memory across sessions
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
---
|
|
514
|
+
|
|
515
|
+
> To find navigation and other pages in this documentation, fetch the llms.txt file at: https://code.claude.com/docs/llms.txt
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Commands
|
|
2
|
+
|
|
3
|
+
Custom commands allow you to create reusable workflows that can be triggered with a simple `/` prefix in the chat input box. These commands help standardize processes across your team and make common tasks more efficient.
|
|
4
|
+
|
|
5
|
+
Commands are currently in beta. The feature and syntax may change as we continue to improve it.
|
|
6
|
+
|
|
7
|
+
## How commands work
|
|
8
|
+
|
|
9
|
+
Commands are defined as plain Markdown files that can be stored in three locations:
|
|
10
|
+
|
|
11
|
+
1. **Project commands**: Stored in the `.cursor/commands` directory of your project
|
|
12
|
+
2. **Global commands**: Stored in the `~/.cursor/commands` directory in your home directory
|
|
13
|
+
3. **Team commands**: Created by team admins in the [Cursor Dashboard](https://cursor.com/dashboard?tab=team-content§ion=commands) and automatically available to all team members
|
|
14
|
+
|
|
15
|
+
When you type `/` in the chat input box, Cursor will automatically detect and display available commands from all locations, making them instantly accessible across your workflow.
|
|
16
|
+
|
|
17
|
+
## Creating commands
|
|
18
|
+
|
|
19
|
+
1. Create a `.cursor/commands` directory in your project root
|
|
20
|
+
2. Add `.md` files with descriptive names (e.g., `review-code.md`, `write-tests.md`)
|
|
21
|
+
3. Write plain Markdown content describing what the command should do
|
|
22
|
+
4. Commands will automatically appear in the chat when you type `/`
|
|
23
|
+
|
|
24
|
+
Here's an example of how your commands directory structure might look:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
.cursor/
|
|
28
|
+
└── commands/
|
|
29
|
+
├── address-github-pr-comments.md
|
|
30
|
+
├── code-review-checklist.md
|
|
31
|
+
├── create-pr.md
|
|
32
|
+
├── light-review-existing-diffs.md
|
|
33
|
+
├── onboard-new-developer.md
|
|
34
|
+
├── run-all-tests-and-fix.md
|
|
35
|
+
├── security-audit.md
|
|
36
|
+
└── setup-new-feature.md
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Team commands
|
|
40
|
+
|
|
41
|
+
Team commands are available on Team and Enterprise plans.
|
|
42
|
+
|
|
43
|
+
Team admins can create server-enforced custom commands that are automatically available to all team members. This makes it easy to share standardized prompts and workflows across your entire organization.
|
|
44
|
+
|
|
45
|
+
### Creating team commands
|
|
46
|
+
|
|
47
|
+
1. Navigate to the [Team Content dashboard](https://cursor.com/dashboard?tab=team-content§ion=commands)
|
|
48
|
+
2. Click to create a new command
|
|
49
|
+
3. Provide:
|
|
50
|
+
- **Name**: The command name that will appear after the `/` prefix
|
|
51
|
+
- **Description** (optional): Helpful context about what the command does
|
|
52
|
+
- **Content**: The Markdown content that defines the command's behavior
|
|
53
|
+
4. Save the command
|
|
54
|
+
|
|
55
|
+
Once created, team commands are immediately available to all team members when they type `/` in the chat input box. Team members don't need to manually sync or download anything - the commands are automatically synchronized.
|
|
56
|
+
|
|
57
|
+
### Benefits of team commands
|
|
58
|
+
|
|
59
|
+
- **Centralized management**: Update commands once and changes are instantly available to all team members
|
|
60
|
+
- **Standardization**: Ensure everyone uses consistent workflows and best practices
|
|
61
|
+
- **Easy sharing**: No need to distribute files or coordinate updates across the team
|
|
62
|
+
- **Access control**: Only team admins can create and modify team commands
|
|
63
|
+
|
|
64
|
+
## Parameters
|
|
65
|
+
|
|
66
|
+
You can provide additional context to a command in the Agent chat input. Anything you type after the command name is included in the model prompt alongside your provided input. For example:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
/commit and /pr these changes to address DX-523
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Examples
|
|
73
|
+
|
|
74
|
+
Try these commands in your projects to get a feel for how they work.
|
|
75
|
+
|
|
76
|
+
### Code review checklist
|
|
77
|
+
|
|
78
|
+
### Security audit
|
|
79
|
+
|
|
80
|
+
### Setup new feature
|
|
81
|
+
|
|
82
|
+
### Create pull request
|
|
83
|
+
|
|
84
|
+
### Run tests and fix failures
|
|
85
|
+
|
|
86
|
+
### Onboard new developer
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
# Onboard New Developer## OverviewComprehensive onboarding process to get a new developer up and running quickly.## Steps1. **Environment setup** - Install required tools - Set up development environment - Configure IDE and extensions - Set up git and SSH keys2. **Project familiarization** - Review project structure - Understand architecture - Read key documentation - Set up local database## Onboarding Checklist- [ ] Development environment ready- [ ] All tests passing- [ ] Can run application locally- [ ] Database set up and working- [ ] First PR submitted
|
|
90
|
+
```
|