You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: replace ! with [BANG] placeholder in skill documentation (#142)
## Summary
- Replace `!` followed by backticks with `[BANG]` placeholder in
command-development skill files
- Prevents bash execution errors when skills are loaded into Claude's
context
## Problem
Skill documentation containing the `!` prefix (used for pre-execution in
slash commands) triggers unintended bash execution when the skill
content is loaded. This causes errors like:
```
Bash command permission check failed for pattern "!`...": Command contains newlines...
```
## Solution
Use `[BANG]` as a placeholder in skill documentation. When Claude
explains the concept to users, it correctly renders the actual `!`
syntax they should use in their command files.
## Related Issue
Workaround for anthropics/claude-code#12781
## Test plan
- [x] Load plugin locally with `cc --plugin-dir plugins/plugin-dev`
- [x] Trigger skill loading by asking about command development
- [x] Trigger reference file loading by asking about CLAUDE_PLUGIN_ROOT
- [x] Verify no bash execution errors occur
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: plugins/plugin-dev/skills/command-development/SKILL.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -337,28 +337,28 @@ Ensure:
337
337
338
338
Commands can execute bash commands inline to dynamically gather context before Claude processes the command. This is useful for including repository state, environment information, or project-specific context.
339
339
340
-
### Syntax: The `!` Prefix
340
+
### Syntax: The `[BANG]` Prefix
341
341
342
-
In actual command files, use the `!` prefix before backticks for pre-execution:
342
+
In actual command files, use `[BANG]` (exclamation mark) before backticks for pre-execution:
343
343
344
344
```markdown
345
-
Current branch: !`git branch --show-current`
346
-
Files changed: !`git diff --name-only`
347
-
Environment: !`echo $NODE_ENV`
345
+
Current branch: [BANG]`git branch --show-current`
346
+
Files changed: [BANG]`git diff --name-only`
347
+
Environment: [BANG]`echo $NODE_ENV`
348
348
```
349
349
350
350
**How it works:**
351
351
352
-
1. Before Claude sees the command, Claude Code executes `!`command`` blocks
353
-
2. The bash output replaces the entire `!`command`` expression
352
+
1. Before Claude sees the command, Claude Code executes `[BANG]`command`` blocks
353
+
2. The bash output replaces the entire `[BANG]`command`` expression
354
354
3. Claude receives the expanded prompt with actual values
355
355
356
356
**Example expansion:**
357
357
358
358
Command file contains:
359
359
360
360
```markdown
361
-
Review the !`git diff --name-only | wc -l | tr -d ' '` changed files on branch !`git branch --show-current`.
361
+
Review the [BANG]`git diff --name-only | wc -l | tr -d ' '` changed files on branch [BANG]`git branch --show-current`.
362
362
```
363
363
364
364
Claude receives (after pre-execution):
@@ -367,15 +367,15 @@ Claude receives (after pre-execution):
367
367
Review the 3 changed files on branch feature/add-auth.
368
368
```
369
369
370
-
### Why Skill Examples Omit `!`
370
+
### Why Skill Examples Omit `[BANG]`
371
371
372
-
Examples in skill documentation use plain backticks without `!`:
372
+
Examples in skill documentation use plain backticks without `[BANG]`:
373
373
374
374
```markdown
375
375
Files changed: `git diff --name-only`
376
376
```
377
377
378
-
This is intentional. When skill content loads into Claude's context, `!`command`` would actually execute. Skill examples show the conceptual pattern; add the `!` prefix when writing actual command files.
378
+
This is intentional. When skill content loads into Claude's context, `[BANG]` followed by `[command name]` would actually execute. Skill examples show the conceptual pattern; add the `[BANG]` prefix when writing actual command files.
0 commit comments